00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00029
00031 #ifndef __DYNAMICLIBRARY_H__
00032 #define __DYNAMICLIBRARY_H__
00033
00034 #include <string>
00035 #include "H3DApi.h"
00036 #include "Exception.h"
00037
00038 namespace H3D {
00039 struct H3DAPI_API DynamicLibrary {
00042 H3D_VALUE_EXCEPTION( std::string, CouldNotLoadDynamicLibrary );
00043
00044 #if WIN32
00045 typedef HMODULE LIBHANDLE;
00046 typedef FARPROC SYMBOLPTR;
00047 #else
00048 typedef void * LIBHANDLE;
00049 typedef void * SYMBOLPTR;
00050 #endif
00051
00057 static LIBHANDLE load( const std::string &lib_name );
00058
00064 static int close( LIBHANDLE handle );
00065
00073 static SYMBOLPTR getSymbolAddress( LIBHANDLE handle,
00074 const std::string &symbol_name );
00075
00078 static string getLastError();
00079
00080 private:
00081 static string last_error;
00082 };
00083 }
00084
00085 #endif