TPIE

11a2c2d
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>

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=nullptr)
 Constructor that recursively constructs a node and takes ownership of it. More...
 
template<typename fact_t >
virtual_chunk_endoperator= (pipe_end< fact_t > &&pipe)
 Construct a node and assign it to this virtual chunk. More...
 
 operator bool () const noexcept
 Test if it is not an empty chunk. More...
 

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

Constructor & Destructor Documentation

◆ virtual_chunk_end() [1/2]

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

Constructor that leaves the virtual chunk unassigned.

Definition at line 444 of file virtual.h.

445  : m_input(nullptr)
446  {}

◆ virtual_chunk_end() [2/2]

template<typename Input >
template<typename fact_t >
tpie::pipelining::virtual_chunk_end< Input >::virtual_chunk_end ( pipe_end< fact_t > &&  pipe,
virtual_container ctr = nullptr 
)
inline

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

Definition at line 453 of file virtual.h.

453  {
454  *this = std::forward<pipe_end<fact_t>>(pipe);
455  set_container(ctr);
456  }

Member Function Documentation

◆ operator bool()

template<typename Input >
tpie::pipelining::virtual_chunk_end< Input >::operator bool ( ) const
inlineexplicitnoexcept

Test if it is not an empty chunk.

Definition at line 480 of file virtual.h.

480  {
481  return m_input != nullptr;
482  }

◆ operator=()

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

463  {
464  if (this->m_node) {
465  log_error() << "Virtual chunk assigned twice" << std::endl;
466  throw tpie::exception("Virtual chunk assigned twice");
467  }
468 
469  typedef typename fact_t::constructed_type constructed_type;
470  m_input = new bits::virtsrc_impl<constructed_type, Input>(pipe.factory.construct());
471  this->m_node = bits::virt_node::take_own(m_input);
472  this->m_nodeMap = m_input->get_node_map();
473 
474  return *this;
475  }

The documentation for this class was generated from the following file:
tpie::pipelining::bits::virt_node::take_own
static ptr take_own(node *pipe)
Take std::new-ownership of given node.
Definition: virtual.h:309
tpie::log_error
logstream & log_error()
Return logstream for writing error log messages.
Definition: tpie_log.h:148
tpie::pipelining::node::get_node_map
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:250
tpie::exception
Definition: exception.h:33