State Machine  0.4.0
This repository contains packages for creating and running general purpose state machines.
state_machine::Parameter Class Reference

#include <Parameter.hpp>

Public Member Functions

template<typename ValueT = yaml_tools::YamlNode>
 Parameter (std::string name, std::string type, const ValueT &value=ValueT{})
 
 ~Parameter ()=default
 
const std::string & getName () const
 
const std::string & getType () const
 
template<typename ValueT >
void setValue (const ValueT &value)
 
const ValuegetValue () const
 
bool isSet () const
 
yaml_tools::YamlNode toYamlNode () const
 

Static Public Member Functions

static Parameter fromYamlNode (const yaml_tools::YamlNode &parameterNode)
 

Protected Types

using Value = yaml_tools::YamlNode
 Parameter value. Can contain an arbitrary YAML tree (including a simple value). More...
 

Protected Attributes

const std::string name_
 Name of the parameter. More...
 
const std::string type_
 Type of the parameter. E.g. needed to give a pre-selection of potential values. More...
 
Value value_
 Value of the parameter. More...
 

Detailed Description

A single settings parameter. Can store any type of value which is compatible with YAML.

Member Typedef Documentation

◆ Value

using state_machine::Parameter::Value = yaml_tools::YamlNode
protected

Parameter value. Can contain an arbitrary YAML tree (including a simple value).

Constructor & Destructor Documentation

◆ Parameter()

template<typename ValueT = yaml_tools::YamlNode>
state_machine::Parameter::Parameter ( std::string  name,
std::string  type,
const ValueT &  value = ValueT{} 
)
inline

Constructor.

Parameters
nameName of the parameter.
typeType of the parameter.
valueValue of the parameter. Default is an empty YAML node.

◆ ~Parameter()

state_machine::Parameter::~Parameter ( )
default

Destructor.

Member Function Documentation

◆ fromYamlNode()

Parameter state_machine::Parameter::fromYamlNode ( const yaml_tools::YamlNode &  parameterNode)
static

Create a parameter from a YAML node.

Parameters
parameterNodeYAML node.
Returns
New parameter.

◆ getName()

const std::string& state_machine::Parameter::getName ( ) const
inline
Returns
Name of the parameter.

◆ getType()

const std::string& state_machine::Parameter::getType ( ) const
inline
Returns
Type of the parameter.

◆ getValue()

const Value& state_machine::Parameter::getValue ( ) const
inline
Returns
Value of the parameter.

◆ isSet()

bool state_machine::Parameter::isSet ( ) const
inline
Returns
True if value is set.

◆ setValue()

template<typename ValueT >
void state_machine::Parameter::setValue ( const ValueT &  value)
inline
Parameters
valueValue of the parameter. Can be a bool, int, double, string or YAML node.

◆ toYamlNode()

yaml_tools::YamlNode state_machine::Parameter::toYamlNode ( ) const
Returns
Convert the parameter into YAML format.

Member Data Documentation

◆ name_

const std::string state_machine::Parameter::name_
protected

Name of the parameter.

◆ type_

const std::string state_machine::Parameter::type_
protected

Type of the parameter. E.g. needed to give a pre-selection of potential values.

◆ value_

Value state_machine::Parameter::value_
protected

Value of the parameter.


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