52 std::shared_ptr<ProtectedQueue<T>> queue;
53 if (
getInput(
"queue", queue) && queue)
55 std::unique_lock<std::mutex> lk(queue->mtx);
56 auto& items = queue->items;
58 while (!items.empty())
62 T val = items.front();
91 return {InputPort<std::shared_ptr<ProtectedQueue<T>>>(
"queue"), OutputPort<T>(
"popped" static PortsList providedPorts()
const NodeConfiguration & config() const
Result setOutput(const std::string &key, const T &value)
NodeStatus tick() override
Method to be implemented by the user.
const std::string & name() const
Name of the instance, not the type.
void haltChild()
Same as resetChild()
Result getInput(const std::string &key, T &destination) const
std::unordered_map< std::string, PortInfo > PortsList
ConsumeQueue(const std::string &name, const NodeConfiguration &config)
virtual BT::NodeStatus executeTick()
The method that should be used to invoke tick() and setStatus();.
void setStatus(NodeStatus new_status)