mc_rtc::Loader Class Reference

General wrapper for ltdl functionnalities. More...

#include <mc_rtc/loader.h>

Public Types

typedef std::map< std::string, LTDLHandlePtrhandle_map_t
 
typedef std::function< void(const std::string &, LTDLHandle &)> callback_t
 

Static Public Attributes

static callback_t default_cb
 
static std::string debug_suffix
 

Static Protected Member Functions

static bool init ()
 Initialize ltdl. More...
 
static bool close ()
 Close ltdl. Does nothing until the last call. More...
 
static void load_libraries (const std::string &class_name, const std::vector< std::string > &paths, handle_map_t &out, bool verbose, callback_t cb)
 Provide libraries handles for the libraries in paths. More...
 

Friends

template<typename T >
struct ObjectLoader
 

Detailed Description

General wrapper for ltdl functionnalities.

Member Typedef Documentation

◆ callback_t

typedef std::function<void(const std::string &, LTDLHandle &)> mc_rtc::Loader::callback_t

◆ handle_map_t

typedef std::map<std::string, LTDLHandlePtr> mc_rtc::Loader::handle_map_t

Member Function Documentation

◆ close()

static bool mc_rtc::Loader::close ( )
staticprotected

Close ltdl. Does nothing until the last call.

Exceptions
LoaderExceptionon failure

◆ init()

static bool mc_rtc::Loader::init ( )
staticprotected

Initialize ltdl.

Exceptions
LoaderExceptionif ltdl fails to init

◆ load_libraries()

static void mc_rtc::Loader::load_libraries ( const std::string &  class_name,
const std::vector< std::string > &  paths,
handle_map_t out,
bool  verbose,
callback_t  cb 
)
staticprotected

Provide libraries handles for the libraries in paths.

Parameters
class_nameThe loader will filter out libraries that do not provide a class_name function that returns the object's name, this allows to filter the loaded libraries
pathsa list of the directories searched by the function
outa map (string, handle_type) updated by the function
verboseIf true, output some warning information
cbUser-provided callback when a new class is discovered

Friends And Related Function Documentation

◆ ObjectLoader

template<typename T >
friend struct ObjectLoader
friend

Member Data Documentation

◆ debug_suffix

std::string mc_rtc::Loader::debug_suffix
static

Suffix appended to libraries paths when running in debug mode

◆ default_cb

callback_t mc_rtc::Loader::default_cb
static

The documentation for this class was generated from the following file: