Allows users to dynamically load shared libraries. More...
#include <dynamic_loading.h>
Public Types | |
typedef void * | TDLHandle |
The handle to a loaded library. More... | |
Static Public Member Functions | |
static TDLHandle | LoadLibrary (const std::string &str_lib) |
Loads a dynamic library. More... | |
static void | UnloadLibrary (const std::string &str_lib) |
Unloads a dynamic library. More... | |
static void | LoadAllLibraries () |
Loads all the dynamic libraries in the current ARGOS_PLUGIN_PATH. More... | |
static void | UnloadAllLibraries () |
Unloads all the dynamic libraries. More... | |
Allows users to dynamically load shared libraries.
Definition at line 24 of file dynamic_loading.h.
typedef void* argos::CDynamicLoading::TDLHandle |
The handle to a loaded library.
Definition at line 31 of file dynamic_loading.h.
|
static |
Loads all the dynamic libraries in the current ARGOS_PLUGIN_PATH.
Internally used to execute queries (argos3 –query
).
CARGoSException | in case of error |
Definition at line 181 of file dynamic_loading.cpp.
|
static |
Loads a dynamic library.
This method tries to load the library pointed to by the specified path.
If the given path is absolute, this method tries to load the library pointed to by the specified path. If loading fails, it tries another time appending the extension for shared libraries (e.g., .so
on Linux, .dylib
on Mac) to the path. If also this attempt fails, this method tries appending the extension for module libraries (e.g., .so
on Linux and Mac). If all attempts fail, the method raises an exception.
If the given path is relative, this method forms absolute paths prepending the given path with the directories of the default loading path (e.g., /usr/lib/argos3), the contents of ARGOS_PLUGIN_PATH, and the current working directory. For each absolute path so formed, the method attempts to load the library in the same way as described above (e.g., appending the extension of shared/module libraries if needed).
str_lib | The path of the dynamic library to load |
CARGoSException | in case of error |
Definition at line 72 of file dynamic_loading.cpp.
|
static |
Unloads all the dynamic libraries.
CARGoSException | in case of error |
Definition at line 248 of file dynamic_loading.cpp.
|
static |
Unloads a dynamic library.
str_lib | The path of the dynamic library to unload |
CARGoSException | in case of error |
Definition at line 159 of file dynamic_loading.cpp.