1 #ifndef __CPPLUGINS__INTERFACE__H__
2 #define __CPPLUGINS__INTERFACE__H__
4 #include <cpPlugins/Config.h>
5 #include <cpPlugins/ProcessObject.h>
14 class cpPlugins_EXPORT Interface
17 typedef Interface Self;
19 typedef void* ( *TCreator )( );
20 typedef std::pair< std::string, TCreator > TDynFunc;
21 typedef std::map< std::string, TDynFunc > TDynFilter;
22 typedef std::map< std::string, TDynFilter > TDynFilters;
23 typedef std::map< std::string, std::set< std::string > > TFilters;
24 typedef std::pair< std::string, void* > TDynFileInfo;
25 typedef std::map< std::string, TDynFileInfo > TDynLibraries;
29 virtual ~Interface( );
31 const TFilters& GetFilters( );
34 void GuessAccesiblePlugins( );
35 void LoadPlugin( const std::string& name );
36 void LoadPluginDir( const std::string& dirname );
37 void LoadPluginFile( const std::string& filename );
40 ProcessObject::Pointer Create(
41 const std::string& category, const std::string& name
43 std::string GetPluginName(
44 const std::string& category, const std::string& name
46 std::string GetPluginName( const ProcessObject* obj ) const;
47 std::set< std::string > GetPlugins( ) const;
50 static void* _DLOpen( const std::string& fname, std::string& error );
51 static const char* _DLGetName( void* hnd );
52 static TFilters _DLGetFilters( void* hnd );
53 static TCreator _DLGetCreator(
54 void* hnd, const std::string& category, const std::string& name
56 static void _DLClose( void* hnd );
59 std::vector< std::string > m_Paths;
60 TDynLibraries m_DynLibraries;
61 TDynFilters m_DynFilters;
64 static unsigned int InterfacesCount;
69 #endif // __CPPLUGINS__INTERFACE__H__