pg_async
|
#include <resultset.hpp>
Classes | |
class | const_field_iterator |
class | const_row_iterator |
class | field |
class | row |
Public Types | |
typedef std::shared_ptr < detail::result_impl > | result_impl_ptr |
Size types definitions | |
typedef uinteger | size_type |
typedef integer | difference_type |
Row container concept | |
typedef const_row_iterator | const_iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
typedef row | value_type |
typedef const value_type | reference |
typedef const_iterator | pointer |
Field iterators | |
typedef std::reverse_iterator < const_field_iterator > | const_reverse_field_iterator |
Public Member Functions | |
resultset () | |
Construct an empty resultset. More... | |
resultset (result_impl_ptr) | |
Constructs a resultset with the pointer to internal implementation Used internally by the library. More... | |
Row-wise container interface | |
size_type | size () const |
bool | empty () const |
const_iterator | begin () const |
const_iterator | end () const |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
reference | front () const |
reference | back () const |
reference | operator[] (size_type index) const |
reference | at (size_type index) const |
Result checking | |
operator bool () const | |
bool | operator! () const |
Column-related interface | |
size_type | columns_size () const |
row_description_type const & | row_description () const |
size_type | index_of_name (std::string const &name) const |
field_description const & | field (size_type col_index) const |
field_description const & | field (std::string const &name) const |
std::string const & | field_name (size_type col_index) const |
Static Public Attributes | |
static const size_type | npos |
Not-a-position constant. More... | |
Friends | |
class | row |
class | field |
Result set. Provide access to rows via indexing operators (random access) and bidirectional iteration access via iterators. Access to field definitions.
Definition at line 56 of file resultset.hpp.
Definition at line 73 of file resultset.hpp.
typedef std::reverse_iterator<const_field_iterator> tip::db::pg::resultset::const_reverse_field_iterator |
Definition at line 83 of file resultset.hpp.
typedef std::reverse_iterator< const_iterator > tip::db::pg::resultset::const_reverse_iterator |
Definition at line 74 of file resultset.hpp.
Definition at line 61 of file resultset.hpp.
Definition at line 78 of file resultset.hpp.
typedef const value_type tip::db::pg::resultset::reference |
Definition at line 77 of file resultset.hpp.
typedef std::shared_ptr<detail::result_impl> tip::db::pg::resultset::result_impl_ptr |
Shared pointer to internal implementation
Definition at line 66 of file resultset.hpp.
Definition at line 60 of file resultset.hpp.
Definition at line 76 of file resultset.hpp.
tip::db::pg::resultset::resultset | ( | ) |
Construct an empty resultset.
tip::db::pg::resultset::resultset | ( | result_impl_ptr | ) |
Constructs a resultset with the pointer to internal implementation Used internally by the library.
Shared | pointer to result set |
Assess a row by index (range checking) In case of index out-of-range will throw an exception
index | index of the row |
row
object reference tip::db::pg::resultset::back | ( | ) | const |
Get the last row in the result set. Will raise an assertion if the result set is empty.
const_iterator tip::db::pg::resultset::begin | ( | ) | const |
Iterator to the beginning of rows sequence
size_type tip::db::pg::resultset::columns_size | ( | ) | const |
Column count
bool tip::db::pg::resultset::empty | ( | ) | const |
Is the result set empty
const_iterator tip::db::pg::resultset::end | ( | ) | const |
Iterator past the end of rows sequence.
field_description const& tip::db::pg::resultset::field | ( | size_type | col_index | ) | const |
Get the field description of field by it's index.
col_index | field index, must be in range of [0..columns_size) |
out_of_range | exception |
field_description const& tip::db::pg::resultset::field | ( | std::string const & | name | ) | const |
Get the field description of field by it's name.
name | name of the field. must be present in the result set. |
out_of_range | exception |
std::string const& tip::db::pg::resultset::field_name | ( | size_type | col_index | ) | const |
Get the name of field by it's index
col_index | field index, must be in range of [0..columns_size) |
out_of_range | exception |
reference tip::db::pg::resultset::front | ( | ) | const |
Get the first row in the result set. Will raise an assertion if the result set is empty.
size_type tip::db::pg::resultset::index_of_name | ( | std::string const & | name | ) | const |
Get the index of field with name
name | the field name |
|
inline |
Syntactic sugar operator for checking the result set
Definition at line 165 of file resultset.hpp.
|
inline |
Syntactic sugar operator for checking the result set
Definition at line 181 of file resultset.hpp.
Access a row by index. In case of index out-of-range situation will rase an assertion
index | index of the row |
row
object const_reverse_iterator tip::db::pg::resultset::rbegin | ( | ) | const |
Iterator to the beginning of rows sequence in reverse order
const_reverse_iterator tip::db::pg::resultset::rend | ( | ) | const |
Iterator past the end of of rows sequence in reverse order
row_description_type const& tip::db::pg::resultset::row_description | ( | ) | const |
size_type tip::db::pg::resultset::size | ( | ) | const |
Number of rows
|
friend |
Definition at line 693 of file resultset.hpp.
|
friend |
Definition at line 692 of file resultset.hpp.
|
static |
Not-a-position constant.
Definition at line 90 of file resultset.hpp.