2
3
4
5
6
7
8
9
10
11
15#include "behaviortree_cpp/actions/pop_from_queue.hpp"
16#include "behaviortree_cpp/decorator_node.h"
23
24
25
26
27
28
31class [[deprecated(
"You are encouraged to use the LoopNode instead")]]
ConsumeQueue
35 ConsumeQueue(
const std::string& name,
const NodeConfig& config)
47 running_child_ = (child_state ==
NodeStatus::RUNNING);
55 status_to_be_returned = child_state;
60 if(getInput(
"queue", queue) && queue)
62 std::unique_lock<std::mutex> lk(queue->mtx);
63 auto& items = queue->items;
69 T val = items.front();
71 setOutput(
"popped_item", val);
77 running_child_ = (child_state ==
NodeStatus::RUNNING);
89 status_to_be_returned = child_state;
94 return status_to_be_returned;
97 static PortsList providedPorts()
99 return { InputPort<std::shared_ptr<
ProtectedQueue<T>>>(
"queue"), OutputPort<T>(
"poppe"
106 bool running_child_ =
false;
Definition: consume_queue.h:33
NodeStatus tick() override
Method to be implemented by the user.
Definition: consume_queue.h:39
The DecoratorNode is the base class for nodes that have exactly one child.
Definition: decorator_node.h:19
void haltChild()
Same as resetChild()
virtual BT::NodeStatus executeTick()
The method that should be used to invoke tick() and setStatus();.
void setStatus(NodeStatus new_status)
setStatus changes the status of the node. it will throw if you try to change the status to IDLE,...
Definition: action_node.h:24
NodeStatus
Definition: basic_types.h:34
Definition: tree_node.h:105
Definition: pop_from_queue.hpp:37