X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FInterface.h;h=94718f8a919d9558e67cf30822212b3d9f0da23b;hb=35d769c683c10f5c18d17a3e423d89f5b30a5b77;hp=585e2d5fd4b260824390559a4cc204fb6766825d;hpb=cb833d2fface96e020fe91584d2206860a8174ee;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Interface.h b/lib/cpPlugins/Interface/Interface.h index 585e2d5..94718f8 100644 --- a/lib/cpPlugins/Interface/Interface.h +++ b/lib/cpPlugins/Interface/Interface.h @@ -4,12 +4,17 @@ #include #include #include -#include #include #include #include +// Some forward declarations +namespace pluma +{ + class Pluma; +} + namespace cpPlugins { namespace Interface @@ -19,8 +24,13 @@ namespace cpPlugins class cpPlugins_Interface_EXPORT Interface { public: - typedef std::vector< ObjectProvider* > TProviders; - typedef std::map< std::string, unsigned int > TClasses; + typedef Interface Self; + typedef std::vector< ProcessObjectProvider* > TProviders; + typedef std::map< std::string, unsigned int > TClass; + typedef std::map< std::string, TClass > TClasses; + typedef + std::map< std::string, std::vector< std::string > > + TLoadedPlugins; typedef TProviders::const_iterator TProvidersIterator; typedef TClasses::const_iterator TClassesIterator; @@ -29,30 +39,38 @@ namespace cpPlugins Interface( ); virtual ~Interface( ); - /// Plugin access + bool LoadDefaultConfiguration( const std::string& path ); + bool SaveDefaultConfiguration( const std::string& path ); + + // Plugin access TClasses& GetClasses( ); const TClasses& GetClasses( ) const; - Object::Pointer CreateObject( const std::string& name ) const; - ProcessObject::Pointer CreateProcessObject( - const std::string& name - ) const; + TLoadedPlugins& GetLoadedPlugins( ); + const TLoadedPlugins& GetLoadedPlugins( ) const; + ProcessObject::Pointer CreateObject( const std::string& name ) const; - /// Interface to PLUMA + // Interface to PLUMA bool Load( const std::string& path ); bool Load( const std::string& folder, const std::string& name ); - int LoadFromFolder( const std::string& folder, bool r = false ); + bool LoadFromFolder( const std::string& folder, bool r = false ); bool Unload( const std::string& name ); void UnloadAll( ); - void GetLoadedPlugins( std::vector< const std::string* >& names ) const; bool IsLoaded( const std::string& name ) const; protected: void _LoadClasses( ); + static void _SepFName( + const std::string& path, + std::string& folder, + std::string& name + ); + protected: - pluma::Pluma m_Pluma; - TProviders m_Providers; - TClasses m_Classes; + pluma::Pluma* m_Pluma; + TProviders m_Providers; + TClasses m_Classes; + TLoadedPlugins m_LoadedPlugins; }; } // ecapseman