Class providing dynamic loader functionality of system functions dlopen() and dlsym() to look up symbols.
More...
#include <DynamicLoader.h>
|
void * | lookup (const std::string &name) |
| Search the main program itself, and its currently loaded libraries for a symbol.
|
|
void * | lookup (const std::string &library, const std::string &name) |
| Return a pointer to a symbol from the given library.
|
|
|
void * | _defhandle |
| Handle, returned by dlopen(), of the program itself, and its linked and dynamically loaded libraries.
|
|
std::map< std::string, void * > | _libhandles |
| Handles, by library name, returned by dlopen() of libraries that are currently open, because one or more symbols have been found in them.
|
|
Class providing dynamic loader functionality of system functions dlopen() and dlsym() to look up symbols.
◆ DynamicLoader() [1/2]
DynamicLoader::DynamicLoader |
( |
| ) |
|
|
private |
◆ DynamicLoader() [2/2]
◆ ~DynamicLoader()
DynamicLoader::~DynamicLoader |
( |
| ) |
|
|
private |
◆ getInstance()
◆ lookup() [1/2]
void * DynamicLoader::lookup |
( |
const std::string & | library, |
|
|
const std::string & | name ) |
Return a pointer to a symbol from the given library.
@ param library: name of the library. @ param name: name of the symbol to look up.
If the library name is an empty string, then the libraries linked with the program, and any currently loaded dynamic libraries will be searched. If the library name is absolute (begins with a forward slash), then it is loaded. Otherwise a search for the library is done, using the program's library directory search path, which is controlled by compile time flags, the LD_LIBRARY_PATH environment variable, and ld.so/ldconfig/ld.so.conf. lookup() throws an exception if the library could not be found and loaded or the symbol could not be found in the library. If the symbol is found, the library will remain loaded, and symbols in that library can then be found via lookup(name), or by specifying an emptry string for the library.
- Exceptions
-
References _instanceLock, _libhandles, and nidas::core::getSample().
◆ lookup() [2/2]
void * DynamicLoader::lookup |
( |
const std::string & | name | ) |
|
◆ operator=()
◆ _defhandle
void* nidas::core::DynamicLoader::_defhandle |
|
private |
◆ _instance
◆ _instanceLock
◆ _libhandles
std::map<std::string,void*> nidas::core::DynamicLoader::_libhandles |
|
private |
Handles, by library name, returned by dlopen() of libraries that are currently open, because one or more symbols have been found in them.
Referenced by DynamicLoader(), and lookup().
The documentation for this class was generated from the following files: