Go to the documentation of this file.00001 #ifndef __DYNAMIC_LIB_LOADER_H__
00002 #define __DYNAMIC_LIB_LOADER_H__
00003
00004 #include <utilities/testing_utilities.h>
00005
00006 #if !defined( WIN32_PLATFORM ) && !defined( NIX_PLATFORM ) && !defined( MINGW_PLATFORM ) && !defined( CYGWIN_PLATFORM )
00007 #define WIN32_PLATFORM
00008 #endif
00009
00010 #ifdef DYNAMIC_LIB_LOADER
00011 #if defined( WIN32_PLATFORM ) || defined( MINGW_PLATFORM ) || defined( CYGWIN_PLATFORM )
00012 #define DYNAMIC_LIB_LOADER_DLL_ENTITY __declspec( dllexport )
00013 #endif
00014
00015 #if defined( NIX_PLATFORM )
00016 #define DYNAMIC_LIB_LOADER_DLL_ENTITY
00017 #endif
00018 #else
00019 #ifdef WIN32_PLATFORM
00020 #define DYNAMIC_LIB_LOADER_DLL_ENTITY __declspec( dllimport )
00021 #pragma comment( lib , "dynamic_lib_loader.lib" )
00022 #endif
00023
00024 #if defined( CYGWIN_PLATFORM ) || defined( MINGW_PLATFORM )
00025 #define DYNAMIC_LIB_LOADER_DLL_ENTITY __declspec( dllimport )
00026 #endif
00027
00028 #if defined( NIX_PLATFORM )
00029 #define DYNAMIC_LIB_LOADER_DLL_ENTITY
00030 #endif
00031 #endif
00032
00033 namespace nitro
00034 {
00035
00048 class DYNAMIC_LIB_LOADER_DLL_ENTITY DynamicLibLoader{
00049 public:
00050
00061 DynamicLibLoader( void );
00062
00081 DynamicLibLoader( const char * LibraryPath );
00082
00101 DynamicLibLoader( const std::string & LibraryPath );
00102
00121 void LoadLibrary( const char * LibraryPath );
00122
00123 ALIAS_FUNCTION_1( LoadLibrary , aliasLoadLibrary , const char * )
00124
00125
00143 void LoadLibrary( const std::string & LibraryPath );
00144
00167 void * GetResource( const char * ResourceName );
00168
00169 ALIAS_FUNCTION_1R( GetResource , aliasGetResource , const char * , void * )
00170
00171
00193 void * GetResource( const std::string & ResourceName );
00194
00217 bool ResourceExists( const char * ResourceName );
00218
00219 ALIAS_FUNCTION_1R( ResourceExists , aliasResourceExists , const char * , bool )
00220
00221
00243 bool ResourceExists( const std::string & ResourceName );
00244
00259 void Release( void );
00260
00271 virtual ~DynamicLibLoader();
00272
00273 private:
00274
00285 void * Handle;
00286
00297 DynamicLibLoader( const DynamicLibLoader & ){}
00298
00309 DynamicLibLoader operator=( const DynamicLibLoader & ){return( *this );}
00310
00311 };
00312
00313 }
00314 #endif