X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FInterface.h;h=2c4ad5e04877174831d3763229b10cde5610b7e2;hb=7caa01f9eacc4861ba7d5d9ed16872d60328088f;hp=a51f8be231409e38857b9b3a761b2c9dcebd818c;hpb=9015cf98c60cf4ab304a639990004ee783a8bec0;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Interface.h b/lib/cpPlugins/Interface/Interface.h index a51f8be..2c4ad5e 100644 --- a/lib/cpPlugins/Interface/Interface.h +++ b/lib/cpPlugins/Interface/Interface.h @@ -19,8 +19,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 +34,38 @@ namespace cpPlugins Interface( ); virtual ~Interface( ); + 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 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