00001 #ifndef CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGER_H
00002 #define CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGER_H
00003
00004 #include <cppunit/Portability.h>
00005 #include <string>
00006
00007 #if !defined(CPPUNIT_NO_TESTPLUGIN)
00008
00009 CPPUNIT_NS_BEGIN
00010
00011
00034 class DynamicLibraryManager
00035 {
00036 public:
00037 typedef void *Symbol;
00038 typedef void *LibraryHandle;
00039
00045 DynamicLibraryManager( const std::string &libraryFileName );
00046
00048 ~DynamicLibraryManager();
00049
00055 Symbol findSymbol( const std::string &symbol );
00056
00057 private:
00063 void loadLibrary( const std::string &libraryName );
00064
00069 void releaseLibrary();
00070
00077 LibraryHandle doLoadLibrary( const std::string &libraryName );
00078
00085 void doReleaseLibrary();
00086
00093 Symbol doFindSymbol( const std::string &symbol );
00094
00103 std::string getLastErrorDetail() const;
00104
00106 DynamicLibraryManager( const DynamicLibraryManager © );
00107
00109 void operator =( const DynamicLibraryManager © );
00110
00111 private:
00112 LibraryHandle m_libraryHandle;
00113 std::string m_libraryName;
00114 };
00115
00116
00117 CPPUNIT_NS_END
00118
00119 #endif // !defined(CPPUNIT_NO_TESTPLUGIN)
00120
00121 #endif // CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGER_H