dynamic_loading.h
Go to the documentation of this file.
1 
7 #ifndef DYNAMIC_LOADING_H
8 #define DYNAMIC_LOADING_H
9 
10 #include <argos3/core/utility/configuration/argos_exception.h>
11 #include <argos3/core/utility/logging/argos_log.h>
12 
13 #include <map>
14 #include <string>
15 
16 #include <dlfcn.h>
17 #include <cstdlib>
18 
19 namespace argos {
20 
25 
26  public:
27 
31  typedef void* TDLHandle;
32 
33  public:
34 
59  static TDLHandle LoadLibrary(const std::string& str_lib);
60 
66  static void UnloadLibrary(const std::string& str_lib);
67 
73  static void LoadAllLibraries();
74 
79  static void UnloadAllLibraries();
80 
81  private:
82 
86  typedef std::map<std::string, TDLHandle> TDLHandleMap;
87 
91  static TDLHandleMap m_tOpenLibs;
92 
96  static const std::string DEFAULT_PLUGIN_PATH;
97  };
98 
99 }
100 
101 #endif
Allows users to dynamically load shared libraries.
static void LoadAllLibraries()
Loads all the dynamic libraries in the current ARGOS_PLUGIN_PATH.
void * TDLHandle
The handle to a loaded library.
static void UnloadLibrary(const std::string &str_lib)
Unloads a dynamic library.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
static TDLHandle LoadLibrary(const std::string &str_lib)
Loads a dynamic library.
static void UnloadAllLibraries()
Unloads all the dynamic libraries.