DeviceConfig Class Reference

#include <armarx/control/hardware_config/DeviceConfig.h>

+ Inheritance diagram for DeviceConfig:

Public Member Functions

bool checkAllItemsRead (std::vector< std::string > &errors) const override
 This method is called once the device has read the configuration data it needs. More...
 
 DeviceConfig (std::string type, std::string name)
 
 DeviceConfig (std::string type, std::string name, std::shared_ptr< DeviceConfigBase > profile)
 
SlaveConfiggetOnlySlaveConfig ()
 
SlaveConfiggetSlaveConfig (const std::string type, const std::string name="")
 
SlaveConfiggetSlaveConfig (const std::uint32_t vendorID, const std::uint32_t productCode, const std::uint32_t serialNumber)
 
DeviceConfigBasegetSubdeviceConfig (const std::string &subDeviceName)
 
std::list< std::reference_wrapper< DeviceConfigBase > > getSubDeviceConfigsWithType (const std::string subDeviceType)
 
void onParsingFinished () override
 This method is called when the config is completely read form the HardwareConfig file. More...
 
void print (std::stringstream &s, int indention) const override
 Print this configuration. More...
 
 ~DeviceConfig ()=default
 
- Public Member Functions inherited from DeviceConfigBase
 DeviceConfigBase (std::string type, std::string name)
 
 DeviceConfigBase (std::string type, std::string name, std::shared_ptr< DeviceConfigBase > profile)
 
std::string getName () const
 
std::string getType () const
 
 ~DeviceConfigBase ()=default
 
- Public Member Functions inherited from Config
 Config ()
 
bool getBool (const std::string name)
 Get a Bool typed Config attribute by name. More...
 
std::list< bool > getBoolList (const std::string name)
 Get a BoolList (std::list<bool>) typed Config attribute by name. More...
 
float getFloat (const std::string name)
 Get a Float typed Config attribute by name. More...
 
std::list< floatgetFloatList (const std::string name)
 Get a FloatList (std::list<float>) typed Config attribute by name. More...
 
std::int32_t getInt (const std::string name)
 Get a Int (std::int32_t) typed Config attribute by name. More...
 
std::list< std::int32_t > getIntList (const std::string name)
 Get a IntList (std::list<std::int32_t>) typed Config attribute by name. More...
 
types::LinearConfig getLinearConfig (const std::string name)
 Get a LinearConvertedValue typed Config attribute by name. More...
 
template<typename Type , int Rows, int Columns>
Eigen::Matrix< Type, Rows, Columns > getMatrix (const std::string name)
 Get a Matrix by name. More...
 
types::ModularConvertedValueConfig getModularConvertedValueConfig (const std::string &name)
 Get a ModularConvertedValue typed Config attribute by name. More...
 
std::string getString (const std::string name)
 Get a String typed Config attribute by name. More...
 
std::uint32_t getUint (const std::string name)
 Get a Uint (std::uint32_t) typed Config attribute by name. More...
 
std::list< std::uint32_t > getUintList (const std::string name)
 Get a UIntList (std::list<std::uint32_t>) typed Config attribute by name. More...
 
virtual ~Config ()=default
 
- Public Member Functions inherited from ControllerConfig
 ControllerConfig ()
 
ConfiggetControllerConfig (const std::string controllerName)
 

Friends

class ConfigParser
 

Additional Inherited Members

- Protected Member Functions inherited from Config
template<typename T >
T get (const std::string name)
 
template<typename T >
std::optional< Tget_nothrow (const std::string name)
 
template<class T >
void set (const std::string name, T value, ConfigTag tag)
 
void setBool (const std::string name, bool value, ConfigTag tag)
 
void setBoolList (const std::string name, std::list< bool > value, ConfigTag tag)
 
void setFloat (const std::string name, float value, ConfigTag tag)
 
void setFloatList (const std::string name, std::list< float > value, ConfigTag tag)
 
void setInt (const std::string name, std::int32_t value, ConfigTag tag)
 
void setIntList (const std::string name, std::list< std::int32_t > value, ConfigTag tag)
 
void setLinearConfig (const std::string name, types::LinearConfig &&value, ConfigTag tag)
 
void setModularConvertedValueConfig (const std::string name, types::ModularConvertedValueConfig &&value, ConfigTag tag)
 
void setString (const std::string name, std::string value, ConfigTag tag)
 
void setUint (const std::string name, std::uint32_t value, ConfigTag tag)
 
void setUintList (const std::string name, std::list< std::uint32_t > value, ConfigTag tag)
 
- Protected Member Functions inherited from ControllerConfig
void addControllerConfig (const std::string controllerName, std::shared_ptr< Config > controllerConfig)
 Add a Config for a controller with name. More...
 
 ControllerConfig (const ControllerConfig &orig)
 
- Protected Attributes inherited from Config
std::map< std::string, ConfigItemWithMetadataitems
 
- Protected Attributes inherited from ControllerConfig
std::map< std::string, std::shared_ptr< Config > > controllerConfigs
 

Detailed Description

Definition at line 42 of file DeviceConfig.h.

Constructor & Destructor Documentation

◆ DeviceConfig() [1/2]

DeviceConfig ( std::string  type,
std::string  name 
)

Definition at line 5 of file DeviceConfig.cpp.

◆ DeviceConfig() [2/2]

DeviceConfig ( std::string  type,
std::string  name,
std::shared_ptr< DeviceConfigBase profile 
)

Definition at line 9 of file DeviceConfig.cpp.

◆ ~DeviceConfig()

~DeviceConfig ( )
default

Member Function Documentation

◆ checkAllItemsRead()

bool checkAllItemsRead ( std::vector< std::string > &  errors) const
overridevirtual

This method is called once the device has read the configuration data it needs.

In this method it should be checked, whether there are entries in this Config (including config objects that are stored in the Config).

Returns
true iff all items in this config have been read

Reimplemented from Config.

Definition at line 114 of file DeviceConfig.cpp.

+ Here is the call graph for this function:

◆ getOnlySlaveConfig()

SlaveConfig & getOnlySlaveConfig ( )

Definition at line 65 of file DeviceConfig.cpp.

◆ getSlaveConfig() [1/2]

SlaveConfig & getSlaveConfig ( const std::string  type,
const std::string  name = "" 
)

Definition at line 49 of file DeviceConfig.cpp.

◆ getSlaveConfig() [2/2]

SlaveConfig & getSlaveConfig ( const std::uint32_t  vendorID,
const std::uint32_t  productCode,
const std::uint32_t  serialNumber 
)

Definition at line 29 of file DeviceConfig.cpp.

+ Here is the call graph for this function:

◆ getSubdeviceConfig()

DeviceConfigBase & getSubdeviceConfig ( const std::string &  subDeviceName)

Definition at line 76 of file DeviceConfig.cpp.

◆ getSubDeviceConfigsWithType()

std::list< std::reference_wrapper< DeviceConfigBase > > getSubDeviceConfigsWithType ( const std::string  subDeviceType)

Definition at line 87 of file DeviceConfig.cpp.

+ Here is the call graph for this function:

◆ onParsingFinished()

void onParsingFinished ( )
overridevirtual

This method is called when the config is completely read form the HardwareConfig file.

It starts the tracking of which item is read from this Config object.

Reimplemented from Config.

Definition at line 184 of file DeviceConfig.cpp.

+ Here is the call graph for this function:

◆ print()

void print ( std::stringstream &  s,
int  indention 
) const
overridevirtual

Print this configuration.

Works recursively.

Parameters
sthe stream to append the output to
indentionthe indentation (=level of recursion)

Reimplemented from DeviceConfigBase.

Definition at line 134 of file DeviceConfig.cpp.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ ConfigParser

friend class ConfigParser
friend

Definition at line 44 of file DeviceConfig.h.


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