]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/Interface.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / Interface.h
1 #ifndef __CPPLUGINS__INTERFACE__INTERFACE__H__
2 #define __CPPLUGINS__INTERFACE__INTERFACE__H__
3
4 #include <map>
5 #include <string>
6 #include <vector>
7 #include <Pluma/Pluma.hpp>
8
9 #include <cpPlugins/cpPlugins_Export.h>
10 #include <cpPlugins/Interface/Object.h>
11 #include <cpPlugins/Interface/ProcessObject.h>
12
13 namespace cpPlugins
14 {
15   namespace Interface
16   {
17     /**
18      */
19     class cpPlugins_EXPORT Interface
20     {
21     public:
22       typedef std::vector< ObjectProvider* >        TProviders;
23       typedef std::map< std::string, unsigned int > TClasses;
24
25       typedef TProviders::const_iterator TProvidersIterator;
26       typedef TClasses::const_iterator   TClassesIterator;
27
28     public:
29       Interface( );
30       virtual ~Interface( );
31
32       // Plugin access
33       TClasses& GetClasses( );
34       const TClasses& GetClasses( ) const;
35       Object::Pointer CreateObject( const std::string& name ) const;
36       ProcessObject::Pointer CreateProcessObject(
37         const std::string& name
38         ) const;
39
40       // Interface to PLUMA
41       bool Load( const std::string& path );
42       bool Load( const std::string& folder, const std::string& name );
43       int LoadFromFolder( const std::string& folder, bool r = false );
44       bool Unload( const std::string& name );
45       void UnloadAll( );
46       void GetLoadedPlugins( std::vector< const std::string* >& names ) const;
47       bool IsLoaded( const std::string& name ) const;
48
49     protected:
50       void _LoadClasses( );
51
52     protected:
53       pluma::Pluma m_Pluma;
54       TProviders   m_Providers;
55       TClasses     m_Classes;
56     };
57
58   } // ecapseman
59
60 } // ecapseman
61
62 #endif // __CPPLUGINS__INTERFACE__INTERFACE__H__
63
64 // eof - $RCSfile$