Go to the documentation of this file.
14 #ifndef BEHAVIORTREECORE_ACTIONNODE_H
15 #define BEHAVIORTREECORE_ACTIONNODE_H
62 virtual void halt() override final
125 return halt_requested_.load();
131 virtual
void halt() override;
134 std::exception_ptr exptr_;
135 std::atomic_bool halt_requested_ = false;
136 std::future<
void> thread_handle_;
140 #ifdef USE_BTCPP3_OLD_NAMES
175 virtual void onHalted() = 0;
177 bool isHaltRequested()
const;
183 void halt() override final;
186 std::atomic_bool halt_requested_ = false;
203 void setStatusRunningAndYield();
222 void halt()
override;
226 std::unique_ptr<Pimpl>
_p;
228 void destroyCoroutine();
NodeType
Enumerates the possible types of nodes.
const NodeConfig & config() const
virtual NodeType type() const override final
StatefulActionNode(const std::string &name, const NodeConfig &config)
~SyncActionNode() override=default
Abstract base class for Behavior Tree Nodes.
~SimpleActionNode() override=default
ActionNodeBase(const std::string &name, const NodeConfig &config)
virtual NodeStatus executeTick() override
throws if the derived class return RUNNING.
static pthread_mutex_t mutex
~ActionNodeBase() override=default
SyncActionNode(const std::string &name, const NodeConfig &config)
TickFunctor tick_functor_
virtual NodeStatus tick() override final
Method to be implemented by the user.
SimpleActionNode(const std::string &name, TickFunctor tick_functor, const NodeConfig &config)
ThreadedAction(const std::string &name, const NodeConfig &config)
const std::string & name() const
Name of the instance, not the type.
The ActionNodeBase is the base class to use to create any kind of action. A particular derived class ...
std::unique_ptr< Pimpl > _p
void resetStatus()
Set the status to IDLE.
The SimpleActionNode provides an easy to use SyncActionNode. The user should simply provide a callbac...
The ThreadedAction executes the tick in a different thread.
virtual void halt() override final
You don't need to override this.
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
std::function< NodeStatus(TreeNode &)> TickFunctor
bool isHaltRequested() const
The CoroActionNode class is an a good candidate for asynchronous actions which need to communicate wi...
The StatefulActionNode is the preferred way to implement asynchronous Actions. It is actually easier ...