]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Interface.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / Interface.h
index a51f8be231409e38857b9b3a761b2c9dcebd818c..2c4ad5e04877174831d3763229b10cde5610b7e2 100644 (file)
@@ -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