C++ YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
yasmin::blackboard::BlackboardValue< T > Class Template Reference

A template class that wraps a value of type T. More...

#include <blackboard_value.hpp>

Inheritance diagram for yasmin::blackboard::BlackboardValue< T >:
Collaboration diagram for yasmin::blackboard::BlackboardValue< T >:

Public Member Functions

 BlackboardValue (T value)
 Constructs a BlackboardValue with the specified value.
 
get ()
 Retrieve the stored value.
 
void set (T value)
 Set a new value.
 
std::string get_type ()
 Get the type of the stored value as a string.
 
std::string to_string ()
 Convert the stored value's type information to a string.
 
- Public Member Functions inherited from yasmin::blackboard::BlackboardValueInterface
virtual ~BlackboardValueInterface ()
 Virtual destructor for the interface.
 

Private Attributes

value
 The stored value of type T.
 

Detailed Description

template<class T>
class yasmin::blackboard::BlackboardValue< T >

A template class that wraps a value of type T.

The BlackboardValue class is a template that stores a value of any type T. It provides methods to get and set the value, as well as to retrieve the type information of the value in a human-readable format.

Template Parameters
TThe type of the value to be stored.

Constructor & Destructor Documentation

◆ BlackboardValue()

template<class T >
yasmin::blackboard::BlackboardValue< T >::BlackboardValue ( T value)
inline

Constructs a BlackboardValue with the specified value.

Parameters
valueThe initial value to store.

Member Function Documentation

◆ get()

template<class T >
T yasmin::blackboard::BlackboardValue< T >::get ( )
inline

Retrieve the stored value.

Returns
The stored value of type T.

◆ get_type()

template<class T >
std::string yasmin::blackboard::BlackboardValue< T >::get_type ( )
inline

Get the type of the stored value as a string.

Returns
A string representation of the type of the stored value.

This method uses RTTI to get the mangled name of the type and demangles it for readability (if using GCC).

◆ set()

template<class T >
void yasmin::blackboard::BlackboardValue< T >::set ( T value)
inline

Set a new value.

Parameters
valueThe new value to store.

◆ to_string()

template<class T >
std::string yasmin::blackboard::BlackboardValue< T >::to_string ( )
inlinevirtual

Convert the stored value's type information to a string.

Returns
A string representation of the type of the stored value.

This method overrides the to_string method from the BlackboardValueInterface to provide the type of the value.

Reimplemented from yasmin::blackboard::BlackboardValueInterface.

Member Data Documentation

◆ value

template<class T >
T yasmin::blackboard::BlackboardValue< T >::value
private

The stored value of type T.


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