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

Reverse iterator for a tuple. Use as tuple::const_reverse_iterator. More...

#include <tuple.hxx>

Inheritance diagram for pqxx::const_reverse_tuple_iterator:
Collaboration diagram for pqxx::const_reverse_tuple_iterator:

Public Types

typedef tuple::difference_type difference_type
 
typedef const_tuple_iterator iterator_type
 
typedef field reference
 
typedef const_tuple_iterator super
 

Public Member Functions

 const_reverse_tuple_iterator (const const_reverse_tuple_iterator &r)
 
 const_reverse_tuple_iterator (const super &rhs) throw ()
 
iterator_type PQXX_PURE base () const throw ()
 
Manipulations
const_reverse_tuple_iteratoroperator= (const const_reverse_tuple_iterator &r)
 
const_reverse_tuple_iterator operator++ ()
 
const_reverse_tuple_iterator operator++ (int)
 
const_reverse_tuple_iteratoroperator-- ()
 
const_reverse_tuple_iterator operator-- (int)
 
const_reverse_tuple_iteratoroperator+= (difference_type i)
 
const_reverse_tuple_iteratoroperator-= (difference_type i)
 
Arithmetic operators
const_reverse_tuple_iterator operator+ (difference_type i) const
 
const_reverse_tuple_iterator operator- (difference_type i)
 
difference_type operator- (const const_reverse_tuple_iterator &rhs) const
 
Comparisons
bool operator== (const const_reverse_tuple_iterator &rhs) const throw ()
 
bool operator!= (const const_reverse_tuple_iterator &rhs) const throw ()
 
bool operator< (const const_reverse_tuple_iterator &rhs) const
 
bool operator<= (const const_reverse_tuple_iterator &rhs) const
 
bool operator> (const const_reverse_tuple_iterator &rhs) const
 
bool operator>= (const const_reverse_tuple_iterator &rhs) const
 

Private Types

typedef tuple::size_type size_type
 

Private Member Functions

tuple_size_type col () const throw ()
 
const resulthome () const throw ()
 
size_t idx () const throw ()
 
template<>
bool to (const char *&Obj) const
 Specialization: to(const char *&). More...
 
Dereferencing operators
pointer operator-> () const
 
reference operator* () const
 
Comparisons
bool operator== (const const_tuple_iterator &i) const
 
bool operator!= (const const_tuple_iterator &i) const
 
bool operator< (const const_tuple_iterator &i) const
 
bool operator<= (const const_tuple_iterator &i) const
 
bool operator> (const const_tuple_iterator &i) const
 
bool operator>= (const const_tuple_iterator &i) const
 
Comparison
bool operator== (const field &) const
 Byte-by-byte comparison of two fields (all nulls are considered equal) More...
 
bool operator!= (const field &rhs) const
 Byte-by-byte comparison (all nulls are considered equal) More...
 
Arithmetic operators
const_tuple_iterator operator- (difference_type) const
 
difference_type operator- (const_tuple_iterator) const
 
Column information
const char * name () const
 Column name. More...
 
oid type () const
 Column type. More...
 
oid table () const
 What table did this column come from? More...
 
tuple_size_type num () const
 
tuple_size_type table_column () const
 What column number in its originating table did this column come from? More...
 
Content access
const char * c_str () const
 Read as plain C string. More...
 
template<typename T >
bool to (T &Obj) const
 Read value into Obj; or leave Obj untouched and return false if null. More...
 
template<typename T >
bool to (T &Obj, const T &Default) const
 Read value into Obj; or use Default & return false if null. More...
 
template<typename T >
bool operator>> (T &Obj) const
 Read value into Obj; or leave Obj untouched and return false if null. More...
 
template<typename T >
as (const T &Default) const
 Return value as object of given type, or Default if null. More...
 
template<typename T >
as () const
 Return value as object of given type, or throw exception if null. More...
 
bool is_null () const throw ()
 
size_type size () const throw ()
 

Private Attributes

tuple_size_type m_col
 

Detailed Description

Reverse iterator for a tuple. Use as tuple::const_reverse_iterator.

Member Typedef Documentation

Constructor & Destructor Documentation

pqxx::const_reverse_tuple_iterator::const_reverse_tuple_iterator ( const const_reverse_tuple_iterator r)
inline
pqxx::const_reverse_tuple_iterator::const_reverse_tuple_iterator ( const super rhs) throw ()
inlineexplicit

Member Function Documentation

template<typename T >
T pqxx::field::as ( const T &  Default) const
inlineinherited

Return value as object of given type, or Default if null.

Note that unless the function is instantiated with an explicit template argument, the Default value's type also determines the result type.

template<typename T >
T pqxx::field::as ( ) const
inlineinherited

Return value as object of given type, or throw exception if null.

iterator_type PQXX_PURE pqxx::const_reverse_tuple_iterator::base ( ) const throw ()
const char* pqxx::field::c_str ( ) const
inherited

Read as plain C string.

Since the field's data is stored internally in the form of a zero-terminated C string, this is the fastest way to read it. Use the to() or as() functions to convert the string to other types such as int, or to C++ strings.

Referenced by pqxx::from_string(), pqxx::field_streambuf< CHAR, TRAITS >::initialize(), pqxx::operator<<(), and pqxx::to_string().

Here is the caller graph for this function:

tuple_size_type pqxx::field::col ( ) const throw ()
inlineprotectedinherited
const result* pqxx::field::home ( ) const throw ()
inlineprotectedinherited
size_t pqxx::field::idx ( ) const throw ()
inlineprotectedinherited
bool pqxx::field::is_null ( ) const throw ()
inherited
const char* pqxx::field::name ( ) const
inherited

