pqxx::row Class Reference

Reference to one row in a result. More...

#include <row.hxx>

Inheritance diagram for pqxx::row:
pqxx::const_result_iterator pqxx::const_reverse_result_iterator

List of all members.

Public Types

typedef row_size_type size_type
typedef row_difference_type difference_type
typedef const_row_iterator const_iterator
typedef const_iterator iterator
typedef field reference
typedef const_row_iterator pointer
typedef const_reverse_row_iterator const_reverse_iterator
typedef const_reverse_iterator reverse_iterator

Public Member Functions

 row (const result *r, size_t i) PQXX_NOEXCEPT
 ~row () PQXX_NOEXCEPT
const_iterator begin () const PQXX_NOEXCEPT
const_iterator cbegin () const PQXX_NOEXCEPT
const_iterator end () const PQXX_NOEXCEPT
const_iterator cend () const PQXX_NOEXCEPT
size_type size () const PQXX_NOEXCEPT
void swap (row &) PQXX_NOEXCEPT
size_t rownumber () const PQXX_NOEXCEPT
size_t num () const
row slice (size_type Begin, size_type End) const
PQXX_PURE bool empty () const PQXX_NOEXCEPT
Comparison



PQXX_PURE bool operator== (const row &) const PQXX_NOEXCEPT
bool operator!= (const row &rhs) const PQXX_NOEXCEPT
Field access



reference front () const PQXX_NOEXCEPT
reference back () const PQXX_NOEXCEPT
const_reverse_row_iterator rbegin () const
const_reverse_row_iterator crbegin () const
const_reverse_row_iterator rend () const
const_reverse_row_iterator crend () const
reference operator[] (size_type) const PQXX_NOEXCEPT
reference operator[] (int) const PQXX_NOEXCEPT
reference operator[] (const char[]) const
reference operator[] (const std::string &) const
reference at (size_type) const
reference at (int) const
reference at (const char[]) const
reference at (const std::string &) const
Column information



