Class CbState
Defined in File cb_state.hpp
Inheritance Relationships
Base Type
public yasmin::State
(Class State)
Class Documentation
-
class CbState : public yasmin::State
Represents a state that executes a callback function.
The CbState class inherits from the State class and is designed to execute a user-defined callback function, utilizing a shared pointer to a Blackboard object to obtain necessary data.
Public Functions
Constructs a CbState object.
- Parameters:
outcomes – A set of possible outcomes for this state.
callback – A function pointer to the callback function that will be executed when this state is activated.
- Throws:
std::invalid_argument – If the outcomes set is empty.
Executes the callback function.
This function is called to execute the callback and retrieve the result. It may use the provided Blackboard for additional data.
- Parameters:
blackboard – A shared pointer to the Blackboard object used during execution.
- Throws:
std::runtime_error – If the callback execution fails.
- Returns:
The result of the callback function execution as a string.