16#ifndef YASMIN__STATE_HPP
17#define YASMIN__STATE_HPP
111 std::string
operator()(std::shared_ptr<yasmin::Blackboard> blackboard);
122 virtual std::string
execute(std::shared_ptr<yasmin::Blackboard> blackboard) {
151 std::string name =
typeid(*this).name();
157 abi::__cxa_demangle(name.c_str(),
nullptr,
nullptr, &
status);
StateStatus get_status() const
Gets the current status of the state.
Definition state.cpp:33
bool is_canceled() const
Checks if the state has been canceled.
Definition state.cpp:41
bool is_completed() const
Checks if the state has completed execution.
Definition state.cpp:45
std::atomic< StateStatus > status
Current status of the state.
Definition state.hpp:61
State(const std::set< std::string > &outcomes)
Constructs a State with a set of possible outcomes.
Definition state.cpp:27
virtual std::string execute(std::shared_ptr< yasmin::Blackboard > blackboard)
Executes the state's specific logic.
Definition state.hpp:122
std::set< std::string > const & get_outcomes()
Gets the set of possible outcomes for this state.
Definition state.cpp:96
std::set< std::string > outcomes
The possible outcomes of this state.
Definition state.hpp:57
bool is_running() const
Checks if the state is currently running.
Definition state.cpp:37
std::string operator()(std::shared_ptr< yasmin::Blackboard > blackboard)
Executes the state and returns the outcome.
Definition state.cpp:49
virtual std::string to_string()
Converts the state to a string representation.
Definition state.hpp:150
virtual void cancel_state()
Cancels the current state execution.
Definition state.hpp:132
bool is_idle() const
Checks if the state is idle.
Definition state.cpp:35
#define YASMIN_LOG_INFO(text,...)
Definition logs.hpp:169
Definition blackboard.hpp:29
StateStatus
Enumeration representing the current status of a state.
Definition state.hpp:38
@ RUNNING
State is currently executing.
Definition state.hpp:40
@ COMPLETED
State execution has completed successfully.
Definition state.hpp:42
@ IDLE
State is idle and ready to execute.
Definition state.hpp:39
@ CANCELED
State execution has been canceled.
Definition state.hpp:41