TPIE

2362a60
tpie::pipelining::bits::virt_node Class Reference

Ownership of nodes. More...

#include <tpie/pipelining/virtual.h>

Public Types

typedef std::shared_ptr
< virt_node
ptr
 

Public Member Functions

void set_container (virtual_container *ctr)
 Set and/or reset the virtual_container assigned to this virtual node. More...
 

Static Public Member Functions

static ptr take_own (node *pipe)
 Take std::new-ownership of given node. More...
 
static ptr combine (ptr left, ptr right)
 Aggregate ownership of virt_nodes. More...
 

Detailed Description

Ownership of nodes.

This class can only be instantiated through static methods that return a virt_node::ptr, providing reference counting so that nodes are only instantiated once each and are destroyed when the pipeline object goes out of scope.

This class either owns a node or two virt_nodes. The first case is used in the virtual_chunk constructors that accept a single pipe_base. The second case is used in the virtual_chunk pipe operators.

Definition at line 182 of file virtual.h.

Member Function Documentation

static ptr tpie::pipelining::bits::virt_node::combine ( ptr  left,
ptr  right 
)
inlinestatic

Aggregate ownership of virt_nodes.

Definition at line 206 of file virtual.h.

Referenced by tpie::pipelining::virtual_chunk_begin< Output >::operator|().

206  {
207  virt_node * n = new virt_node();
208  n->m_left = left;
209  n->m_right = right;
210  ptr res(n);
211  return res;
212  }
void tpie::pipelining::bits::virt_node::set_container ( virtual_container ctr)
inline

Set and/or reset the virtual_container assigned to this virtual node.

Definition at line 218 of file virtual.h.

218  {
219  m_container.reset(ctr);
220  }
static ptr tpie::pipelining::bits::virt_node::take_own ( node pipe)
inlinestatic

Take std::new-ownership of given node.

Definition at line 196 of file virtual.h.

Referenced by tpie::pipelining::virtual_chunk_end< Input >::operator=(), tpie::pipelining::virtual_chunk< Input, Output >::operator=(), and tpie::pipelining::virtual_chunk_begin< Output >::operator=().

196  {
197  virt_node * n = new virt_node();
198  n->m_node.reset(pipe);
199  ptr res(n);
200  return res;
201  }

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