TPIE

v1.1rc1-6-g0c97303
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 (const 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= (const 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)
 
 operator bool ()
 
void operator() (stream_size_type items, progress_indicator_base &pi, memory_size_type mem)
 Invoke the pipeline. More...
 
void plot (std::ostream &out)
 Generate a GraphViz plot of the actor graph. More...
 
double memory () const
 
node_map::ptr get_node_map () const
 
void forward_any (std::string key, const boost::any &value)
 
bool can_fetch (std::string key)
 
boost::any fetch_any (std::string key)
 

Protected Attributes

virt_node::ptr m_node
 
node_map::ptr m_segmap
 
double m_memory
 

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 272 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 320 of file virtual.h.

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

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

Definition at line 329 of file virtual.h.

329  {
330  *this = pipe;
331  set_container(ctr);
332  }
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 455 of file virtual.h.

457  : virtual_chunk_base(left.get_node_map(),
458  bits::virt_node::combine(left.get_node(), right.get_node()))
459 {
460  m_src = acc::get_source(left);
461 }
static ptr combine(ptr left, ptr right)
Aggregate ownership of virt_nodes.
Definition: virtual.h:199

Member Function Documentation

void tpie::pipelining::bits::pipeline_base::operator() ( stream_size_type  items,
progress_indicator_base pi,
memory_size_type  mem 
)
inherited

Invoke the pipeline.

template<typename Input>
template<typename fact_t >
virtual_chunk_end& tpie::pipelining::virtual_chunk_end< Input >::operator= ( const pipe_end< fact_t > &  pipe)
inline

Construct a node and assign it to this virtual chunk.

Definition at line 347 of file virtual.h.

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

347  {
348  if (this->m_node) {
349  log_error() << "Virtual chunk assigned twice" << std::endl;
350  throw tpie::exception("Virtual chunk assigned twice");
351  }
352 
353  typedef typename fact_t::constructed_type constructed_type;
354  m_src = new bits::virtsrc_impl<constructed_type>(pipe.factory.construct());
355  this->m_node = bits::virt_node::take_own(m_src);
356  this->m_segmap = m_src->get_node_map();
357 
358  return *this;
359  }
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:119
static ptr take_own(node *pipe)
Take std::new-ownership of given node.
Definition: virtual.h:189
logstream & log_error()
Return logstream for writing error log messages.
Definition: tpie_log.h:104
void tpie::pipelining::bits::pipeline_base::plot ( std::ostream &  out)
inherited

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).


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