TPIE

11a2c2d
tpie::pipelining::pipe_middle< fact_t > Class Template Reference

#include <tpie/pipelining/pipe_base.h>

Inherits tpie::pipelining::bits::pipe_nonterm_base< pipe_middle< fact_t > >.

Public Types

typedef fact_t factory_type
 
using constructed_type = typename constructed< dest_t >::type
 

Public Member Functions

 pipe_middle (const pipe_middle &)=delete
 
 pipe_middle (pipe_middle &&)=default
 
pipe_middleoperator= (const pipe_middle &)=delete
 
pipe_middleoperator= (pipe_middle &&)=default
 
 pipe_middle (const fact_t &&o)=delete
 
 pipe_middle (fact_t &&o)
 
pipe_middleoperator= (const fact_t &)=delete
 
pipe_middleoperator= (fact_t &&o)
 
template<typename ... T_ARGS>
 pipe_middle (T_ARGS &&... args)
 Forwards the arguments given to the constructor of the factory. More...
 
template<typename fact2_t >
pipe_middle< bits::pair_factory< fact_t, fact2_t > > operator| (pipe_middle< fact2_t > &&r)
 The pipe operator combines this generator/filter with another filter. More...
 
pipe_middle operator| (empty_pipe_middle &&)
 The pipe operator combines this generator/filter with another filter. More...
 
template<typename fact2_t >
pipe_end< bits::termpair_factory< fact_t, fact2_t > > operator| (pipe_end< fact2_t > &&r)
 This pipe operator combines this generator/filter with a terminator to make a pipeline. More...
 
constructed_type< dest_t > construct (const dest_t &dest)
 
pipe_middle< fact_t > memory (double amount)
 Set memory fraction for this node in the pipeline phase. More...
 
double memory () const
 Get memory fraction for this node in the pipeline phase. More...
 
pipe_middle< fact_t > name (const std::string &n, priority_type p=PRIORITY_USER)
 Set name for this node. More...
 
pipe_middle< fact_t > phase_name (const std::string &n, priority_type p=PRIORITY_USER)
 Set name for this phase. More...
 
pipe_middle< fact_t > add_to_set (node_set s)
 Get a refenerce to this node. More...
 
pipe_middle< fact_t > add_dependencies (node_set s)
 Add a depencency to a referenced node. More...
 
pipe_middle< fact_t > add_forwarding_dependencies (node_set s)
 Add a forwarding dependency to a referenced node. More...
 
pipe_middle< fact_t > breadcrumb (const std::string &n)
 Set a prefix for the name of this node. More...
 
pipe_middle< fact_t > forward_any (const std::string &key, any_noncopyable value)
 
pipe_middle< fact_t > forward (const std::string &key, T value)
 

Public Attributes

fact_t factory
 

Protected Member Functions

pipe_middle< fact_t > & self ()
 
const pipe_middle< fact_t > & self () const
 

Detailed Description

template<typename fact_t>
class tpie::pipelining::pipe_middle< fact_t >

A pipe_middle class pushes input down the pipeline.

Template Parameters
fact_tA factory with a construct() method like the factory_0, factory_1, etc. helpers.

Definition at line 243 of file pipe_base.h.

Constructor & Destructor Documentation

◆ pipe_middle()

template<typename fact_t >
template<typename ... T_ARGS>
tpie::pipelining::pipe_middle< fact_t >::pipe_middle ( T_ARGS &&...  args)
inline

Forwards the arguments given to the constructor of the factory.

The implementation either usesvariadic template(if supported by the compiler) or a bunch of overloads to support a variable number of constructor parameters.

Template Parameters
Argsthe variadic number of types of constructor parameters.
Parameters
argsthe variadic number of arguments to pass to the constructor of the factory

Definition at line 271 of file pipe_base.h.

271 : factory(std::forward<T_ARGS>(args)...) {}

Member Function Documentation

◆ add_dependencies()

pipe_middle< fact_t > tpie::pipelining::bits::pipe_base< pipe_middle< fact_t > >::add_dependencies ( node_set  s)
inlineinherited

Add a depencency to a referenced node.

See also
factory_base::ref

Definition at line 125 of file pipe_base.h.

125  {
126  self().factory.add_dependencies(s);
127  return std::move(self());
128  }

◆ add_forwarding_dependencies()

pipe_middle< fact_t > tpie::pipelining::bits::pipe_base< pipe_middle< fact_t > >::add_forwarding_dependencies ( node_set  s)
inlineinherited

Add a forwarding dependency to a referenced node.

See also
factory_base::ref

Definition at line 135 of file pipe_base.h.

135  {
136  self().factory.add_forwarding_dependencies(s);
137  return std::move(self());
138  }

◆ add_to_set()

pipe_middle< fact_t > tpie::pipelining::bits::pipe_base< pipe_middle< fact_t > >::add_to_set ( node_set  s)
inlineinherited

Get a refenerce to this node.

This reference can be used to call add_dependency on another node

See also
factory_base::ref

Definition at line 115 of file pipe_base.h.

115  {
116  self().factory.add_to_set(s);
117  return std::move(self());
118  }

◆ breadcrumb()

pipe_middle< fact_t > tpie::pipelining::bits::pipe_base< pipe_middle< fact_t > >::breadcrumb ( const std::string &  n)
inlineinherited

Set a prefix for the name of this node.

The name is used in the GraphViz plot generated by pipeline::plot.

See also
factory_base::push_breadcrumb

Definition at line 147 of file pipe_base.h.

147  {
148  self().factory.push_breadcrumb(n);
149  return std::move(self());
150  }

◆ memory() [1/2]

double tpie::pipelining::bits::pipe_base< pipe_middle< fact_t > >::memory
inlineinherited

Get memory fraction for this node in the pipeline phase.

See also
memory(double)
factory_base::memory()

Definition at line 74 of file pipe_base.h.

74  {
75  return self().factory.memory();
76  }

◆ memory() [2/2]

pipe_middle< fact_t > tpie::pipelining::bits::pipe_base< pipe_middle< fact_t > >::memory ( double  amount)
inlineinherited

Set memory fraction for this node in the pipeline phase.

In the absence of minimum and maximum memory requirements set by node implementations, the memory assigned to the node will be proportional to the amount parameter which sets the memory priority of this node in relation to the rest of the phase.

See also
factory_base::memory(double)

Definition at line 63 of file pipe_base.h.

63  {
64  self().factory.memory(amount);
65  return std::move(self());
66  }

◆ name()

pipe_middle< fact_t > tpie::pipelining::bits::pipe_base< pipe_middle< fact_t > >::name ( const std::string &  n,
priority_type  p = PRIORITY_USER 
)
inlineinherited

Set name for this node.

The name is used in the GraphViz plot generated by pipeline::plot.

The name priority given in the second argument should indicate how important this node is for the current phase, and is used in naming the progress indicator for this phase. The node with the highest priority name gets to name the entire phase.

See also
factory_base::name

Definition at line 90 of file pipe_base.h.

90  {
91  self().factory.name(n, p);
92  return std::move(self());
93  }

◆ operator|() [1/3]

template<typename fact_t >
pipe_middle tpie::pipelining::pipe_middle< fact_t >::operator| ( empty_pipe_middle< fact_t > &&  )
inline

The pipe operator combines this generator/filter with another filter.

Definition at line 286 of file pipe_base.h.

286 {return pipe_middle(std::move(factory));}

◆ operator|() [2/3]

template<typename fact_t >
template<typename fact2_t >
pipe_end<bits::termpair_factory<fact_t, fact2_t> > tpie::pipelining::pipe_middle< fact_t >::operator| ( pipe_end< fact2_t > &&  r)
inline

This pipe operator combines this generator/filter with a terminator to make a pipeline.

Definition at line 294 of file pipe_base.h.

294  {
295  factory.set_destination_kind_push();
296  return bits::termpair_factory<fact_t, fact2_t>(std::move(factory), std::move(r.factory));
297  }

References tpie::pipelining::factory_base::set_destination_kind_push().

◆ operator|() [3/3]

template<typename fact_t >
template<typename fact2_t >
pipe_middle<bits::pair_factory<fact_t, fact2_t> > tpie::pipelining::pipe_middle< fact_t >::operator| ( pipe_middle< fact2_t > &&  r)
inline

The pipe operator combines this generator/filter with another filter.

Definition at line 278 of file pipe_base.h.

278  {
279  factory.set_destination_kind_push();
280  return bits::pair_factory<fact_t, fact2_t>(std::move(factory), std::move(r.factory));
281  }

References tpie::pipelining::factory_base::set_destination_kind_push().

◆ phase_name()

pipe_middle< fact_t > tpie::pipelining::bits::pipe_base< pipe_middle< fact_t > >::phase_name ( const std::string &  n,
priority_type  p = PRIORITY_USER 
)
inlineinherited

Set name for this phase.

The maximal priority phase name given for a phase wins.

See also
factory_base::phase_name

Definition at line 102 of file pipe_base.h.

102  {
103  self().factory.phase_name(n, p);
104  return std::move(self());
105  }

The documentation for this class was generated from the following file: