20 #ifndef TPIE_PIPELINING_SPLIT_H
21 #define TPIE_PIPELINING_SPLIT_H
23 #include <tpie/pipelining/node.h>
24 #include <tpie/pipelining/factory_helpers.h>
25 #include <tpie/pipelining/pipe_base.h>
46 virtual void push(
const T & v) = 0;
52 template <
typename dest_t>
56 : the_sources(the_sources)
57 , dest(std::move(dest))
59 this->
set_name(
"Split source", PRIORITY_INSIGNIFICANT);
63 bits::node_map::ptr m = this->
get_node_map()->find_authority();
64 m->add_relation(sink_token.id(), this->get_token().id(), bits::pushes);
70 the_sources.push_back(
this);
73 void push(
const T & v)
override {
78 std::vector<source_base *> & the_sources;
82 pipe_begin<factory<source_impl, node_token, std::vector<source_base *> &> > source() {
83 return {sink_token, the_sources};
91 :
node(sink_token), the_sources(the_sources)
93 set_name(
"Join sink", PRIORITY_INSIGNIFICANT);
96 void push(
const T & v) {
97 for (
auto & source : the_sources)
102 std::vector<source_base *> & the_sources;
106 return {sink_token, the_sources};
110 std::vector<source_base *> the_sources;
111 node_token sink_token;
116 #endif // TPIE_PIPELINING_SPLIT_H