#ifndef __CPPLUGINS__INTERFACE__H__ #define __CPPLUGINS__INTERFACE__H__ #include #include #include #include #include namespace cpPlugins { /** */ class cpPlugins_EXPORT Interface { public: typedef Interface Self; typedef void* ( *TCreator )( ); typedef std::pair< std::string, TCreator > TDynFunc; typedef std::map< std::string, TDynFunc > TDynFilter; typedef std::map< std::string, TDynFilter > TDynFilters; typedef std::map< std::string, std::set< std::string > > TFilters; typedef std::pair< std::string, void* > TDynFileInfo; typedef std::map< std::string, TDynFileInfo > TDynLibraries; public: Interface( ); virtual ~Interface( ); const TFilters& GetFilters( ); void UpdatePaths( ); void GuessAccesiblePlugins( ); void LoadPlugin( const std::string& name ); void LoadPluginDir( const std::string& dirname ); void LoadPluginFile( const std::string& filename ); void UnloadAll( ); ProcessObject::Pointer Create( const std::string& category, const std::string& name ); std::string GetPluginName( const std::string& category, const std::string& name ) const; std::string GetPluginName( const ProcessObject* obj ) const; std::set< std::string > GetPlugins( ) const; protected: static void* _DLOpen( const std::string& fname ); static const char* _DLGetName( void* hnd ); static TFilters _DLGetFilters( void* hnd ); static TCreator _DLGetCreator( void* hnd, const std::string& category, const std::string& name ); static void _DLClose( void* hnd ); protected: std::vector< std::string > m_Paths; TDynLibraries m_DynLibraries; TDynFilters m_DynFilters; TFilters m_Filters; }; } // ecapseman #endif // __CPPLUGINS__INTERFACE__H__ // eof - $RCSfile$