C++ YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
BarState Class Reference

Represents the "Bar" state in the state machine. More...

Inheritance diagram for BarState:
Collaboration diagram for BarState:

Public Member Functions

 BarState ()
 Constructs a BarState object.
 
std::string execute (std::shared_ptr< yasmin::blackboard::Blackboard > blackboard) override
 Executes the Bar state logic.
 
- Public Member Functions inherited from yasmin::State
 State (std::set< std::string > outcomes)
 Constructs a State with a set of possible outcomes.
 
std::string operator() (std::shared_ptr< blackboard::Blackboard > blackboard)
 Executes the state and returns the outcome.
 
virtual void cancel_state ()
 Cancels the current state execution.
 
bool is_canceled () const
 Checks if the state has been canceled.
 
bool is_running () const
 Checks if the state is currently running.
 
std::set< std::string > const & get_outcomes ()
 Gets the set of possible outcomes for this state.
 
virtual std::string to_string ()
 Converts the state to a string representation.
 

Additional Inherited Members

- Protected Attributes inherited from yasmin::State
std::set< std::string > outcomes
 The possible outcomes of this state.
 

Detailed Description

Represents the "Bar" state in the state machine.

This state logs the value from the blackboard and provides a single outcome to transition.

Constructor & Destructor Documentation

◆ BarState()

BarState::BarState ( )
inline

Constructs a BarState object.

Member Function Documentation

◆ execute()

std::string BarState::execute ( std::shared_ptr< yasmin::blackboard::Blackboard > blackboard)
inlineoverridevirtual

Executes the Bar state logic.

This method logs the execution, waits for 3 seconds, retrieves a string from the blackboard, and logs it.

Parameters
blackboardShared pointer to the blackboard for state communication.
Returns
std::string The outcome of the execution: "outcome3".

Reimplemented from yasmin::State.


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