ros2_canopen  master
C++ ROS CANopen Library
Public Member Functions | List of all members
ros2_canopen::ConfigurationManager Class Reference

Manager for Bus Configuration. More...

#include <configuration_manager.hpp>

Public Member Functions

 ConfigurationManager (std::string &file)
 
template<typename T >
std::optional< T > get_entry (std::string device_name, std::string entry_name)
 Gets a configuration entry for a specific device. More...
 
std::string dump_device (std::string device_name)
 Dump device string. More...
 
void init_config ()
 Initialises the configuration. More...
 
uint32_t get_all_devices (std::vector< std::string > &devices)
 Returns all device names. More...
 

Detailed Description

Manager for Bus Configuration.

The Bus configuration Manager stores the YAML bus configuration and enables reading configuration entries. The configuration manager is passed to all ros2_canopen master and slave drivers to enable reading driver specific configuration parameters from the YAML configuration file.

Constructor & Destructor Documentation

◆ ConfigurationManager()

ros2_canopen::ConfigurationManager::ConfigurationManager ( std::string &  file)
inline

Member Function Documentation

◆ get_entry()

template<typename T >
std::optional<T> ros2_canopen::ConfigurationManager::get_entry ( std::string  device_name,
std::string  entry_name 
)
inline

Gets a configuration entry for a specific device.

Template Parameters
TDatatype of the retrieved object
Parameters
device_nameDevice name
entry_nameEntry name
Returns
std::optional<T> Return value, can be empty.

◆ dump_device()

std::string ros2_canopen::ConfigurationManager::dump_device ( std::string  device_name)
inline

Dump device string.

Parameters
device_name
Returns
std::string

◆ init_config()

void ros2_canopen::ConfigurationManager::init_config ( )

Initialises the configuration.

◆ get_all_devices()

uint32_t ros2_canopen::ConfigurationManager::get_all_devices ( std::vector< std::string > &  devices)

Returns all device names.

Parameters
devicesList with names of all devices
Returns
uint32_t Number of devices discovered

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