split_node¶
[flow_graph.split_node]
A split_node sends each element of the incoming tuple to the output port that matches the element’s index
in the incoming tuple.
// Defined in header <tbb/flow_graph.h>
namespace tbb {
namespace flow {
    template < typename TupleType >
    class split_node : public graph_node, public receiver<TupleType> {
    public:
        explicit split_node( graph &g );
        split_node( const split_node &other);
        ~split_node();
        bool try_put( const TupleType &v );
        using output_ports_type = /*implementation-defined*/ ;
        output_ports_type& output_ports();
    };
} // namespace flow
} // namespace tbb
Requirements:
The type
TupleTypemust be an instantiation ofstd::tuple. Each type that the tuple stores shall meet the CopyConstructible requirements from [copyconstructible] and CopyAssignable requirements from [copyassignable] ISO C++ Standard sections.
split_node is a receiver<TupleType> and has a tuple of sender output ports; Each of output
ports is specified by corresponding tuple element type. This node receives a tuple at its single input
portand generates a message from each element of the tuple, passing each to them corresponding output port.
split_node has a discarding and broadcast-push properties.
split_node has unlimited concurrency, and behaves as a broadcast_node with multiple output ports.
Member functions¶
- 
split_node(const split_node &other)¶ Constructs a
split_nodethat has the same initial state thatotherhad when it was constructed. Thesplit_nodethat is constructed will have a reference to the samegraphobject asother. The predecessors and successors ofotherwill not be copied.
- 
~split_node()¶ Destructor
- 
bool 
try_put(const TupleType &v)¶ Broadcasts each element of the incoming tuple to the nodes connected to the
split_node’s output ports. The element at indexiofvwill be broadcast through theith output port.Returns:
true
- 
output_ports_type &
output_ports() Returns: a tuple of output ports.