]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface.h
ee3fa0c2f2d64e9101e15e98f5d67bb22365d642
[cpPlugins.git] / lib / cpPlugins / Interface.h
1 #ifndef __CPPLUGINS__INTERFACE__H__
2 #define __CPPLUGINS__INTERFACE__H__
3
4 #include <cpPlugins/Config.h>
5 #include <cpPlugins/ProcessObject.h>
6 #include <map>
7 #include <set>
8 #include <utility>
9 #include <vector>
10
11 namespace cpPlugins
12 {
13   /**
14    */
15   class cpPlugins_EXPORT Interface
16   {
17   public:
18     typedef Interface Self;
19
20     typedef void* ( *TCreator )( );
21     typedef std::map< std::string, void* > TLibraries;
22     struct TCreatorData
23     {
24       std::string PluginName;
25       void*       LibraryHandle;
26       TCreator    Creator;
27     };
28     typedef std::map< std::string, TCreatorData > TFilterData;
29     typedef std::map< std::string, TFilterData >  TFilters;
30     typedef std::set< std::string >               TStrings;
31
32   public:
33     Interface( );
34     virtual ~Interface( );
35
36     const TStrings& GetPaths( ) const;
37     TStrings GetLibraries( ) const;
38     TStrings GetPlugins( ) const;
39     TStrings GetCategories( ) const;
40     TStrings GetFilters( const std::string& category ) const;
41
42     void AddEnvironments( const std::string& new_environment );
43     void LoadEnvironments( );
44     void SaveEnvironments( const std::string& dir ) const;
45     void OpenEnvironments( const std::string& dir );
46
47     void LoadFile( const std::string& fname );
48     void LoadPlugin( const std::string& pname );
49     void LoadDirectory( const std::string& dirname );
50     void GuessPlugins( );
51
52     cpPlugins::ProcessObject::Pointer CreateProcessObject(
53       const std::string& category, const std::string& name
54       );
55
56   protected:
57     TStrings   m_Paths;
58     TLibraries m_Libraries;
59     TLibraries m_Plugins;
60     TFilters   m_Filters;
61   };
62
63 } // ecapseman
64
65 #endif // __CPPLUGINS__INTERFACE__H__
66
67 // eof - $RCSfile$