#include <SharedLibrary.h>
Public Member Functions | |
const std::string & | getPath () const |
void * | getSymbol (const std::string &name) |
bool | hasSymbol (const std::string &name) |
Returns true iff a library has been loaded. | |
bool | isLoaded () const |
Unloads a shared library. | |
void | load (const std::string &path) |
SharedLibrary () | |
SharedLibrary (const std::string &path) | |
Creates a SharedLibrary object. | |
void | unload () |
virtual | ~SharedLibrary () |
Static Public Member Functions | |
static std::string | suffix () |
Private Member Functions | |
SharedLibrary & | operator= (const SharedLibrary &) |
SharedLibrary (const SharedLibrary &) |
The SharedLibrary class dynamically loads shared libraries at run-time.
Definition at line 62 of file SharedLibrary.h.
Definition at line 57 of file SharedLibrary.cpp.
Poco::SharedLibrary::SharedLibrary | ( | const std::string & | path | ) |
Creates a SharedLibrary object.
Definition at line 62 of file SharedLibrary.cpp.
Poco::SharedLibrary::~SharedLibrary | ( | ) | [virtual] |
Creates a SharedLibrary object and loads a library from the given path.
Definition at line 68 of file SharedLibrary.cpp.
Poco::SharedLibrary::SharedLibrary | ( | const SharedLibrary & | ) | [private] |
Returns the platform-specific filename suffix for shared libraries (including the period). In debug mode, the suffix also includes a "d" to specify the debug version of a library.
const std::string & Poco::SharedLibrary::getPath | ( | ) | const |
Returns the address of the symbol with the given name. For functions, this is the entry point of the function. Throws a NotFoundException if the symbol does not exist.
Definition at line 107 of file SharedLibrary.cpp.
void * Poco::SharedLibrary::getSymbol | ( | const std::string & | name | ) |
Returns true iff the loaded library contains a symbol with the given name.
Definition at line 97 of file SharedLibrary.cpp.
bool Poco::SharedLibrary::hasSymbol | ( | const std::string & | name | ) |
Returns true iff a library has been loaded.
Definition at line 91 of file SharedLibrary.cpp.
bool Poco::SharedLibrary::isLoaded | ( | ) | const |
Unloads a shared library.
Definition at line 85 of file SharedLibrary.cpp.
void Poco::SharedLibrary::load | ( | const std::string & | path | ) |
Destroys the SharedLibrary. The actual library remains loaded.
Definition at line 73 of file SharedLibrary.cpp.
SharedLibrary& Poco::SharedLibrary::operator= | ( | const SharedLibrary & | ) | [private] |
std::string Poco::SharedLibrary::suffix | ( | ) | [static] |
Returns the path of the library, as specified in a call to load() or the constructor.
Definition at line 113 of file SharedLibrary.cpp.
void Poco::SharedLibrary::unload | ( | ) |
Loads a shared library from the given path. Throws a LibraryAlreadyLoadedException if a library has already been loaded. Throws a LibraryLoadException if the library cannot be loaded.
Definition at line 79 of file SharedLibrary.cpp.