TPIE

11a2c2d
tpie::pipelining::virtual_chunk_pull_end< Input > Class Template Reference

Virtual chunk that has no input (that is, virtual producer). More...

#include <tpie/pipelining/virtual.h>

Public Member Functions

 virtual_chunk_pull_end ()
 Constructor that leaves the virtual chunk unassigned. More...
 
template<typename fact_t >
 virtual_chunk_pull_end (pullpipe_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_pull_endoperator= (pullpipe_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_pull_end< Input >

Virtual chunk that has no input (that is, virtual producer).

Definition at line 60 of file virtual.h.

Constructor & Destructor Documentation

◆ virtual_chunk_pull_end() [1/2]

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

Constructor that leaves the virtual chunk unassigned.

Definition at line 734 of file virtual.h.

735  : m_input(nullptr)
736  {}

◆ virtual_chunk_pull_end() [2/2]

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

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

Definition at line 743 of file virtual.h.

743  {
744  *this = std::forward<pullpipe_end<fact_t>>(pipe);
745  set_container(ctr);
746  }

Member Function Documentation

◆ operator bool()

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

Test if it is not an empty chunk.

Definition at line 769 of file virtual.h.

769  {
770  return m_input != nullptr;
771  }

◆ operator=()

template<typename Input >
template<typename fact_t >
virtual_chunk_pull_end& tpie::pipelining::virtual_chunk_pull_end< Input >::operator= ( pullpipe_end< fact_t > &&  pipe)
inline

Construct a node and assign it to this virtual chunk.

Definition at line 752 of file virtual.h.

752  {
753  if (this->m_node) {
754  log_error() << "Virtual chunk assigned twice" << std::endl;
755  throw tpie::exception("Virtual chunk assigned twice");
756  }
757  typedef typename fact_t::template constructed_type<input_type> constructed_type;
758  input_type temp(m_input);
759  this->m_nodeMap = m_input->get_node_map();
760  fact_t f = std::move(pipe.factory);
761  f.set_destination_kind_pull();
762  this->m_node = bits::virt_node::take_own(new constructed_type(f.construct(std::move(temp))));
763  return *this;
764  }

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


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