mc_observers::ObserverLoader Class Reference

Load Observer instances from shared libraries. More...

#include <mc_observers/ObserverLoader.h>

Static Public Member Functions

template<typename... Args>
static std::shared_ptr< mc_observers::Observerget_observer (const std::string &name, const Args &... args)
 
static std::string get_observer_runtime_directory (const std::string &name) noexcept
 
template<typename RetT , typename... Args>
static void register_object (const std::string &name, std::function< RetT *(const Args &...)> callback)
 
static void update_module_path (const std::vector< std::string > &paths)
 
static void clear ()
 
static bool has_observer (const std::string &name)
 
static void set_verbosity (bool verbose)
 
static std::vector< std::string > available_observers ()
 

Detailed Description

Load Observer instances from shared libraries.

Member Function Documentation

◆ available_observers()

static std::vector<std::string> mc_observers::ObserverLoader::available_observers ( )
inlinestatic

Returns a list of available robots

◆ clear()

static void mc_observers::ObserverLoader::clear ( )
inlinestatic

Remove all loaded libraries

◆ get_observer()

template<typename... Args>
static std::shared_ptr<mc_observers::Observer> mc_observers::ObserverLoader::get_observer ( const std::string &  name,
const Args &...  args 
)
inlinestatic

Return an Observer constructed with the provided Args

Parameters
nameThe module name
argsThe arguments provided to the module creation function
Note
It is the responsability of the caller to make sure that the signature of the module creation fits that declared by the module

◆ get_observer_runtime_directory()

static std::string mc_observers::ObserverLoader::get_observer_runtime_directory ( const std::string &  name)
inlinestaticnoexcept

Returns an Observer runtime directory

Empty when the module does not exist or when it's registered statically

Parameters
nameModule name

◆ has_observer()

static bool mc_observers::ObserverLoader::has_observer ( const std::string &  name)
inlinestatic

Check if a robot is available

Parameters
nameRobot name

◆ register_object()

template<typename RetT , typename... Args>
static void mc_observers::ObserverLoader::register_object ( const std::string &  name,
std::function< RetT *(const Args &...)>  callback 
)
inlinestatic

◆ set_verbosity()

static void mc_observers::ObserverLoader::set_verbosity ( bool  verbose)
inlinestatic

◆ update_module_path()

static void mc_observers::ObserverLoader::update_module_path ( const std::vector< std::string > &  paths)
inlinestatic

Add additional directories to the robot module path

Parameters
pathsDirectories to be added to the module path

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