util::stream::Link Class Reference

#include <chain.hh>

Collaboration diagram for util::stream::Link:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Link (const ChainPosition &position)
 Link ()
void Init (const ChainPosition &position)
 ~Link ()
Blockoperator* ()
const Blockoperator* () const
Blockoperator-> ()
const Blockoperator-> () const
Linkoperator++ ()
 operator bool () const
void Poison ()


Detailed Description

Represents a C++ style iterator over blocks.

Definition at line 252 of file chain.hh.


Constructor & Destructor Documentation

util::stream::Link::Link ( const ChainPosition position  )  [explicit]

Constructs an initialized link.

See also:
Init

Definition at line 121 of file chain.cc.

References Init().

Here is the call graph for this function:

util::stream::Link::Link (  ) 

Constructs a link that must subsequently be initialized.

See also:
Init

Definition at line 110 of file chain.cc.

util::stream::Link::~Link (  ) 

Destructs the link object.

If necessary, this method will pass a poison block to this link's output producer queue.

See also:
Block::SetToPoison()

Definition at line 125 of file chain.cc.

References util::PCQueue< T >::Produce().

Here is the call graph for this function:


Member Function Documentation

void util::stream::Link::Init ( const ChainPosition position  ) 

Initializes the link with the input consumer queue and output producer queue at a given position in the chain.

See also:
Link()

Definition at line 112 of file chain.cc.

References util::PCQueue< T >::Consume(), and UTIL_THROW_IF.

Referenced by util::stream::Stream::Init(), Link(), and util::stream::operator>>().

Here is the call graph for this function:

Here is the caller graph for this function:

util::stream::Link::operator bool (  )  const [inline]

Returns true if the block at this link encapsulates a valid (non-NULL) block of memory.

This method is a user-defined implicit conversion function to boolean; among other things, this method enables bare instances of this class to be used as the condition of an if statement.

Definition at line 320 of file chain.hh.

const Block& util::stream::Link::operator* (  )  const [inline]

Gets a const reference to the block at this link.

Definition at line 296 of file chain.hh.

Block& util::stream::Link::operator* (  )  [inline]

Gets a reference to the block at this link.

Definition at line 291 of file chain.hh.

Link & util::stream::Link::operator++ (  ) 

Gets the link at the next position in the chain.

Definition at line 143 of file chain.cc.

References util::PCQueue< T >::Consume(), util::PCQueue< T >::Produce(), and util::stream::Block::ValidSize().

Here is the call graph for this function:

const Block* util::stream::Link::operator-> (  )  const [inline]

Gets a const pointer to the block at this link.

Definition at line 306 of file chain.hh.

Block* util::stream::Link::operator-> (  )  [inline]

Gets a pointer to the block at this link.

Definition at line 301 of file chain.hh.

void util::stream::Link::Poison (  ) 

Poisons the block at this link, and passes this now-poisoned block to this link's output producer queue.

See also:
Block::SetToPoison()

Definition at line 155 of file chain.cc.

References util::PCQueue< T >::Produce().

Referenced by util::stream::Stream::Poison(), util::stream::MergingReader< Compare, Combine >::Run(), and util::stream::PRead::Run().

Here is the call graph for this function:

Here is the caller graph for this function:


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

Generated on Thu Jul 6 00:34:54 2017 for Moses by  doxygen 1.5.9