One result row: ordered NamedValues with lookup by column name. More...
#include <StormByte/database/row.hxx>
Public Types | |
| using | value_type = NamedValue |
| Column value type. | |
| using | size_type = StormByte::Size |
| Column count and index type. | |
| using | reference = NamedValue & |
| Mutable column reference. | |
| using | const_reference = const NamedValue & |
| Read-only column reference. | |
| using | pointer = NamedValue * |
| Mutable column pointer. | |
| using | const_pointer = const NamedValue * |
| Read-only column pointer. | |
| using | iterator = pointer |
| Mutable pointer iterator. | |
| using | const_iterator = const_pointer |
| Read-only pointer iterator. | |
| using | reverse_iterator = std::reverse_iterator< iterator > |
| Mutable reverse iterator. | |
| using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
| Read-only reverse iterator. | |
Public Member Functions | |
| Row () noexcept | |
| Default constructor. | |
| Row (const Row &other) | |
| Copy constructor. | |
| Row (Row &&other) noexcept | |
| Move constructor. | |
| ~Row () noexcept | |
| Destructor. | |
| Row & | operator= (const Row &other) |
| Copy assignment. | |
| Row & | operator= (Row &&other) noexcept |
| Move assignment. | |
| bool | operator== (const Row &other) const |
| Equality of the ordered columns. | |
| bool | operator!= (const Row &other) const |
| Inequality of the ordered columns. | |
| iterator | begin () noexcept |
| Mutable begin pointer. | |
| const_iterator | begin () const noexcept |
| Read-only begin pointer. | |
| iterator | end () noexcept |
| Mutable end pointer. | |
| const_iterator | end () const noexcept |
| Read-only end pointer. | |
| const_iterator | cbegin () const noexcept |
| Read-only begin pointer. | |
| const_iterator | cend () const noexcept |
| Read-only end pointer. | |
| reverse_iterator | rbegin () noexcept |
| Mutable reverse begin. | |
| reverse_iterator | rend () noexcept |
| Mutable reverse end. | |
| const_reverse_iterator | rbegin () const noexcept |
| Read-only reverse begin. | |
| const_reverse_iterator | rend () const noexcept |
| Read-only reverse end. | |
| const_reverse_iterator | crbegin () const noexcept |
| Read-only reverse begin. | |
| const_reverse_iterator | crend () const noexcept |
| Read-only reverse end. | |
| StormByte::Size | size () const noexcept |
| Number of columns. | |
| bool | empty () const noexcept |
| Whether the row has no columns. | |
| const Value & | operator[] (std::string_view columnName) const & |
| Access by column name (const lvalue). | |
| Value & | operator[] (std::string_view columnName) & |
| Access by column name (lvalue). | |
| Value | operator[] (std::string_view columnName) && |
| Access by column name (rvalue). | |
| const NamedValue & | operator[] (StormByte::Size index) const & |
| Access a column by zero-based index (const lvalue). | |
| template<StormByte::Type::Integral T> | |
| const NamedValue & | operator[] (T index) const & |
| Access a column by integral zero-based index (const lvalue). | |
| NamedValue & | operator[] (StormByte::Size index) & |
| Access a column by zero-based index (lvalue). | |
| template<StormByte::Type::Integral T> | |
| NamedValue & | operator[] (T index) & |
| Access a column by integral zero-based index (lvalue). | |
| NamedValue | operator[] (StormByte::Size index) && |
| Access a column by zero-based index (rvalue). | |
| template<StormByte::Type::Integral T> | |
| NamedValue | operator[] (T index) && |
| Access a column by integral zero-based index (rvalue). | |
| void | add (std::string_view columnName, Value &&value) |
| Append a named column. | |
| void | add (NamedValue value) |
| Append a named value. | |
| bool | has_item (const NamedValue &value) const |
| Search for an equal named value. | |
| StormByte::Size | Count () const noexcept |
| Number of columns. | |
One result row: ordered NamedValues with lookup by column name.
Read-only pointer iterator.
| using StormByte::Database::Row::const_pointer = const NamedValue* |
Read-only column pointer.
| using StormByte::Database::Row::const_reference = const NamedValue& |
Read-only column reference.
| using StormByte::Database::Row::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Read-only reverse iterator.
Mutable pointer iterator.
Mutable column pointer.
Mutable column reference.
| using StormByte::Database::Row::reverse_iterator = std::reverse_iterator<iterator> |
Mutable reverse iterator.
Column count and index type.
Column value type.
|
noexcept |
Default constructor.
| StormByte::Database::Row::Row | ( | const Row & | other | ) |
Copy constructor.
| other | Source row. |
|
noexcept |
Move constructor.
|
noexcept |
Destructor.
| void StormByte::Database::Row::add | ( | NamedValue | value | ) |
Append a named value.
| value | Named value to store. |
| void StormByte::Database::Row::add | ( | std::string_view | columnName, |
| Value && | value | ||
| ) |
Append a named column.
| columnName | Column name. |
| value | Value to store. |
|
noexcept |
Read-only begin pointer.
|
noexcept |
Mutable begin pointer.
|
noexcept |
Read-only begin pointer.
|
noexcept |
Read-only end pointer.
|
noexcept |
Number of columns.
|
noexcept |
Read-only reverse begin.
|
noexcept |
Read-only reverse end.
|
noexcept |
Whether the row has no columns.
|
noexcept |
Read-only end pointer.
|
noexcept |
Mutable end pointer.
| bool StormByte::Database::Row::has_item | ( | const NamedValue & | value | ) | const |
Search for an equal named value.
| value | Value to find. |
| bool StormByte::Database::Row::operator!= | ( | const Row & | other | ) | const |
Copy assignment.
| other | Source row. |
| bool StormByte::Database::Row::operator== | ( | const Row & | other | ) | const |
Equality of the ordered columns.
| other | Row to compare. |
| Value & StormByte::Database::Row::operator[] | ( | std::string_view | columnName | ) | & |
Access by column name (lvalue).
| columnName | Column name. |
| ColumnNotFound | if the name is absent. |
| Value StormByte::Database::Row::operator[] | ( | std::string_view | columnName | ) | && |
Access by column name (rvalue).
| columnName | Column name. |
| ColumnNotFound | if the name is absent. |
| const Value & StormByte::Database::Row::operator[] | ( | std::string_view | columnName | ) | const & |
Access by column name (const lvalue).
| columnName | Column name. |
| ColumnNotFound | if the name is absent. |
| NamedValue & StormByte::Database::Row::operator[] | ( | StormByte::Size | index | ) | & |
Access a column by zero-based index (lvalue).
| index | Column index. |
| OutOfBounds | if index is outside this row. |
| NamedValue StormByte::Database::Row::operator[] | ( | StormByte::Size | index | ) | && |
Access a column by zero-based index (rvalue).
| index | Column index. |
| OutOfBounds | if index is outside this row. |
| const NamedValue & StormByte::Database::Row::operator[] | ( | StormByte::Size | index | ) | const & |
Access a column by zero-based index (const lvalue).
| index | Column index. |
| OutOfBounds | if index is outside this row. |
|
inline |
Access a column by integral zero-based index (lvalue).
| T | Integral index type. |
| index | Column index. |
|
inline |
Access a column by integral zero-based index (rvalue).
| T | Integral index type. |
| index | Column index. |
|
inline |
Access a column by integral zero-based index (const lvalue).
| T | Integral index type. |
| index | Column index. |
|
noexcept |
Read-only reverse begin.
|
noexcept |
Mutable reverse begin.
|
noexcept |
Read-only reverse end.
|
noexcept |
Mutable reverse end.
|
noexcept |
Number of columns.