1 #ifndef __cpPlugins__Interface__Loader__h__
2 #define __cpPlugins__Interface__Loader__h__
4 #include <cpPlugins/Config.h>
5 #include <cpPlugins/Pipeline/ProcessObject.h>
16 class cpPlugins_EXPORT Loader
22 typedef void ( *TContentsFunc )( std::vector< std::string >* );
23 typedef void ( *TCreatorFunc )( itk::LightObject::Pointer& ptr, const std::string& c, const std::string& f );
24 typedef std::tuple< void*, TContentsFunc, TCreatorFunc > THandlers;
25 typedef std::map< std::string, THandlers > TLibraries;
26 typedef std::map< std::string, std::map< std::string, std::string > > TFiltersToLibrariesReferences;
32 void Register( const std::string& filename );
33 void RegisterFromDirectory( const std::string& dirname );
34 void GuessEnvironment( const std::string& dirname );
35 void SaveEnvironment( const std::string& dirname );
36 void UnRegister( const std::string& filename );
37 void UnRegisterAll( );
39 std::map< std::string, std::set< std::string > > GetFilters( ) const;
41 cpPlugins::Pipeline::ProcessObject::Pointer CreateFilter(
42 const std::string& category, const std::string& filter,
43 const std::string& name = ""
47 static TLibraries m_Libraries;
48 static TFiltersToLibrariesReferences m_References;
51 friend std::ostream& operator<<( std::ostream& o, const Loader& l )
53 o << "cpPlugins:" << std::endl;
54 for( auto c : l.m_References )
56 o << " + " << c.first << std::endl;
57 for( auto f : c.second )
58 o << " |--> " << f.first << " (" << f.second << ")" << std::endl;
69 #endif // __cpPlugins__Interface__Loader__h__