libpqxx  v4.0-1
C++ library for PostgreSQL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pqxx::icursor_iterator Class Reference

Approximate istream_iterator for icursorstream. More...

#include <cursor.hxx>

Inheritance diagram for pqxx::icursor_iterator:
Collaboration diagram for pqxx::icursor_iterator:

Public Types

typedef
istream_type::difference_type 
difference_type
 
typedef icursorstream istream_type
 
typedef istream_type::size_type size_type
 

Public Member Functions

 icursor_iterator () throw ()
 
 icursor_iterator (istream_type &) throw ()
 
 icursor_iterator (const icursor_iterator &) throw ()
 
 ~icursor_iterator () throw ()
 
bool operator!= (const icursor_iterator &rhs) const throw ()
 
const resultoperator* () const
 
icursor_iteratoroperator++ ()
 
icursor_iterator operator++ (int)
 
icursor_iteratoroperator+= (difference_type)
 
const resultoperator-> () const
 
bool operator< (const icursor_iterator &rhs) const
 
bool operator<= (const icursor_iterator &rhs) const
 
icursor_iteratoroperator= (const icursor_iterator &) throw ()
 
bool operator== (const icursor_iterator &rhs) const
 
bool operator> (const icursor_iterator &rhs) const
 
bool operator>= (const icursor_iterator &rhs) const
 

Private Member Functions

void fill (const result &)
 
difference_type pos () const throw ()
 
void refresh () const
 

Private Attributes

result m_here
 
icursor_iteratorm_next
 
difference_type m_pos
 
icursor_iteratorm_prev
 
icursorstreamm_stream
 

Friends

class internal::gate::icursor_iterator_icursorstream
 

Detailed Description

Approximate istream_iterator for icursorstream.

Intended as an implementation of an input_iterator (as defined by the C++ Standard Library), this class supports only two basic operations: reading the current element, and moving forward. In addition to the minimal guarantees for istream_iterators, this class supports multiple successive reads of the same position (the current result set is cached in the iterator) even after copying and even after new data have been read from the stream. This appears to be a requirement for input_iterators. Comparisons are also supported in the general case.

The iterator does not care about its own position, however. Moving an iterator forward moves the underlying stream forward and reads the data from the new stream position, regardless of the iterator's old position in the stream.

The stream's stride defines the granularity for all iterator movement or access operations, i.e. "ici += 1" advances the stream by one stride's worth of tuples, and "*ici++" reads one stride's worth of tuples from the stream.

Warning
Do not read from the underlying stream or its cursor, move its read position, or change its stride, between the time the first icursor_iterator on it is created and the time its last icursor_iterator is destroyed.
Manipulating these iterators within the context of a single cursor stream is not thread-safe. Creating a new iterator, copying one, or destroying one affects the stream as a whole.

Member Typedef Documentation

Constructor & Destructor Documentation

pqxx::icursor_iterator::icursor_iterator ( ) throw ()
pqxx::icursor_iterator::icursor_iterator ( istream_type ) throw ()
explicit
pqxx::icursor_iterator::icursor_iterator ( const icursor_iterator ) throw ()
pqxx::icursor_iterator::~icursor_iterator ( ) throw ()

Member Function Documentation

void pqxx::icursor_iterator::fill ( const result )
private
bool pqxx::icursor_iterator::operator!= ( const icursor_iterator rhs) const throw ()
inline
const result& pqxx::icursor_iterator::operator* ( ) const
inline
icursor_iterator& pqxx::icursor_iterator::operator++ ( )
icursor_iterator pqxx::icursor_iterator::operator++ ( int  )
icursor_iterator& pqxx::icursor_iterator::operator+= ( difference_type  )
const result* pqxx::icursor_iterator::operator-> ( ) const
inline
bool pqxx::icursor_iterator::operator< ( const icursor_iterator rhs) const
bool pqxx::icursor_iterator::operator<= ( const icursor_iterator rhs) const
inline
icursor_iterator& pqxx::icursor_iterator::operator= ( const icursor_iterator ) throw ()
bool pqxx::icursor_iterator::operator== ( const icursor_iterator rhs) const
bool pqxx::icursor_iterator::operator> ( const icursor_iterator rhs) const
inline
bool pqxx::icursor_iterator::operator>= ( const icursor_iterator rhs) const
inline
difference_type pqxx::icursor_iterator::pos ( ) const throw ()
inlineprivate
void pqxx::icursor_iterator::refresh ( ) const
private

Friends And Related Function Documentation

Member Data Documentation

result pqxx::icursor_iterator::m_here
private
icursor_iterator * pqxx::icursor_iterator::m_next
private
difference_type pqxx::icursor_iterator::m_pos
private
icursor_iterator* pqxx::icursor_iterator::m_prev
private
icursorstream* pqxx::icursor_iterator::m_stream
private

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