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