Go to the documentation of this file.
64 std::shared_ptr<ProtectedQueue<T>> queue;
65 if(
getInput(
"queue", queue) && queue)
67 std::unique_lock<std::mutex> lk(queue->mtx);
68 auto& items = queue->items;
76 T val = items.front();
90 return { InputPort<std::shared_ptr<ProtectedQueue<T>>>(
"queue"), OutputPort<T>(
"poppe"
108 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;
139 return { InputPort<std::shared_ptr<ProtectedQueue<T>>>(
"queue"),
140 OutputPort<int>(
"size") };
Result getInput(const std::string &key, T &destination) const
PopFromQueue(const std::string &name, const NodeConfig &config)
const NodeConfig & config() const
static pthread_mutex_t mutex
std::unordered_map< std::string, PortInfo > PortsList
NodeStatus tick() override
Method to be implemented by the user.
NodeStatus tick() override
Method to be implemented by the user.
static PortsList providedPorts()
Result setOutput(const std::string &key, const T &value)
setOutput modifies the content of an Output port
const std::string & name() const
Name of the instance, not the type.
QueueSize(const std::string &name, const NodeConfig &config)
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn't require a...
static PortsList providedPorts()