00001 #ifndef __DYNAMIC_LIB_MANAGER_H__ 00002 #define __DYNAMIC_LIB_MANAGER_H__ 00003 00004 #include <loaders/dynamic_lib_loader.h> 00005 #include <managers/object_manager.h> 00006 #include <utilities/cpp_utilities.h> 00007 #include <utilities/testing_utilities.h> 00008 00009 #if !defined( WIN32_PLATFORM ) && !defined( NIX_PLATFORM ) && !defined( MINGW_PLATFORM ) && !defined( CYGWIN_PLATFORM ) 00010 #define WIN32_PLATFORM 00011 #endif 00012 00013 #ifdef DYNAMIC_LIB_MANAGER 00014 #if defined( WIN32_PLATFORM ) || defined( MINGW_PLATFORM ) || defined( CYGWIN_PLATFORM ) 00015 #define DL_MANAGER_DLL_ENTITY __declspec( dllexport ) 00016 #endif 00017 00018 #if defined( NIX_PLATFORM ) 00019 #define DL_MANAGER_DLL_ENTITY 00020 #endif 00021 #else 00022 #ifdef WIN32_PLATFORM 00023 #define DL_MANAGER_DLL_ENTITY __declspec( dllimport ) 00024 #pragma comment( lib , "dynamic_lib_manager.lib" ) 00025 #endif 00026 00027 #if defined( CYGWIN_PLATFORM ) || defined( MINGW_PLATFORM ) 00028 #define DL_MANAGER_DLL_ENTITY __declspec( dllimport ) 00029 #endif 00030 00031 #if defined( NIX_PLATFORM ) 00032 #define DL_MANAGER_DLL_ENTITY 00033 #endif 00034 #endif 00035 00036 namespace nitro 00037 { 00050 class DL_MANAGER_DLL_ENTITY DynamicLibManager{ 00051 public: 00052 00053 DECLARE_RELEASE_FUNCTION( Release , Manager ) 00054 00055 DECLARE_DESTRUCTOR( VIRTUAL , DynamicLibManager ) 00056 00057 DECLARE_SQUARE_BRACE_OPERATOR_REF_LOCATOR( nitro::DynamicLibLoader ); 00058 00059 DECLARE_SQUARE_BRACE_OPERATOR_REF_CURSOR( nitro::DynamicLibLoader ); 00060 00079 void LoadLibrary( const char * LibraryPath ); 00080 00081 ALIAS_FUNCTION_1( LoadLibrary , aliasLoadLibrary , const char * ) 00082 00083 00101 void LoadLibrary( const std::string & LibraryPath ); 00102 00103 private: 00104 00115 nitro::ObjectManager< nitro::DynamicLibLoader > Manager; 00116 }; 00117 00118 DEFINE_SQUARE_BRACE_OPERATOR_REF_CURSOR( nitro::DynamicLibLoader , DynamicLibManager , Manager ); 00119 } 00120 00121 #endif