16#ifndef YASMIN__STATE_HPP
17#define YASMIN__STATE_HPP
72 std::string
operator()(std::shared_ptr<blackboard::Blackboard> blackboard);
84 execute(std::shared_ptr<blackboard::Blackboard> blackboard) {
125 std::string name =
typeid(*this).name();
131 abi::__cxa_demangle(name.c_str(),
nullptr,
nullptr, &status);
Represents a state in a state machine.
Definition state.hpp:42
bool is_canceled() const
Checks if the state has been canceled.
Definition state.cpp:71
std::atomic_bool running
Indicates if the state is currently running.
Definition state.hpp:52
std::atomic_bool canceled
Indicates if the state has been canceled.
Definition state.hpp:50
virtual std::string execute(std::shared_ptr< blackboard::Blackboard > blackboard)
Executes the state's specific logic.
Definition state.hpp:84
std::set< std::string > const & get_outcomes()
Gets the set of possible outcomes for this state.
Definition state.cpp:75
std::set< std::string > outcomes
The possible outcomes of this state.
Definition state.hpp:46
State(std::set< std::string > outcomes)
Constructs a State with a set of possible outcomes.
Definition state.cpp:27
bool is_running() const
Checks if the state is currently running.
Definition state.cpp:73
virtual std::string to_string()
Converts the state to a string representation.
Definition state.hpp:124
virtual void cancel_state()
Cancels the current state execution.
Definition state.hpp:94
std::string operator()(std::shared_ptr< blackboard::Blackboard > blackboard)
Executes the state and returns the outcome.
Definition state.cpp:30
#define YASMIN_LOG_INFO(text,...)
Definition logs.hpp:71
Definition blackboard.hpp:29