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