Helps to load and unload external libraries. More...
#include <library.hpp>
Public Member Functions | |
library () | |
library (const std::string &lib) | |
bool | load () |
bool | load (const std::string &lib) |
bool | unload () |
func_ptr | function (const std::string &f) const |
Detailed Description
Helps to load and unload external libraries.
This class represents a loader and unloader for an exernal library. The path to the library is given by a string. It can be loaded and unloaded. Furthermore it provides a method to get a pointer to an function exported by the library. The function is identfied by a name.
Constructor & Destructor Documentation
oos::library::library | ( | ) |
Create a unspecified library object
|
explicit |
Create a library for the given lib path
- Parameters
-
lib The path to the library to map.
Member Function Documentation
func_ptr oos::library::function | ( | const std::string & | f | ) | const |
Returns the pointer to the exported function of the library identified by the given name.
- Parameters
-
f The name of the exported function.
- Returns
- The pointer to the function.
bool oos::library::load | ( | ) |
Load the underlaying library. If the library path is invalid or the library cannot be loaded false is returned.
- Returns
- True on successful library loading.
bool oos::library::load | ( | const std::string & | lib | ) |
Sets the libray (and subsequently close and overwrite an already instatiated library) and load the underlaying library. If the library path is invalid or the library cannot be loaded false is returned.
- Parameters
-
lib The path to the library to load.
- Returns
- True on successful library loading.
bool oos::library::unload | ( | ) |
Unload an loaded library. If the library isn't loaded or an error occured while unloading false is returned.
- Returns
- True on successful unloading.
The documentation for this class was generated from the following file:
- tools/library.hpp