]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface.h
...
[cpPlugins.git] / lib / cpPlugins / Interface.h
index 451c0e07e062c66989ca3f6c8c101719d20dc3e6..cd66bbde5e06716011e3349ccacb76f05dd7fb5e 100644 (file)
@@ -20,8 +20,9 @@ namespace cpPlugins
     typedef std::pair< std::string, TCreator >               TDynFunc;
     typedef std::map< std::string, TDynFunc >                TDynFilter;
     typedef std::map< std::string, TDynFilter >              TDynFilters;
-    typedef std::map< std::string, void* >                   TDynLibraries;
     typedef std::map< std::string, std::set< std::string > > TFilters;
+    typedef std::pair< std::string, void* >                  TDynFileInfo;
+    typedef std::map< std::string, TDynFileInfo >            TDynLibraries;
 
   public:
     Interface( );
@@ -29,18 +30,25 @@ namespace cpPlugins
 
     const TFilters& GetFilters( );
 
-    bool LoadConfiguration( const std::string& filename );
-    bool SaveConfiguration( const std::string& filename ) const;
+    void UpdatePaths( );
+    void GuessAccesiblePlugins( );
+    void LoadPlugin( const std::string& name );
+    void LoadPluginDir( const std::string& dirname );
     void LoadPluginFile( const std::string& filename );
-    unsigned int LoadPluginDir( const std::string& dirname );
     void UnloadAll( );
 
-    cpPlugins::ProcessObject::Pointer Create(
+    ProcessObject::Pointer Create(
       const std::string& category, const std::string& name
       );
+    std::string GetPluginName(
+      const std::string& category, const std::string& name
+      ) const;
+    std::string GetPluginName( const ProcessObject* obj ) const;
+    std::set< std::string > GetPlugins( ) const;
 
   protected:
-    static void* _DLOpen( const std::string& fname );
+    static void* _DLOpen( const std::string& fname, std::string& error );
+    static const char* _DLGetName( void* hnd );
     static TFilters _DLGetFilters( void* hnd );
     static TCreator _DLGetCreator(
       void* hnd, const std::string& category, const std::string& name
@@ -48,9 +56,12 @@ namespace cpPlugins
     static void _DLClose( void* hnd );
 
   protected:
+    std::vector< std::string > m_Paths;
     TDynLibraries m_DynLibraries;
     TDynFilters   m_DynFilters;
     TFilters      m_Filters;
+
+    static unsigned int InterfacesCount;
   };
 
 } // ecapseman