rcpputils
master
C++ API providing common utilities and data structures.
|
#include <shared_library.hpp>
Public Member Functions | |
SharedLibrary (const std::string &library_path) | |
The library is loaded in the constructor. More... | |
virtual | ~SharedLibrary () |
The library is unloaded in the deconstructor. More... | |
void | unload_library () |
Unload library. More... | |
bool | has_symbol (const std::string &symbol_name) |
Return true if the shared library contains a specific symbol name otherwise returns false. More... | |
void * | get_symbol (const std::string &symbol_name) |
Return shared library symbol pointer. More... | |
std::string | get_library_path () |
Return shared library path. More... | |
This class is an abstraction of rcutils shared library to be able to used it with modern C++.
|
explicit |
The library is loaded in the constructor.
[in] | library_path | The library string path. |
std::bad_alloc | if allocating storage for the callback fails |
std::runtime_error | if there are some invalid arguments or the library was not load properly |
|
virtual |
The library is unloaded in the deconstructor.
void rcpputils::SharedLibrary::unload_library | ( | ) |
Unload library.
std::runtime_error | if the library is not unloaded properly |
bool rcpputils::SharedLibrary::has_symbol | ( | const std::string & | symbol_name | ) |
Return true if the shared library contains a specific symbol name otherwise returns false.
[in] | symbol_name | name of the symbol inside the shared library |
void* rcpputils::SharedLibrary::get_symbol | ( | const std::string & | symbol_name | ) |
Return shared library symbol pointer.
[in] | symbol_name | name of the symbol inside the shared library |
std::runtime_error | if the symbol doesn't exist in the shared library |
std::string rcpputils::SharedLibrary::get_library_path | ( | ) |
Return shared library path.
std::runtime_error | if the path is NULL |