#include <ozo/result.h>
Database raw result representation.
This class provides access to the raw representation of a database request result. It models range of rows. Each row can be accessed via index or iterator.
T | — underlying native result handler type, in common case ozo::pg::result . |
Types | |
using | const_iterator = < implementation defined > |
using | iterator = const_iterator |
Public Member Functions | |
const_iterator | begin () const noexcept |
const_iterator | end () const noexcept |
std::size_t | size () const noexcept |
bool | empty () const noexcept |
row | operator[] (int i) const noexcept |
row | at (int i) const |
native_handle_type | native_handle () const noexcept |
bool | valid () const noexcept |
handle_type | release () noexcept(std::is_nothrow_move_constructible_v< handle_type >) |
using ozo::basic_result< T >::const_iterator = <implementation defined> |
Constant iterator on row in the result.
Random access iterator. Provides access to a ozo::row
object. Since ozo::basic_result
provides read-only access to a database request result, all the iterators provide a read-only access to a ozo::row
object.
using ozo::basic_result< T >::iterator = const_iterator |
Iterator on value in the row, alias on iterator
class.
row ozo::basic_result< T >::at | ( | int | i | ) | const |
Get row by index with range check.
If index in not range [0, size())
throws std::out_of_range
.
index | — index of a row. |
ozo::row
— proxy object to a row. References ozo::basic_result< T >::size().
|
noexcept |
Iterator on the first row of the result.
References ozo::basic_result< T >::native_handle().
Referenced by ozo::basic_result< T >::end(), and ozo::basic_result< T >::operator[]().
|
noexcept |
|
noexcept |
Iterator on end of row sequence.
References ozo::basic_result< T >::begin(), and ozo::basic_result< T >::size().
|
noexcept |
Get the native libpq
handle representation.
This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided.
Referenced by ozo::basic_result< T >::begin(), and ozo::basic_result< T >::size().
|
noexcept |
Get row by index.
Valid index is in range [0, size())
. No index-in-range check is performing.
index | — index of a row. |
ozo::row
— proxy object to a row. References ozo::basic_result< T >::begin().
|
noexcept |
Releases ownership of the native connection handle object.
This function may be used to obtain the underlying result handle. After calling this function, valid()
returns false.
|
noexcept |
Get count of rows.
std::size_t
— count of rows. References ozo::basic_result< T >::native_handle().
Referenced by ozo::basic_result< T >::at(), ozo::basic_result< T >::empty(), and ozo::basic_result< T >::end().
|
noexcept |
Checks if object contains result handle.