Column name.

tuple_size_type pqxx::field::num ( ) const
inlineinherited

Referenced by pqxx::const_tuple_iterator::operator-().

Here is the caller graph for this function:

bool pqxx::field::operator!= ( const field rhs) const
inlineinherited

Byte-by-byte comparison (all nulls are considered equal)

Warning
See operator==() for important information about this operator
bool pqxx::const_tuple_iterator::operator!= ( const const_tuple_iterator i) const
inlineinherited
bool pqxx::const_reverse_tuple_iterator::operator!= ( const const_reverse_tuple_iterator rhs) const throw ()
inline
reference pqxx::const_tuple_iterator::operator* ( ) const
inlineinherited
const_reverse_tuple_iterator pqxx::const_reverse_tuple_iterator::operator+ ( difference_type  i) const
inline
const_reverse_tuple_iterator pqxx::const_reverse_tuple_iterator::operator++ ( )
inline
const_reverse_tuple_iterator pqxx::const_reverse_tuple_iterator::operator++ ( int  )
const_reverse_tuple_iterator& pqxx::const_reverse_tuple_iterator::operator+= ( difference_type  i)
inline
const_tuple_iterator pqxx::const_tuple_iterator::operator- ( difference_type  o) const
inlineinherited
const_tuple_iterator::difference_type pqxx::const_tuple_iterator::operator- ( const_tuple_iterator  i) const
inlineinherited

References pqxx::field::num().

Here is the call graph for this function:

const_reverse_tuple_iterator pqxx::const_reverse_tuple_iterator::operator- ( difference_type  i)
inline
difference_type pqxx::const_reverse_tuple_iterator::operator- ( const const_reverse_tuple_iterator rhs) const
inline
const_reverse_tuple_iterator& pqxx::const_reverse_tuple_iterator::operator-- ( )
inline
const_reverse_tuple_iterator pqxx::const_reverse_tuple_iterator::operator-- ( int  )
const_reverse_tuple_iterator& pqxx::const_reverse_tuple_iterator::operator-= ( difference_type  i)
inline
pointer pqxx::const_tuple_iterator::operator-> ( ) const
inlineinherited
bool pqxx::const_tuple_iterator::operator< ( const const_tuple_iterator i) const
inlineinherited
bool pqxx::const_reverse_tuple_iterator::operator< ( const const_reverse_tuple_iterator rhs) const
inline
bool pqxx::const_tuple_iterator::operator<= ( const const_tuple_iterator i) const
inlineinherited
bool pqxx::const_reverse_tuple_iterator::operator<= ( const const_reverse_tuple_iterator rhs) const
inline
const_reverse_tuple_iterator& pqxx::const_reverse_tuple_iterator::operator= ( const const_reverse_tuple_iterator r)
inline
bool pqxx::field::operator== ( const field ) const
inherited

Byte-by-byte comparison of two fields (all nulls are considered equal)

Warning
null handling is still open to discussion and change!

Handling of null values differs from that in SQL where a comparison involving a null value yields null, so nulls are never considered equal to one another or even to themselves.

Null handling also probably differs from the closest equivalent in C++, which is the NaN (Not-a-Number) value, a singularity comparable to SQL's null. This is because the builtin == operator demands that a == a.

The usefulness of this operator is questionable. No interpretation whatsoever is imposed on the data; 0 and 0.0 are considered different, as are null vs. the empty string, or even different (but possibly equivalent and equally valid) encodings of the same Unicode character etc.

bool pqxx::const_tuple_iterator::operator== ( const const_tuple_iterator i) const
inlineinherited
bool pqxx::const_reverse_tuple_iterator::operator== ( const const_reverse_tuple_iterator rhs) const throw ()
inline
bool pqxx::const_tuple_iterator::operator> ( const const_tuple_iterator i) const
inlineinherited
bool pqxx::const_reverse_tuple_iterator::operator> ( const const_reverse_tuple_iterator rhs) const
inline
bool pqxx::const_tuple_iterator::operator>= ( const const_tuple_iterator i) const
inlineinherited
bool pqxx::const_reverse_tuple_iterator::operator>= ( const const_reverse_tuple_iterator rhs) const
inline
template<typename T >
bool pqxx::field::operator>> ( T &  Obj) const
inlineinherited

Read value into Obj; or leave Obj untouched and return false if null.

size_type pqxx::field::size ( ) const throw ()
inherited

Referenced by pqxx::from_string(), pqxx::field_streambuf< CHAR, TRAITS >::initialize(), pqxx::operator<<(), and pqxx::to_string().

Here is the caller graph for this function:

oid pqxx::field::table ( ) const
inherited

What table did this column come from?

tuple_size_type pqxx::field::table_column ( ) const
inherited

What column number in its originating table did this column come from?

template<typename T >
bool pqxx::field::to ( T &  Obj) const
inlineinherited

Read value into Obj; or leave Obj untouched and return false if null.

References pqxx::from_string().

Here is the call graph for this function:

template<typename T >
bool pqxx::field::to ( T &  Obj,
const T &  Default 
) const
inlineinherited

Read value into Obj; or use Default & return false if null.

template<>
bool pqxx::field::to ( const char *&  Obj) const
inlineinherited

Specialization: to(const char *&).

The buffer has the same lifetime as the data in this result (i.e. of this result object, or the last remaining one copied from it etc.), so take care not to use it after the last result object referring to this query result is destroyed.

oid pqxx::field::type ( ) const
inherited

Column type.

Member Data Documentation

tuple_size_type pqxx::field::m_col
protectedinherited

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