CppCMS
|
Class that allows loading dynamic libraries: shared objects and dlls. More...
#include <booster/booster/shared_object.h>
Public Member Functions | |
shared_object () | |
~shared_object () | |
shared_object (std::string const &file_name) | |
bool | is_open () const |
bool | open (std::string const &file_name) |
bool | open (std::string const &file_name, std::string &error_message) |
void | close () |
void * | resolve_symbol (std::string const &name) const |
template<typename T > | |
void | symbol (T &s, std::string const &name) const |
Static Public Member Functions | |
static std::string | name (std::string const &module) |
static std::string | name (std::string const &module, std::string const &soversion) |
Class that allows loading dynamic libraries: shared objects and dlls.
Create an empty shared object
If the shared object was open unloads it, If private copy of DLL was made it is removed from the file system
booster::shared_object::shared_object | ( | std::string const & | file_name | ) |
Create shared object and load it,
file_name | - the name of the file, UTF-8 encoded under Windows |
booster::system::system_error | if it is impossible to load it |
void booster::shared_object::close | ( | ) |
Unload the shared object
bool booster::shared_object::is_open | ( | ) | const |
Check if the shared object was loaded
static std::string booster::shared_object::name | ( | std::string const & | module | ) | [static] |
Format the OS specific name name of the library according to its name. Uses CMake convensions.
For example library "foo" is converted to the name
static std::string booster::shared_object::name | ( | std::string const & | module, |
std::string const & | soversion | ||
) | [static] |
Format the OS specific name name of the library according to its name and its soversion. Uses CMake convensions.
For example library "foo" and soversion "1" is converted to the name
bool booster::shared_object::open | ( | std::string const & | file_name | ) |
Load shared object or dll
file_name | - the name of the file, UTF-8 encoded under Windows |
bool booster::shared_object::open | ( | std::string const & | file_name, |
std::string & | error_message | ||
) |
Load shared object or dll
file_name | - the name of the file, UTF-8 encoded under Windows |
error_message | - the error message |
void* booster::shared_object::resolve_symbol | ( | std::string const & | name | ) | const |
Resolve symbol in the shared object dll. If it can't be resolved, NULL is returned
If the shared object was not opened, it would throw booster::runtime_error
void booster::shared_object::symbol | ( | T & | s, |
std::string const & | name | ||
) | const [inline] |
Resolve symbol in the shared object dll. If it can't be