2
3
4
5
6
7
8
9
10
11
15#include "behaviortree_cpp/action_node.h"
16#include "behaviortree_cpp/decorator_node.h"
22
23
24
25
26
27
28
29
30
31
43
44
45
46
47
48
49
50
51
52
53
59 PopFromQueue(
const std::string& name,
const NodeConfig& config)
66 if(getInput(
"queue", queue) && queue)
68 std::unique_lock<std::mutex> lk(queue->mtx);
69 auto& items = queue->items;
75 T val = items.front();
77 setOutput(
"popped_item", val);
83 static PortsList providedPorts()
85 return { InputPort<std::shared_ptr<
ProtectedQueue<T>>>(
"queue"), OutputPort<T>(
"poppe"
93
94
95
96
97
98
99
100
101
102
107 QueueSize(
const std::string& name,
const NodeConfig& config)
114 if(getInput(
"queue", queue) && queue)
116 std::unique_lock<std::mutex> lk(queue->mtx);
117 auto& items = queue->items;
123 setOutput(
"size",
int(items.size()));
129 static PortsList providedPorts()
132 OutputPort<
int>(
"size") };
Definition: pop_from_queue.hpp:57
NodeStatus tick() override
Method to be implemented by the user.
Definition: pop_from_queue.hpp:63
Definition: pop_from_queue.hpp:105
NodeStatus tick() override
Method to be implemented by the user.
Definition: pop_from_queue.hpp:111
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
Definition: action_node.h:57
Definition: action_node.h:24
NodeStatus
Definition: basic_types.h:34
Definition: tree_node.h:105
Definition: pop_from_queue.hpp:37