libpqxx  7.7.0
pqxx::icursor_iterator Class Reference

Approximate istream_iterator for icursorstream. More...

#include <cursor.hxx>

Public Types

using iterator_category = std::input_iterator_tag
using value_type = result
using pointer = result const *
using reference = result const &
using istream_type = icursorstream
using size_type = istream_type::size_type
using difference_type = istream_type::difference_type

Public Member Functions

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


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 rows, and "*ici++" reads one stride's worth of rows from the stream.

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

◆ difference_type

◆ istream_type

◆ iterator_category

using pqxx::icursor_iterator::iterator_category = std::input_iterator_tag

◆ pointer

◆ reference

◆ size_type

◆ value_type

Constructor & Destructor Documentation

◆ icursor_iterator() [1/3]

pqxx::icursor_iterator::icursor_iterator ( )

◆ icursor_iterator() [2/3]

pqxx::icursor_iterator::icursor_iterator ( istream_type s)

◆ icursor_iterator() [3/3]

pqxx::icursor_iterator::icursor_iterator ( icursor_iterator const &  rhs)

◆ ~icursor_iterator()

pqxx::icursor_iterator::~icursor_iterator ( )

Member Function Documentation

◆ operator!=()

bool pqxx::icursor_iterator::operator!= ( icursor_iterator const &  rhs) const

◆ operator*()

result const& pqxx::icursor_iterator::operator* ( ) const

◆ operator++() [1/2]

pqxx::icursor_iterator & pqxx::icursor_iterator::operator++ ( )

◆ operator++() [2/2]

pqxx::icursor_iterator pqxx::icursor_iterator::operator++ ( int  )

◆ operator+=()

pqxx::icursor_iterator & pqxx::icursor_iterator::operator+= ( difference_type  n)

◆ operator->()

result const* pqxx::icursor_iterator::operator-> ( ) const

◆ operator<()

bool pqxx::icursor_iterator::operator< ( icursor_iterator const &  rhs) const

◆ operator<=()

bool pqxx::icursor_iterator::operator<= ( icursor_iterator const &  rhs) const

◆ operator=()

pqxx::icursor_iterator & pqxx::icursor_iterator::operator= ( icursor_iterator const &  rhs)

◆ operator==()

bool pqxx::icursor_iterator::operator== ( icursor_iterator const &  rhs) const

◆ operator>()

bool pqxx::icursor_iterator::operator> ( icursor_iterator const &  rhs) const

◆ operator>=()

bool pqxx::icursor_iterator::operator>= ( icursor_iterator const &  rhs) const

Friends And Related Function Documentation

◆ internal::gate::icursor_iterator_icursorstream

friend class internal::gate::icursor_iterator_icursorstream

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