TPIE

2362a60
tpie::pipelining::virtual_chunk_end< Input > Class Template Reference

Virtual chunk that has no output (that is, virtual consumer). More...

#include <tpie/pipelining/virtual.h>

Inherits tpie::pipelining::bits::virtual_chunk_base.

Public Member Functions

 virtual_chunk_end ()
 Constructor that leaves the virtual chunk unassigned. More...
 
template<typename fact_t >
 virtual_chunk_end (pipe_end< fact_t > &&pipe, virtual_container *ctr=0)
 Constructor that recursively constructs a node and takes ownership of it. More...
 
template<typename Mid >
 virtual_chunk_end (const virtual_chunk< Input, Mid > &left, const virtual_chunk_end< Mid > &right)
 Constructor that combines two virtual chunks. More...
 
template<typename fact_t >
virtual_chunk_endoperator= (pipe_end< fact_t > &&pipe)
 Construct a node and assign it to this virtual chunk. More...
 
virt_node::ptr get_node () const
 
void set_container (virtual_container *ctr)
 
bool empty () const
 
void operator() (stream_size_type items, progress_indicator_base &pi, memory_size_type filesAvailable, memory_size_type mem, const char *file, const char *function)
 Invoke the pipeline. More...
 
void operator() (stream_size_type items, progress_indicator_base &pi, memory_size_type mem, const char *file, const char *function)
 Invoke the pipeline with amount of available files automatically configured. More...
 
double memory () const
 
void order_before (pipeline_base &other)
 
void plot (std::ostream &out)
 Generate a GraphViz plot of the pipeline. More...
 
void plot_full (std::ostream &out)
 Generate a GraphViz plot of the actor graph. More...
 
void forward_any (std::string key, any_noncopyable value)
 
bool can_fetch (std::string key)
 
any_noncopyablefetch_any (std::string key)
 
node_map::ptr get_node_map () const
 
void output_memory (std::ostream &o) const
 
size_t uid () const
 

Protected Attributes

virt_node::ptr m_node
 
double m_memory
 
node_map::ptr m_nodeMap
 
size_t m_uid
 

Friends

class bits::access
 

Detailed Description

template<typename Input>
class tpie::pipelining::virtual_chunk_end< Input >

Virtual chunk that has no output (that is, virtual consumer).

Definition at line 279 of file virtual.h.

Constructor & Destructor Documentation

template<typename Input>
tpie::pipelining::virtual_chunk_end< Input >::virtual_chunk_end ( )
inline

Constructor that leaves the virtual chunk unassigned.

Definition at line 331 of file virtual.h.

332  : m_src(0)
333  {}
template<typename Input>
template<typename fact_t >
tpie::pipelining::virtual_chunk_end< Input >::virtual_chunk_end ( pipe_end< fact_t > &&  pipe,
virtual_container ctr = 0 
)
inline

Constructor that recursively constructs a node and takes ownership of it.

Definition at line 340 of file virtual.h.

340  {
341  *this = std::forward<pipe_end<fact_t>>(pipe);
342  set_container(ctr);
343  }
template<typename Input >
template<typename Mid >
tpie::pipelining::virtual_chunk_end< Input >::virtual_chunk_end ( const virtual_chunk< Input, Mid > &  left,
const virtual_chunk_end< Mid > &  right 
)

Constructor that combines two virtual chunks.

Assumes that the virtual nodes are already connected. You should not use this constructor directly; instead, use the pipe operator.

Definition at line 482 of file virtual.h.

484  : virtual_chunk_base(left.get_node_map(),
485  bits::virt_node::combine(left.get_node(), right.get_node()))
486 {
487  m_src = acc::get_source(left);
488 }
static ptr combine(ptr left, ptr right)
Aggregate ownership of virt_nodes.
Definition: virtual.h:206

Member Function Documentation

void tpie::pipelining::bits::pipeline_base::operator() ( stream_size_type  items,
progress_indicator_base pi,
memory_size_type  filesAvailable,
memory_size_type  mem,
const char *  file,
const char *  function 
)
inherited

Invoke the pipeline.

Referenced by tpie::pipelining::bits::pipeline_base::operator()().

void tpie::pipelining::bits::pipeline_base::operator() ( stream_size_type  items,
progress_indicator_base pi,
memory_size_type  mem,
const char *  file,
const char *  function 
)
inlineinherited

Invoke the pipeline with amount of available files automatically configured.

Definition at line 123 of file pipeline.h.

References tpie::get_file_manager(), and tpie::pipelining::bits::pipeline_base::operator()().

125  {
126  operator()(items, pi, get_file_manager().available(), mem, file, function);
127  }
void operator()(stream_size_type items, progress_indicator_base &pi, memory_size_type filesAvailable, memory_size_type mem, const char *file, const char *function)
Invoke the pipeline.
file_manager & get_file_manager()
Return a reference to the file manager.
template<typename Input>
template<typename fact_t >
virtual_chunk_end& tpie::pipelining::virtual_chunk_end< Input >::operator= ( pipe_end< fact_t > &&  pipe)
inline

Construct a node and assign it to this virtual chunk.

Definition at line 358 of file virtual.h.

References tpie::pipelining::node::get_node_map(), tpie::log_error(), and tpie::pipelining::bits::virt_node::take_own().

358  {
359  if (this->m_node) {
360  log_error() << "Virtual chunk assigned twice" << std::endl;
361  throw tpie::exception("Virtual chunk assigned twice");
362  }
363 
364  typedef typename fact_t::constructed_type constructed_type;
365  m_src = new bits::virtsrc_impl<constructed_type, Input>(pipe.factory.construct());
366  this->m_node = bits::virt_node::take_own(m_src);
367  this->m_nodeMap = m_src->get_node_map();
368 
369  return *this;
370  }
bits::node_map::ptr get_node_map() const
Get the local node map, mapping node IDs to node pointers for all the nodes reachable from this one...
Definition: node.h:251
static ptr take_own(node *pipe)
Take std::new-ownership of given node.
Definition: virtual.h:196
logstream & log_error()
Return logstream for writing error log messages.
Definition: tpie_log.h:147
void tpie::pipelining::bits::pipeline_base_base::plot ( std::ostream &  out)
inlineinherited

Generate a GraphViz plot of the pipeline.

When rendered with dot, GraphViz will place the nodes in the topological order of the item flow graph with items flowing from the top downwards.

Thus, a downwards arrow in the plot is a push edge, and an upwards arrow is a pull edge (assuming no cycles in the item flow graph).

Compared to plot_full, sorts, buffers and reversers will be represented as one node in the graph as apposed to 3 or 2. Nodes added by virtual wrapping will not be showed at all

Definition at line 65 of file pipeline.h.

65 {plot_impl(out, false);}
void tpie::pipelining::bits::pipeline_base_base::plot_full ( std::ostream &  out)
inlineinherited

Generate a GraphViz plot of the actor graph.

When rendered with dot, GraphViz will place the nodes in the topological order of the item flow graph with items flowing from the top downwards.

Thus, a downwards arrow in the plot is a push edge, and an upwards arrow is a pull edge (assuming no cycles in the item flow graph).

Definition at line 77 of file pipeline.h.

77 {plot_impl(out, true);}

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