#include <psharedlib.h>
Public Types | |
| enum | ldmode_t { bindNow, bindLazy } |
| Function binding mode. More... | |
Public Member Functions | |
| SharedLib (const std::string &path, ldmode_t mode=bindLazy) throw (SystemError) | |
| Constructor. | |
| ~SharedLib () throw () | |
| Destructor. | |
| void * | operator[] (const char *symbol) throw () |
| Resolve symbol from shared library. | |
A class that can be used to dynamically load shared libraries to resolve symbols from it. The example below shows how to retrieve the address of the cos function in the math library:
SharedLib shl("libm.so"); double (*cosine)(double); cosine = shl["cos"]; (*cosine)(2.0);
Definition at line 43 of file psharedlib.h.
|
|
Function binding mode.
Definition at line 46 of file psharedlib.h. |
|
||||||||||||
|
Constructor. Constructs the object and loads the shared library specified in the path argument.
|
|
|
Destructor. The destructor unloads the shared library from memory. |
|
|
Resolve symbol from shared library. Resolves a symbol from the shared library and returns a pointer to the symbol.
|
1.3.3