pqxx::const_row_iterator Class Reference

Iterator for fields in a row. Use as row::const_iterator. More...

`#include <row.hxx>`

Inheritance diagram for pqxx::const_row_iterator:
[legend]

## Public Types

using | iterator_category = std::random_access_iterator_tag
using | value_type = field const
using | pointer = field const *
using | size_type = row_size_type
using | difference_type = row_difference_type
using | reference = field
Public Types inherited from pqxx::field
using | size_type = field_size_type

## Public Member Functions

| const_row_iterator () noexcept=default
| const_row_iterator (row const &t, row_size_type c) noexcept
| const_row_iterator (field const &F) noexcept
| const_row_iterator (const_row_iterator const &) noexcept=default
| const_row_iterator (const_row_iterator &&) noexcept=default
Dereferencing operators
constexpr pointer | operator-> () const noexcept
reference | operator* () const noexcept
Manipulations
const_row_iterator & | operator= (const_row_iterator const &) noexcept=default
const_row_iterator & | operator= (const_row_iterator &&) noexcept=default
const_row_iterator | operator++ (int) noexcept
const_row_iterator & | operator++ () noexcept
const_row_iterator | operator-- (int) noexcept
const_row_iterator & | operator-- () noexcept
const_row_iterator & | operator+= (difference_type i) noexcept
const_row_iterator & | operator-= (difference_type i) noexcept
Comparisons
constexpr bool | operator== (const_row_iterator const &i) const noexcept
constexpr bool | operator!= (const_row_iterator const &i) const noexcept
constexpr bool | operator< (const_row_iterator const &i) const noexcept
constexpr bool | operator<= (const_row_iterator const &i) const noexcept
constexpr bool | operator> (const_row_iterator const &i) const noexcept
constexpr bool | operator>= (const_row_iterator const &i) const noexcept
Public Member Functions inherited from pqxx::field
| field (row const &r, row_size_type c) noexcept
| Constructor. Do not call this yourself; libpqxx will do it for you.
| field () noexcept=default
| Constructor. Do not call this yourself; libpqxx will do it for you.
template<>
bool | to (char const *&obj) const
| Specialization: `to(char const *&)`.
template<>
bool | to (zview &obj) const
template<>
bool | to (zview &obj, zview const &default_value) const
template<>
zview | as () const
template<>
zview | as (zview const &default_value) const
PQXX_PURE bool | operator== (field const &) const noexcept
| Byte-by-byte comparison of two fields (all nulls are considered equal)
PQXX_PURE bool | operator!= (field const &rhs) const noexcept
| Byte-by-byte comparison (all nulls are considered equal)
PQXX_PURE char const * | name () const &
| Column name.
oid PQXX_PURE | type () const
| Column type.
PQXX_PURE oid | table () const
| What table did this column come from?
PQXX_PURE constexpr row_size_type | num () const noexcept
| Return row number. The first row is row 0, the second is row 1, etc.
PQXX_PURE row_size_type | table_column () const
| What column number in its originating table did this column come from?
PQXX_PURE std::string_view | view () const &
| Read as `string_view`, or an empty one if null.
PQXX_PURE char const * | c_str () const &
| Read as plain C string.
PQXX_PURE bool | is_null () const noexcept
| Is this field's value null?
PQXX_PURE size_type | size () const noexcept
| Return number of bytes taken up by the field's value.
template<typename T >
auto | to (T &obj) const -> typename std::enable_if_t<(not std::is_pointer< T >::value or std::is_same< T, char const * >::value), bool >
| Read value into obj; or if null, leave obj untouched and return `false`.
template<typename... T>
bool | composite_to (T &...fields) const
| Read field as a composite value, write its components into `fields`.
template<typename T >
bool | operator>> (T &obj) const
| Read value into obj; or leave obj untouched and return `false` if null.
template<typename T >
auto | to (T &obj, T const &default_value) const -> typename std::enable_if_t<(not std::is_pointer< T >::value or std::is_same< T, char const * >::value), bool >
| Read value into obj; or if null, use default value and return `false`.
template<typename T >
T | as (T const &default_value) const
| Return value as object of given type, or default value if null.
template<typename T >
T | as () const
| Return value as object of given type, or throw exception if null.
template<typename T , template< typename > class O = std::optional>
constexpr O< T > | get () const
| Return value wrapped in some optional type (empty for nulls).
array_parser | as_array () const &noexcept
| Parse the field as an SQL array.

## Arithmetic operators

const_row_iterator | operator+ (difference_type) const noexcept
const_row_iterator | operator- (difference_type) const noexcept
difference_type | operator- (const_row_iterator const &) const noexcept
const_row_iterator | operator+ (difference_type, const_row_iterator const &) noexcept

