ARGoS  3
A parallel, multi-engine simulator for swarm robotics
core/utility/plugins/dynamic_loading.h
Go to the documentation of this file.
00001 
00007 #ifndef DYNAMIC_LOADING_H
00008 #define DYNAMIC_LOADING_H
00009 
00010 #include <argos3/core/utility/configuration/argos_exception.h>
00011 #include <argos3/core/utility/logging/argos_log.h>
00012 
00013 #include <map>
00014 #include <string>
00015 
00016 #include <dlfcn.h>
00017 #include <cstdlib>
00018 
00019 namespace argos {
00020 
00024    class CDynamicLoading {
00025 
00026    public:
00027 
00031       typedef void* TDLHandle;
00032 
00033    public:
00034 
00040       static TDLHandle LoadLibrary(const std::string& str_lib);
00041 
00046       static void UnloadLibrary(const std::string& str_lib);
00047 
00052       static void UnloadLibrary(TDLHandle t_lib);
00053 
00058       static void LoadAllLibraries();
00059 
00063       static void UnloadAllLibraries();
00064 
00065    private:
00066 
00070       typedef std::map<std::string, TDLHandle> TDLHandleMap;
00071 
00075       static TDLHandleMap m_tOpenLibs;
00076 
00080       static const std::string DEFAULT_PLUGIN_PATH;
00081    };
00082 
00083 }
00084 
00085 #endif