#ifndef __cpPlugins__Interface__Loader__h__ #define __cpPlugins__Interface__Loader__h__ #include #include #include #include #include namespace cpPlugins { namespace Interface { /** */ class cpPlugins_EXPORT Loader { public: typedef Loader Self; public: typedef void ( *TContentsFunc )( std::vector< std::string >* ); typedef void ( *TCreatorFunc )( itk::LightObject::Pointer& ptr, const std::string& c, const std::string& f ); typedef std::tuple< void*, TContentsFunc, TCreatorFunc > THandlers; typedef std::map< std::string, THandlers > TLibraries; typedef std::map< std::string, std::map< std::string, std::string > > TFiltersToLibrariesReferences; public: Loader( ); virtual ~Loader( ); void Register( const std::string& filename ); void RegisterFromDirectory( const std::string& dirname ); void GuessEnvironment( const std::string& dirname ); void SaveEnvironment( const std::string& dirname ); void UnRegister( const std::string& filename ); void UnRegisterAll( ); std::map< std::string, std::set< std::string > > GetFilters( ) const; cpPlugins::Pipeline::ProcessObject::Pointer CreateFilter( const std::string& category, const std::string& filter, const std::string& name = "" ); protected: static TLibraries m_Libraries; static TFiltersToLibrariesReferences m_References; public: friend std::ostream& operator<<( std::ostream& o, const Loader& l ) { o << "cpPlugins:" << std::endl; for( auto c : l.m_References ) { o << " + " << c.first << std::endl; for( auto f : c.second ) o << " |--> " << f.first << " (" << f.second << ")" << std::endl; } // rof return( o ); } }; } // ecapseman } // ecapseman #endif // __cpPlugins__Interface__Loader__h__ // eof - $RCSfile$