Go to the documentation of this file.
67 std::shared_ptr<ProtectedQueue<T>> queue;
68 if(
getInput(
"queue", queue) && queue )
70 std::unique_lock<std::mutex> lk(queue->mtx);
71 auto& items = queue->items;
78 T val = items.front();
91 return { InputPort<std::shared_ptr<ProtectedQueue<T>>>(
"queue"),
92 OutputPort<T>(
"popped_item")};
107 template <
typename T>
118 std::shared_ptr<ProtectedQueue<T>> queue;
119 if(
getInput(
"queue", queue) && queue )
121 std::unique_lock<std::mutex> lk(queue->mtx);
122 auto& items = queue->items;
138 return { InputPort<std::shared_ptr<ProtectedQueue<T>>>(
"queue"),
139 OutputPort<int>(
"size")};
Result getInput(const std::string &key, T &destination) const
static pthread_mutex_t mutex
std::unordered_map< std::string, PortInfo > PortsList
const NodeConfiguration & config() const
PopFromQueue(const std::string &name, const NodeConfiguration &config)
NodeStatus tick() override
Method to be implemented by the user.
QueueSize(const std::string &name, const NodeConfiguration &config)
NodeStatus tick() override
Method to be implemented by the user.
static PortsList providedPorts()
Result setOutput(const std::string &key, const T &value)
const std::string & name() const
Name of the instance, not the type.
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
static PortsList providedPorts()
behaviortree_cpp_v3
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Wed Jun 26 2024 02:51:19