oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

Feature request: optional_node

Open Lawrencemm opened this issue 6 years ago • 3 comments

Hello, my flow graph usage requires some nodes to conditionally send messages to their successors.

Currently I achieve this by using a single-output multifunction_node and conditionally sending to the output port.

I think this could more elegantly be handled with a new node type. Its usage would be identical to function_node with one difference: the return type for body would be an optional<output_type>.

If the body returns nullopt then a message is not sent to successors.

Lawrencemm avatar Apr 25 '19 02:04 Lawrencemm

Also want this feature. Is there any progress about this?

Gerrard-YNWA avatar Apr 28 '22 02:04 Gerrard-YNWA

I've run into needing this feature as well, and am planning on using the same solution that @Lawrencemm proposed above in the meantime. If I were to create a PR that implemented this (I'd probably call it something like flow::filter_node<Input, Output>), would the oneTBB developers be interested in adopting it?

knoepfel avatar May 10 '22 01:05 knoepfel