| CppUnit project page | FAQ | CppUnit home page |
Manages dynamic libraries. More...
#include <DynamicLibraryManager.h>
Public Types | |
| typedef void * | Symbol |
| typedef void * | LibraryHandle |
Public Member Functions | |
| DynamicLibraryManager (const std::string &libraryFileName) | |
| Loads the specified library. | |
| ~DynamicLibraryManager () | |
| Releases the loaded library.. | |
| Symbol | findSymbol (const std::string &symbol) |
| Returns a pointer on the specified symbol exported by the library. | |
Private Member Functions | |
| void | loadLibrary (const std::string &libraryName) |
| void | releaseLibrary () |
| LibraryHandle | doLoadLibrary (const std::string &libraryName) |
| void | doReleaseLibrary () |
| Symbol | doFindSymbol (const std::string &symbol) |
| std::string | getLastErrorDetail () const |
| DynamicLibraryManager (const DynamicLibraryManager ©) | |
| Prevents the use of the copy constructor. | |
| void | operator= (const DynamicLibraryManager ©) |
| Prevents the use of the copy operator. | |
Private Attributes | |
| LibraryHandle | m_libraryHandle |
| std::string | m_libraryName |
Manages dynamic libraries.
The Dynamic Library Manager provides a platform independent way to work with dynamic library. It load a specific dynamic library, and can returns specific symbol exported by the dynamic library.
If an error occurs, a DynamicLibraryManagerException is thrown.
| typedef void* DynamicLibraryManager::LibraryHandle |
| typedef void* DynamicLibraryManager::Symbol |
| CPPUNIT_NS_BEGIN DynamicLibraryManager::DynamicLibraryManager | ( | const std::string & | libraryFileName | ) |
Loads the specified library.
| libraryFileName | Name of the library to load. |
| DynamicLibraryManagerException | if a failure occurs while loading the library (fail to found or load the library). |
| DynamicLibraryManager::~DynamicLibraryManager | ( | ) |
Releases the loaded library..
| DynamicLibraryManager::DynamicLibraryManager | ( | const DynamicLibraryManager & | copy | ) | [private] |
Prevents the use of the copy constructor.
| Symbol DynamicLibraryManager::doFindSymbol | ( | const std::string & | symbol | ) | [private] |
Returns a pointer on the specified symbol exported by the library.
May throw any exceptions (indicates failure).
| symbol | Name of the symbol exported by the library. |
NULL indicates failure. | LibraryHandle DynamicLibraryManager::doLoadLibrary | ( | const std::string & | libraryName | ) | [private] |
Loads the specified library.
May throw any exceptions (indicates failure).
| libraryName | Name of the library to load. |
NULL indicates failure. | void DynamicLibraryManager::doReleaseLibrary | ( | ) | [private] |
Releases the loaded library.
The handle of the library to free is in m_libraryHandle. It is never NULL.
| DynamicLibraryManager::Symbol DynamicLibraryManager::findSymbol | ( | const std::string & | symbol | ) |
Returns a pointer on the specified symbol exported by the library.
| symbol | Name of the symbol exported by the library. |
NULL. | DynamicLibraryManagerException | if the symbol is not found. |
| std::string DynamicLibraryManager::getLastErrorDetail | ( | ) | const [private] |
Returns detailed information about doLoadLibrary() failure.
Called just after a failed call to doLoadLibrary() to get extra error information.
| void DynamicLibraryManager::loadLibrary | ( | const std::string & | libraryName | ) | [private] |
Loads the specified library.
| libraryName | Name of the library to load. |
| DynamicLibraryManagerException | if a failure occurs while loading the library (fail to found or load the library). |
| void DynamicLibraryManager::operator= | ( | const DynamicLibraryManager & | copy | ) | [private] |
Prevents the use of the copy operator.
| void DynamicLibraryManager::releaseLibrary | ( | ) | [private] |
Releases the loaded library.
std::string DynamicLibraryManager::m_libraryName [private] |
|
|
hosts this site. |
Send comments to: CppUnit Developers |