C++ YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
yasmin::BlackboardKeyInfo Struct Reference

Information about a blackboard key including name and optional default value. More...

#include <blackboard_key_info.hpp>

Collaboration diagram for yasmin::BlackboardKeyInfo:

Public Member Functions

 BlackboardKeyInfo ()=default
 Default constructor.
 BlackboardKeyInfo (std::string key_name)
 Constructor with key name only.
 BlackboardKeyInfo (std::string key_name, std::string key_description)
 Constructor with key name and description.
template<typename T>
 BlackboardKeyInfo (std::string key_name, std::string key_description, T value)
 Constructor with key name, default value and description.
 BlackboardKeyInfo (std::string key_name, std::string key_description, const char *value)
 Constructor with key name, default value and description for const char *.
template<typename T>
T get_default_value () const
 Retrieve the default value as the given type.

Public Attributes

std::string name
 The name of the key.
std::string description
 Human-readable description of the key.
bool has_default {false}
 Whether this key has a default value.
std::shared_ptr< void > default_value {}
std::string default_value_type {}
 The type name of the default value.
std::function< void(Blackboard &, const std::string &)> inject_default {}
 Function to inject the default value into a blackboard at the given key.

Detailed Description

Information about a blackboard key including name and optional default value.

Constructor & Destructor Documentation

◆ BlackboardKeyInfo() [1/5]

yasmin::BlackboardKeyInfo::BlackboardKeyInfo ( )
default

Default constructor.

◆ BlackboardKeyInfo() [2/5]

yasmin::BlackboardKeyInfo::BlackboardKeyInfo ( std::string key_name)
inlineexplicit

Constructor with key name only.

Parameters
key_nameThe name of the blackboard key.

◆ BlackboardKeyInfo() [3/5]

yasmin::BlackboardKeyInfo::BlackboardKeyInfo ( std::string key_name,
std::string key_description )
inline

Constructor with key name and description.

Parameters
key_nameThe name of the blackboard key.
key_descriptionHuman-readable description of the blackboard key.

◆ BlackboardKeyInfo() [4/5]

template<typename T>
yasmin::BlackboardKeyInfo::BlackboardKeyInfo ( std::string key_name,
std::string key_description,
T value )
inline

Constructor with key name, default value and description.

Template Parameters
TThe type of the default value.
Parameters
key_nameThe name of the blackboard key.
key_descriptionHuman-readable description of the blackboard key.
valueThe default value.

◆ BlackboardKeyInfo() [5/5]

yasmin::BlackboardKeyInfo::BlackboardKeyInfo ( std::string key_name,
std::string key_description,
const char * value )
inline

Constructor with key name, default value and description for const char *.

Parameters
key_nameThe name of the blackboard key.
key_descriptionHuman-readable description of the blackboard key.
valueThe default value.

Member Function Documentation

◆ get_default_value()

template<typename T>
T yasmin::BlackboardKeyInfo::get_default_value ( ) const
inline

Retrieve the default value as the given type.

Template Parameters
TThe type to cast the default value to.
Returns
The default value.

Member Data Documentation

◆ default_value

std::shared_ptr<void> yasmin::BlackboardKeyInfo::default_value {}

The default value stored as a shared pointer to void (similar to Blackboard)

◆ default_value_type

std::string yasmin::BlackboardKeyInfo::default_value_type {}

The type name of the default value.

◆ description

std::string yasmin::BlackboardKeyInfo::description

Human-readable description of the key.

◆ has_default

bool yasmin::BlackboardKeyInfo::has_default {false}

Whether this key has a default value.

◆ inject_default

std::function<void(Blackboard &, const std::string &)> yasmin::BlackboardKeyInfo::inject_default {}

Function to inject the default value into a blackboard at the given key.

◆ name

std::string yasmin::BlackboardKeyInfo::name

The name of the key.


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