Dynamic library loading and management class. More...
#include <dlib.hpp>
Public Member Functions | |
| dlib (const char *path) | |
| dlib (const std::string &path) | |
| dlib (const me &rhs) | |
| me & | operator= (const me &rhs) |
| const std::string & | getPath () const |
| void | setPath (const std::string &path) |
| void | setPath (const std::string *it) BY_SIDE_FUNC(setPath) |
| tmay< std::string > | load () |
| Loads dynamic library into memory. | |
| nbool | isLoaded () const |
| template<typename F > | |
| tmayFunc< F > | accessFunc (const std::string &name) |
| Accesses function by name and returns typed function pointer. | |
| template<typename F > | |
| tmayFunc< F > | accessFunc (const std::string *it) BY_SIDE_FUNC(accessFunc< F >) |
| template<typename F > | |
| tmayFunc< F > | accessFunc (const nchar *name) |
| void | rel () |
Dynamic library loading and management class.
Abbreviation for "dynamic loading for library". Handles platform-independent dynamic loading. Can load libraries into memory and find functions to convert them into function pointers.
Usage follows these steps:
Example showing the complete process of loading a dynamic library and calling a function. Note that rel() explicitly releases resources. When an error occurs, the comma operator (rel(), false) is used to clean up the dlib object before returning:
Accesses function by name and returns typed function pointer.
| tmay< std::string > by::dlib::load | ( | ) |
Loads dynamic library into memory.