diff options
Diffstat (limited to 'include/module/ModuleLoader.hpp')
-rwxr-xr-x | include/module/ModuleLoader.hpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/include/module/ModuleLoader.hpp b/include/module/ModuleLoader.hpp index 9626972..6eb9079 100755 --- a/include/module/ModuleLoader.hpp +++ b/include/module/ModuleLoader.hpp @@ -43,14 +43,14 @@ class BaseModuleLoader { mapType m_modules; public: - - BaseModuleLoader( const std::vector<std::string> files ) + + BaseModuleLoader( const std::vector<std::string> files, void *user_data = 0 ) { Module< Interface, CtorParams> m; for( std::vector<std::string>::const_iterator it = files.begin( ); it != files.end( ); it++ ) { #ifndef _WIN32 - m.handle = dlopen( it->c_str( ), RTLD_NOW ); + m.handle = dlopen( it->c_str( ), RTLD_NOW | RTLD_LOCAL ); #else m.handle = LoadLibrary( it->c_str( ) ); #endif @@ -81,7 +81,7 @@ class BaseModuleLoader { } if( m.registry->initModule != 0 ) { - m.registry->initModule( ); + m.registry->initModule( user_data ); } m_modules.insert( std::make_pair( m.registry->name, m ) ); @@ -131,8 +131,8 @@ class ModuleLoader< Interface, NullType > : public BaseModuleLoader< Interface, { public: - ModuleLoader< Interface >( const std::vector<std::string> files ) - : BaseModuleLoader< Interface >(files ) { } + ModuleLoader< Interface >( const std::vector<std::string> files, void *user_data = 0 ) + : BaseModuleLoader< Interface >( files, user_data ) { } Interface *create( std::string subclass ) { @@ -160,8 +160,8 @@ class ModuleLoader< Interface, TYPELIST_1( T1 ) > : public BaseModuleLoader< Int { public: - ModuleLoader< Interface, TYPELIST_1( T1 ) >( const std::vector<std::string> files ) - : BaseModuleLoader< Interface, TYPELIST_1( T1 ) >( files ) { } + ModuleLoader< Interface, TYPELIST_1( T1 ) >( const std::vector<std::string> files, void *user_data = 0 ) + : BaseModuleLoader< Interface, TYPELIST_1( T1 ) >( files, user_data ) { } Interface *create( std::string subclass, T1 t1 ) { @@ -189,8 +189,8 @@ class ModuleLoader< Interface, TYPELIST_2( T1, T2 ) > : public BaseModuleLoader< { public: - ModuleLoader< Interface, TYPELIST_2( T1, T2 ) >( const std::vector<std::string> files ) - : BaseModuleLoader< Interface, TYPELIST_2( T1, T2 ) >( files ) { } + ModuleLoader< Interface, TYPELIST_2( T1, T2 ) >( const std::vector<std::string> files, void *user_data = 0 ) + : BaseModuleLoader< Interface, TYPELIST_2( T1, T2 ) >( files, user_data ) { } Interface *create( std::string subclass, T1 t1, T2 t2 ) { @@ -218,8 +218,8 @@ class ModuleLoader< Interface, TYPELIST_3( T1, T2, T3 ) > : public BaseModuleLoa { public: - ModuleLoader< Interface, TYPELIST_3( T1, T2, T3 ) >( const std::vector<std::string> files ) - : BaseModuleLoader< Interface, TYPELIST_3( T1, T2, T3 ) >( files ) { } + ModuleLoader< Interface, TYPELIST_3( T1, T2, T3 ) >( const std::vector<std::string> files, void *user_data = 0 ) + : BaseModuleLoader< Interface, TYPELIST_3( T1, T2, T3 ) >( files, user_data ) { } Interface *create( std::string subclass, T1 t1, T2 t2, T3 t3 ) { @@ -247,8 +247,8 @@ class ModuleLoader< Interface, TYPELIST_4( T1, T2, T3, T4 ) > : public BaseModul { public: - ModuleLoader< Interface, TYPELIST_4( T1, T2, T3, T4 ) >( const std::vector<std::string> files ) - : BaseModuleLoader< Interface, TYPELIST_4( T1, T2, T3, T4 ) >( files ) { } + ModuleLoader< Interface, TYPELIST_4( T1, T2, T3, T4 ) >( const std::vector<std::string> files, void *user_data = 0 ) + : BaseModuleLoader< Interface, TYPELIST_4( T1, T2, T3, T4 ) >( files, user_data ) { } Interface *create( std::string subclass, T1 t1, T2 t2, T3 t3, T4 t4 ) { |