size_type column_number (const std::string &ColName) const
 Number of given column (throws exception if it doesn't exist).
size_type column_number (const char[]) const
 Number of given column (throws exception if it doesn't exist).
oid column_type (size_type) const
 Type of given column.
oid column_type (int ColNum) const
 Type of given column.
oid column_type (const std::string &ColName) const
 Type of given column.
oid column_type (const char ColName[]) const
 Type of given column.
oid column_table (size_type ColNum) const
 What table did this column come from?
oid column_table (int ColNum) const
 What table did this column come from?
oid column_table (const std::string &ColName) const
 What table did this column come from?
size_type table_column (size_type) const
 What column number in its table did this result column come from?
size_type table_column (int ColNum) const
 What column number in its table did this result column come from?
size_type table_column (const std::string &ColName) const
 What column number in its table did this result column come from?

Protected Attributes

const resultm_Home
size_t m_Index
size_type m_Begin
size_type m_End

Friends

class field

Detailed Description

Reference to one row in a result.

A row represents one row (also called a row) in a query result set. It also acts as a container mapping column numbers or names to field values (see below):

        cout << row["date"].c_str() << ": " << row["name"].c_str() << endl;

The row itself acts like a (non-modifyable) container, complete with its own const_iterator and const_reverse_iterator.


Member Typedef Documentation

Reimplemented in pqxx::const_result_iterator.

Reimplemented in pqxx::const_result_iterator.

Reimplemented in pqxx::const_result_iterator.

Reimplemented in pqxx::const_result_iterator.


Constructor & Destructor Documentation

pqxx::row::row ( const result r,
size_t  i 
)
Deprecated:
Do not use this constructor. It will become private.

References row().

Referenced by row().

pqxx::row::~row (  ) 

Member Function Documentation

pqxx::row::reference pqxx::row::at ( const std::string &  s  )  const

Address field by name.

Warning:
This is much slower than indexing by number, or iterating.

References at().

pqxx::field pqxx::row::at ( const char  f[]  )  const

Address field by name.

Warning:
This is much slower than indexing by number, or iterating.

References column_number(), field, and m_Begin.

pqxx::row::reference pqxx::row::at ( int  i  )  const

References at().

pqxx::field pqxx::row::at ( size_type  i  )  const

References operator[](), and size().

Referenced by at(), and operator[]().

pqxx::row::reference pqxx::row::back (  )  const

References field, and m_End.

pqxx::row::const_iterator pqxx::row::begin (  )  const

References m_Begin.

Referenced by cbegin(), and rend().

pqxx::row::const_iterator pqxx::row::cbegin (  )  const

References begin().

pqxx::row::const_iterator pqxx::row::cend (  )  const

References end().

pqxx::row::size_type pqxx::row::column_number ( const char  ColName[]  )  const

Number of given column (throws exception if it doesn't exist).

References pqxx::result::column_name(), pqxx::result::column_number(), m_Begin, m_End, and m_Home.

size_type pqxx::row::column_number ( const std::string &  ColName  )  const

Number of given column (throws exception if it doesn't exist).

References column_number().

Referenced by at(), and column_number().

oid pqxx::row::column_table ( const std::string &  ColName  )  const

What table did this column come from?

References column_table().

Referenced by column_table().

oid pqxx::row::column_table ( int  ColNum  )  const

What table did this column come from?

References column_table().

Referenced by column_table().

pqxx::oid pqxx::row::column_table ( size_type  ColNum  )  const

What table did this column come from?

References pqxx::result::column_table(), m_Begin, and m_Home.

oid pqxx::row::column_type ( const char  ColName[]  )  const

Type of given column.

References column_type().

Referenced by column_type().

oid pqxx::row::column_type ( const std::string &  ColName  )  const

Type of given column.

References column_type().

Referenced by column_type().

oid pqxx::row::column_type ( int  ColNum  )  const

Type of given column.

References column_type().

Referenced by column_type().

pqxx::oid pqxx::row::column_type ( size_type  ColNum  )  const

Type of given column.

References pqxx::result::column_type(), m_Begin, and m_Home.

pqxx::row::const_reverse_iterator pqxx::row::crbegin (  )  const

References rbegin().

pqxx::row::const_reverse_iterator pqxx::row::crend (  )  const

References rend().

bool pqxx::row::empty (  )  const

References m_Begin, and m_End.

pqxx::row::const_iterator pqxx::row::end (  )  const

References m_End.

Referenced by cend(), and rbegin().

pqxx::row::reference pqxx::row::front (  )  const

References field, and m_Begin.

size_t pqxx::row::num (  )  const
bool pqxx::row::operator!= ( const row rhs  )  const
bool pqxx::row::operator== ( const row rhs  )  const
pqxx::row::reference pqxx::row::operator[] ( const std::string &  s  )  const

Address field by name.

Warning:
This is much slower than indexing by number, or iterating.

References operator[]().

pqxx::row::reference pqxx::row::operator[] ( const char  f[]  )  const

Address field by name.

Warning:
This is much slower than indexing by number, or iterating.

References at().

pqxx::row::reference pqxx::row::operator[] ( int  i  )  const
pqxx::row::reference pqxx::row::operator[] ( size_type  i  )  const

Referenced by at(), and operator[]().

pqxx::row::const_reverse_iterator pqxx::row::rbegin (  )  const

References end().

Referenced by crbegin().

pqxx::row::const_reverse_iterator pqxx::row::rend (  )  const

References begin().

Referenced by crend().

size_t pqxx::row::rownumber (  )  const
size_type pqxx::row::size (  )  const

Referenced by at(), and slice().

pqxx::row pqxx::row::slice ( size_type  Begin,
size_type  End 
) const

Produce a slice of this row, containing the given range of columns.

The slice runs from the range's starting column to the range's end column, exclusive. It looks just like a normal result row, except slices can be empty.

Warning:
Slicing is a relatively new feature, and not all software may be prepared to deal with empty slices. If there is any chance that your program might be creating empty slices and passing them to code that may not be designed with the possibility of empty rows in mind, be sure to test for that case.

References m_Begin, m_End, and size().

void pqxx::row::swap ( row rhs  ) 
size_type pqxx::row::table_column ( const std::string &  ColName  )  const

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

References table_column().

Referenced by table_column().

size_type pqxx::row::table_column ( int  ColNum  )  const

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

References table_column().

Referenced by table_column().

pqxx::row::size_type pqxx::row::table_column ( size_type  ColNum  )  const

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

A meaningful answer can be given only if the column in question comes directly from a column in a table. If the column is computed in any other way, a logic_error will be thrown.

Parameters:
ColNum a zero-based column number in this result set
Returns:
a zero-based column number in originating table

References m_Begin, m_Home, and pqxx::result::table_column().


Friends And Related Function Documentation

friend class field [friend]

Referenced by at(), back(), and front().


Member Data Documentation

Referenced by back(), column_number(), empty(), end(), and slice().

const result* pqxx::row::m_Home [protected]
size_t pqxx::row::m_Index [protected]

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

Generated on 17 Mar 2017 for libpqxx by  doxygen 1.6.1