subtree_node.h
Go to the documentation of this file.
1 #ifndef DECORATOR_SUBTREE_NODE_H
2 #define DECORATOR_SUBTREE_NODE_H
3 
5 
6 namespace BT
7 {
52 class SubTreeNode : public DecoratorNode
53 {
54 public:
55  SubTreeNode(const std::string& name, const NodeConfig& config);
56 
57  virtual ~SubTreeNode() override = default;
58 
59  static PortsList providedPorts();
60 
61  void setSubtreeID(const std::string& ID)
62  {
63  subtree_id_ = ID;
64  }
65 
66  const std::string& subtreeID() const
67  {
68  return subtree_id_;
69  }
70  virtual BT::NodeStatus tick() override;
71 
72  virtual NodeType type() const override final
73  {
74  return NodeType::SUBTREE;
75  }
76 
77 private:
78  std::string subtree_id_;
79 };
80 
81 } // namespace BT
82 
83 #endif // DECORATOR_SUBTREE_NODE_H
BT
Definition: ex01_wrap_legacy.cpp:29
BT::NodeType
NodeType
Enumerates the possible types of nodes.
Definition: basic_types.h:20
BT::TreeNode::config
const NodeConfig & config() const
Definition: tree_node.cpp:345
BT::SubTreeNode::tick
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
Definition: subtree_node.cpp:20
BT::NodeType::SUBTREE
@ SUBTREE
BT::DecoratorNode
Definition: decorator_node.h:8
BT::SubTreeNode::~SubTreeNode
virtual ~SubTreeNode() override=default
BT::SubTreeNode::setSubtreeID
void setSubtreeID(const std::string &ID)
Definition: subtree_node.h:61
BT::SubTreeNode::type
virtual NodeType type() const override final
Definition: subtree_node.h:72
BT::PortsList
std::unordered_map< std::string, PortInfo > PortsList
Definition: basic_types.h:585
BT::SubTreeNode::subtreeID
const std::string & subtreeID() const
Definition: subtree_node.h:66
BT::SubTreeNode::SubTreeNode
SubTreeNode(const std::string &name, const NodeConfig &config)
Definition: subtree_node.cpp:3
BT::SubTreeNode::subtree_id_
std::string subtree_id_
Definition: subtree_node.h:78
BT::TreeNode::name
const std::string & name() const
Name of the instance, not the type.
Definition: tree_node.cpp:296
BT::SubTreeNode::providedPorts
static PortsList providedPorts()
Definition: subtree_node.cpp:9
BT::NodeConfig
Definition: tree_node.h:73
decorator_node.h
BT::SubTreeNode
The SubTreeNode is a way to wrap an entire Subtree, creating a separated BlackBoard....
Definition: subtree_node.h:52
BT::NodeStatus
NodeStatus
Definition: basic_types.h:33


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Jun 28 2024 02:20:08