dllproxy.h
Go to the documentation of this file.00001 #ifndef CPPUT_DLLPROXY_H_INCLUDED
00002 # define CPPUT_DLLPROXY_H_INCLUDED
00003
00004 # include <cpput/config.h>
00005 # include <stdexcept>
00006
00007 # ifdef CPPUT_DLL_SUPPORT
00008
00009 namespace CppUT {
00010
00011 class DllProxyError : public std::runtime_error
00012 {
00013 public:
00014 DllProxyError( const std::string &message );
00015 };
00016
00017
00040 class DllProxy : public CppTL::NonCopyable
00041 {
00042 public:
00048 DllProxy( const std::string &path );
00049
00051 ~DllProxy();
00052
00058 void *findSymbol( const std::string &symbol );
00059
00060 private:
00061 typedef void *Symbol;
00062 typedef void *LibraryHandle;
00063
00069 void loadLibrary( const std::string &libraryName );
00070
00075 void releaseLibrary();
00076
00083 LibraryHandle doLoadLibrary( const std::string &libraryName );
00084
00091 void doReleaseLibrary();
00092
00099 Symbol doFindSymbol( const std::string &symbol );
00100
00109 std::string getLastErrorDetail() const;
00110
00111 private:
00112 LibraryHandle handle_;
00113 std::string path_;
00114 };
00115
00116
00117 }
00118
00119 #endif // # ifdef CPPUT_DLL_SUPPORT
00120
00121 #endif // CPPUT_DLLPROXY_H_INCLUDED