Low-level wrapper for loading shared libraries (DLLs) and accessing symbols within it. More...
#include <yarp/os/SharedLibrary.h>
Public Member Functions | |
SharedLibrary () | |
Initialize, without opening a shared library yet. More... | |
SharedLibrary (const char *filename) | |
Load the named shared library / DLL. More... | |
SharedLibrary (const SharedLibrary &)=delete | |
SharedLibrary & | operator= (const SharedLibrary &)=delete |
virtual | ~SharedLibrary () |
Destructor. More... | |
bool | open (const char *filename) |
Load the named shared library / DLL. More... | |
bool | close () |
Shared library no longer needed, unload if not in use elsewhere. More... | |
std::string | error () |
Returns a human-readable string describing the most recent error that occurred from a call to one of its functions. More... | |
void * | getSymbol (const char *symbolName) |
Look up a symbol in the shared library. More... | |
bool | isValid () const |
Check if the shared library is valid. More... | |
Low-level wrapper for loading shared libraries (DLLs) and accessing symbols within it.
Definition at line 33 of file SharedLibrary.h.
SharedLibrary::SharedLibrary | ( | ) |
Initialize, without opening a shared library yet.
Definition at line 59 of file SharedLibrary.cpp.
SharedLibrary::SharedLibrary | ( | const char * | filename | ) |
Load the named shared library / DLL.
filename | name of file (see open method) |
Definition at line 65 of file SharedLibrary.cpp.
|
delete |
|
virtual |
bool SharedLibrary::close | ( | ) |
Shared library no longer needed, unload if not in use elsewhere.
Definition at line 104 of file SharedLibrary.cpp.
std::string SharedLibrary::error | ( | ) |
Returns a human-readable string describing the most recent error that occurred from a call to one of its functions.
Definition at line 124 of file SharedLibrary.cpp.
void * SharedLibrary::getSymbol | ( | const char * | symbolName | ) |
Look up a symbol in the shared library.
Definition at line 129 of file SharedLibrary.cpp.
bool SharedLibrary::isValid | ( | ) | const |
Check if the shared library is valid.
Definition at line 148 of file SharedLibrary.cpp.
bool SharedLibrary::open | ( | const char * | filename | ) |
Load the named shared library / DLL.
The library is found using the algoithm of ACE::ldfind. Operating-system-specific extensions will be tried, and the relevant path for shared libraries.
filename | name of file. |
Definition at line 79 of file SharedLibrary.cpp.
|
delete |