## Additional Inherited Members

Protected Member Functions inherited from pqxx::field
constexpr result const & | home () const noexcept
constexpr result::size_type | idx () const noexcept
constexpr row_size_type | col () const noexcept
| field (result const &r, result_size_type row_num, row_size_type col_num) noexcept
Protected Attributes inherited from pqxx::field
row_size_type | m_col

## Detailed Description

Iterator for fields in a row. Use as row::const_iterator.

## Member Typedef Documentation

## difference_type

using pqxx::const_row_iterator::difference_type = row_difference_type

## iterator_category

using pqxx::const_row_iterator::iterator_category = std::random_access_iterator_tag

## pointer

using pqxx::const_row_iterator::pointer = field const *

## reference

using pqxx::const_row_iterator::reference = field

## size_type

using pqxx::const_row_iterator::size_type = row_size_type

## value_type

using pqxx::const_row_iterator::value_type = field const

## Constructor & Destructor Documentation

## const_row_iterator() [1/5]

pqxx::const_row_iterator::const_row_iterator | ( |  | ) |

default noexcept

## const_row_iterator() [2/5]

pqxx::const_row_iterator::const_row_iterator | ( | row const & | t,
|  | row_size_type | c
| ) |  |

noexcept

## const_row_iterator() [3/5]

pqxx::const_row_iterator::const_row_iterator | ( | field const & | F | ) |

noexcept

## const_row_iterator() [4/5]

pqxx::const_row_iterator::const_row_iterator | ( | const_row_iterator const & |  | ) |

default noexcept

## const_row_iterator() [5/5]

pqxx::const_row_iterator::const_row_iterator | ( | const_row_iterator && |  | ) |

default noexcept

## Member Function Documentation

## operator!=()

constexpr bool pqxx::const_row_iterator::operator!= | ( | const_row_iterator const & | i | ) | const

constexpr noexcept

## operator*()

reference pqxx::const_row_iterator::operator* | ( |  | ) | const

noexcept

## operator+()

const_row_iterator pqxx::const_row_iterator::operator+ | ( | difference_type | o | ) | const

noexcept

## operator++() [1/2]

const_row_iterator & pqxx::const_row_iterator::operator++ | ( |  | ) |

noexcept

## operator++() [2/2]

pqxx::const_row_iterator pqxx::const_row_iterator::operator++ | ( | int |  | ) |

noexcept

## operator+=()

const_row_iterator & pqxx::const_row_iterator::operator+= | ( | difference_type | i | ) |

noexcept

## operator-() [1/2]

const_row_iterator::difference_type pqxx::const_row_iterator::operator- | ( | const_row_iterator const & | i | ) | const

noexcept

## operator-() [2/2]

const_row_iterator pqxx::const_row_iterator::operator- | ( | difference_type | o | ) | const

noexcept

## operator--() [1/2]

const_row_iterator & pqxx::const_row_iterator::operator-- | ( |  | ) |

noexcept

## operator--() [2/2]

pqxx::const_row_iterator pqxx::const_row_iterator::operator-- | ( | int |  | ) |

noexcept

## operator-=()

const_row_iterator & pqxx::const_row_iterator::operator-= | ( | difference_type | i | ) |

noexcept

## operator->()

constexpr pointer pqxx::const_row_iterator::operator-> | ( |  | ) | const

constexpr noexcept

## operator<()

constexpr bool pqxx::const_row_iterator::operator< | ( | const_row_iterator const & | i | ) | const

constexpr noexcept

## operator<=()

constexpr bool pqxx::const_row_iterator::operator<= | ( | const_row_iterator const & | i | ) | const

constexpr noexcept

## operator=() [1/2]

const_row_iterator & pqxx::const_row_iterator::operator= | ( | const_row_iterator && |  | ) |

default noexcept

## operator=() [2/2]

const_row_iterator & pqxx::const_row_iterator::operator= | ( | const_row_iterator const & |  | ) |

default noexcept

## operator==()

constexpr bool pqxx::const_row_iterator::operator== | ( | const_row_iterator const & | i | ) | const

constexpr noexcept

## operator>()

constexpr bool pqxx::const_row_iterator::operator> | ( | const_row_iterator const & | i | ) | const

constexpr noexcept

## operator>=()

constexpr bool pqxx::const_row_iterator::operator>= | ( | const_row_iterator const & | i | ) | const

constexpr noexcept

## Friends And Related Symbol Documentation

## operator+

const_row_iterator operator+ | ( | const_row_iterator::difference_type | o,
|  | const_row_iterator const & | i
| ) |  |

friend

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

- row.hxx
- row.cxx