20 #ifndef __TPIE_PIPELINING_PIPE_BASE_H__
21 #define __TPIE_PIPELINING_PIPE_BASE_H__
24 #include <tpie/pipelining/priority_type.h>
26 #include <tpie/pipelining/pair_factory.h>
27 #include <tpie/pipelining/pipeline.h>
31 namespace pipelining {
35 template <
typename child_t>
38 inline child_t & memory(
double amount) {
39 self().factory.memory(amount);
43 inline double memory()
const {
44 return self().factory.memory();
47 inline child_t & name(
const std::string & n, priority_type p = PRIORITY_USER) {
48 self().factory.name(n, p);
52 inline child_t & breadcrumb(
const std::string & n) {
53 self().factory.push_breadcrumb(n);
58 inline child_t &
self() {
return *
static_cast<child_t*
>(
this);}
59 inline const child_t &
self()
const {
return *
static_cast<const child_t*
>(
this);}
67 template <
typename child_t,
typename fact_t>
70 typedef typename fact_t::constructed_type constructed_type;
72 constructed_type construct()
const {
73 return this->
self().factory.construct();
80 template <
typename child_t>
83 template <
typename dest_t>
85 typedef typename child_t::factory_type::template constructed<dest_t>::type type;
88 template <
typename dest_t>
89 typename constructed<dest_t>::type construct(
const dest_t & dest)
const {
90 return this->
self().factory.construct(dest);
96 template <
typename fact_t>
99 typedef fact_t factory_type;
104 inline pipe_end(
const fact_t & factory) : factory(factory) {
118 template <
typename fact_t>
121 typedef fact_t factory_type;
126 inline pipe_middle(
const fact_t & factory) : factory(factory) {
132 template <
typename fact2_t>
142 template <
typename fact2_t>
151 template <
typename fact_t>
154 typedef fact_t factory_type;
159 inline pipe_begin(
const fact_t & factory) : factory(factory) {
162 template <
typename fact2_t>
168 template <
typename fact2_t>
177 template <
typename fact_t>
180 typedef fact_t factory_type;
185 inline pullpipe_end(
const fact_t & factory) : factory(factory) {
191 template <
typename fact_t>
194 typedef fact_t factory_type;
202 template <
typename fact2_t>
208 template <
typename fact2_t>
217 template <
typename fact_t>
220 typedef fact_t factory_type;
225 inline pullpipe_begin(
const fact_t & factory) : factory(factory) {
228 template <
typename fact2_t>
234 template <
typename fact2_t>
247 #endif // __TPIE_PIPELINING_PIPE_BASE_H__
pipe_end< bits::termpair_factory< fact_t, fact2_t > > operator|(const pipe_end< fact2_t > &r)
This pipe operator combines this generator/filter with a terminator to make a pipeline.
pipe_middle< bits::pair_factory< fact_t, fact2_t > > operator|(const pipe_middle< fact2_t > &r)
The pipe operator combines this generator/filter with another filter.
Traverse pipeline graphs.
A pipe_middle class pushes input down the pipeline.