]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Interface.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / Interface.h
index 1db73b95dd54af33348eb3999668ba51f2711946..2c4ad5e04877174831d3763229b10cde5610b7e2 100644 (file)
@@ -6,7 +6,9 @@
 #include <vector>
 #include <Pluma/Pluma.hpp>
 
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 #include <cpPlugins/Interface/Object.h>
+#include <cpPlugins/Interface/ProcessObject.h>
 
 namespace cpPlugins
 {
@@ -14,11 +16,16 @@ namespace cpPlugins
   {
     /**
      */
-    class Interface
+    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;
@@ -27,27 +34,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* CreateObject( 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