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 {
8 
15 class SubtreeNode : public DecoratorNode
16 {
17  public:
18  SubtreeNode(const std::string& name);
19 
20  virtual ~SubtreeNode() override = default;
21 
22  private:
23  virtual BT::NodeStatus tick() override;
24 
26  {
27  return { InputPort<bool>("__shared_blackboard", false,
28  "If false (default) the subtree has its own blackboard and you"
29  "need to do port remapping to connect it to the parent") };
30  }
31 
32  virtual NodeType type() const override final
33  {
34  return NodeType::SUBTREE;
35  }
36 };
37 
38 
39 
81 {
82 public:
83  SubtreePlusNode(const std::string& name);
84 
85  virtual ~SubtreePlusNode() override = default;
86 
87 private:
88  virtual BT::NodeStatus tick() override;
89 
91  {
92  return { InputPort<bool>("__autoremap", false,
93  "If true, all the ports with the same name will be remapped") };
94  }
95 
96  virtual NodeType type() const override final
97  {
98  return NodeType::SUBTREE;
99  }
100 };
101 
102 
103 
104 }
105 
106 #endif // DECORATOR_SUBTREE_NODE_H
const std::string & name() const
Name of the instance, not the type.
Definition: tree_node.cpp:73
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
static PortsList providedPorts()
Definition: subtree_node.h:25
static PortsList providedPorts()
Definition: subtree_node.h:90
virtual NodeType type() const overridefinal
Definition: subtree_node.h:32
The SubtreeNode is a way to wrap an entire Subtree, creating a separated BlackBoard. If you want to have data flow through ports, you need to explicitly remap the ports.
Definition: subtree_node.h:15
SubtreeNode(const std::string &name)
Definition: subtree_node.cpp:4
std::unordered_map< std::string, PortInfo > PortsList
Definition: basic_types.h:317
virtual NodeType type() const overridefinal
Definition: subtree_node.h:96
NodeStatus
Definition: basic_types.h:35
NodeType
Enumerates the possible types of nodes.
Definition: basic_types.h:22
The SubtreePlus is a new kind of subtree that gives you much more control over remapping: ...
Definition: subtree_node.h:80
virtual ~SubtreeNode() override=default


behaviotree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Tue May 4 2021 02:56:25