SpeakX
SpeakX

Reputation: 385

Update Node from OneTBB Library

Is there a way to have joiner/indexer or composite node with an update policy? The update policy has the requirement:

  1. The output is ready once at least one port receives a value.
  2. Mechanism to check if a port is ready at the receiving node e.g. null pointer or default constructor or user defined invalid value or a flag true or false indicating if the port is ready
  3. If a port has only one value, this value is conserved and is sent once another port with new value is ready (if all ports hold the same old message, then no updates).

Example:

Update node with two ports 1 and 2. Value x1 is pushed into port 1 => the node is ready to send updates with "pair" {x1, nullptr} while keeping x1 in the queue.

Value x2 arrives at port 1 => the node is ready and sends {x2, nullptr}, x1 is overwritten and x2 is conserved

Value y1 arrives at port 2 => the node is ready and sends {x2, y1} and x2 and y1 are conserved

Value x3 arrived at port 1 => the node is ready and sends {x3, y1} and x3 and y1 are conserved

This looks like combination of either joiner/indexer or composite and overwrite_node. My value type is shared_ptr so nullptr would work for me.

Upvotes: 1

Views: 38

Answers (0)

Related Questions