libpqxx 4.0
|
Iterator for rows (tuples) in a result. Use as result::const_iterator. More...
#include <result.hxx>
Iterator for rows (tuples) in a result. Use as result::const_iterator.
A result, once obtained, cannot be modified. Therefore there is no plain iterator type for result. However its const_iterator type can be used to inspect its tuples without changing them.
Reimplemented from pqxx::tuple.
typedef const tuple* pqxx::const_result_iterator::pointer |
Reimplemented from pqxx::tuple.
Reimplemented from pqxx::tuple.
Reimplemented from pqxx::tuple.
pqxx::const_result_iterator::const_result_iterator | ( | ) | throw () |
pqxx::const_result_iterator::const_result_iterator | ( | const tuple & | t | ) | throw () |
bool pqxx::const_result_iterator::operator!= | ( | const const_result_iterator & | i | ) | const |
reference pqxx::const_result_iterator::operator* | ( | ) | const |
const_result_iterator pqxx::const_result_iterator::operator+ | ( | result::difference_type | o | ) | const |
Reimplemented in pqxx::const_reverse_result_iterator.
const_result_iterator& pqxx::const_result_iterator::operator++ | ( | ) |
Reimplemented in pqxx::const_reverse_result_iterator.
pqxx::const_result_iterator pqxx::const_result_iterator::operator++ | ( | int | ) |
Reimplemented in pqxx::const_reverse_result_iterator.
const_result_iterator& pqxx::const_result_iterator::operator+= | ( | difference_type | i | ) |
Reimplemented in pqxx::const_reverse_result_iterator.
const_result_iterator pqxx::const_result_iterator::operator- | ( | result::difference_type | o | ) | const |
result::difference_type pqxx::const_result_iterator::operator- | ( | const_result_iterator | i | ) | const |
References pqxx::tuple::num().
pqxx::const_result_iterator pqxx::const_result_iterator::operator-- | ( | int | ) |
Reimplemented in pqxx::const_reverse_result_iterator.
const_result_iterator& pqxx::const_result_iterator::operator-- | ( | ) |
Reimplemented in pqxx::const_reverse_result_iterator.
const_result_iterator& pqxx::const_result_iterator::operator-= | ( | difference_type | i | ) |
Reimplemented in pqxx::const_reverse_result_iterator.
pointer pqxx::const_result_iterator::operator-> | ( | ) | const |
The iterator "points to" its own tuple, which is also itself. This allows a result to be addressed as a two-dimensional container without going through the intermediate step of dereferencing the iterator. I hope this works out to be similar to C pointer/array semantics in useful cases.
IIRC Alex Stepanov, the inventor of the STL, once remarked that having this as standard behaviour for pointers would be useful in some algorithms. So even if this makes me look foolish, I would seem to be in distinguished company.
bool pqxx::const_result_iterator::operator< | ( | const const_result_iterator & | i | ) | const |
bool pqxx::const_result_iterator::operator<= | ( | const const_result_iterator & | i | ) | const |
bool pqxx::const_result_iterator::operator== | ( | const const_result_iterator & | i | ) | const |
bool pqxx::const_result_iterator::operator> | ( | const const_result_iterator & | i | ) | const |
bool pqxx::const_result_iterator::operator>= | ( | const const_result_iterator & | i | ) | const |
const_result_iterator operator+ | ( | result::difference_type | o, |
const_result_iterator | i | ||
) | [friend] |
friend class pqxx::result [friend] |