The SimpleDecoratorNode provides an easy to use DecoratorNode. The user should simply provide a callback with this signature. More...
#include <decorator_node.h>
Public Types | |
typedef std::function < NodeStatus(NodeStatus, TreeNode &)> | TickFunctor |
Public Member Functions | |
SimpleDecoratorNode (const std::string &name, TickFunctor tick_functor, const NodeParameters ¶ms=NodeParameters()) | |
~SimpleDecoratorNode () override | |
Protected Member Functions | |
virtual NodeStatus | tick () override |
Method to be implemented by the user. | |
Protected Attributes | |
TickFunctor | tick_functor_ |
The SimpleDecoratorNode provides an easy to use DecoratorNode. The user should simply provide a callback with this signature.
BT::NodeStatus functionName(BT::NodeStatus child_status)
This avoids the hassle of inheriting from a DecoratorNode.
Using lambdas or std::bind it is easy to pass a pointer to a method. SimpleDecoratorNode does not support halting, NodeParameters, nor Blackboards.
Definition at line 49 of file decorator_node.h.
typedef std::function<NodeStatus(NodeStatus, TreeNode&)> BT::SimpleDecoratorNode::TickFunctor |
Definition at line 52 of file decorator_node.h.
BT::SimpleDecoratorNode::SimpleDecoratorNode | ( | const std::string & | name, |
TickFunctor | tick_functor, | ||
const NodeParameters & | params = NodeParameters() |
||
) |
Definition at line 60 of file decorator_node.cpp.
BT::SimpleDecoratorNode::~SimpleDecoratorNode | ( | ) | [override] |
NodeStatus BT::SimpleDecoratorNode::tick | ( | ) | [override, protected, virtual] |
Method to be implemented by the user.
Implements BT::TreeNode.
Definition at line 66 of file decorator_node.cpp.
TickFunctor BT::SimpleDecoratorNode::tick_functor_ [protected] |
Definition at line 63 of file decorator_node.h.