linkahead/result_table.h

namespace linkahead
namespace transaction

Creation and execution of transactions.

Author

Timm Fitschen

Date

2021-08-05

class ResultTable

Public Functions

auto size() const noexcept -> int

Number of rows.

The header is not counted as a row.

auto GetHeader() const noexcept -> HeaderIterator

Get the header of this table, i.e. the list of columns.

auto GetRows() const noexcept -> RowIterator

Get the data rows, i.e. the actual data.

Private Functions

explicit ResultTable(std::unique_ptr<ResultTableImpl> delegate)

Private Members

std::unique_ptr<ResultTableImpl> delegate

Friends

friend class ResultTableImpl
class HeaderIterator

Public Types

using iterator_category = std::output_iterator_tag
using value_type = ResultTableColumn
using difference_type = std::ptrdiff_t
using pointer = ResultTableColumn*
using reference = ResultTableColumn&

Public Functions

explicit HeaderIterator(const ResultTable *result_table, int index = 0)
HeaderIterator(const HeaderIterator &other)
auto operator*() const -> const ResultTableColumn&
auto operator++() -> HeaderIterator&
auto operator++(int) -> HeaderIterator
auto operator!=(const HeaderIterator &rhs) const -> bool
auto size() const noexcept -> int
auto begin() const -> HeaderIterator
auto end() const -> HeaderIterator

Private Members

int current_index = 0
const ResultTable *result_table
class RowIterator

Public Types

using iterator_category = std::output_iterator_tag
using value_type = linkahead::transaction::ResultTableRow
using difference_type = std::ptrdiff_t
using pointer = value_type*
using reference = value_type&

Public Functions

explicit RowIterator(const ResultTable *result_table, int index = 0)
RowIterator(const RowIterator &other)
auto operator*() const -> const ResultTableRow&
auto operator++() -> RowIterator&
auto operator++(int) -> RowIterator
auto operator!=(const RowIterator &rhs) const -> bool
auto size() const noexcept -> int
auto begin() const -> RowIterator
auto end() const -> RowIterator

Private Members

int current_index = 0
const ResultTable *result_table
class ResultTableColumn

Public Functions

auto GetName() const noexcept -> const std::string&

Get the name of the column.

explicit ResultTableColumn(std::unique_ptr<ResultTableColumnImpl> delegate)

Private Members

std::unique_ptr<ResultTableColumnImpl> delegate

Friends

friend class ResultTable
class ResultTableRow

Public Functions

auto GetValue(const std::string &column) const noexcept -> Value
explicit ResultTableRow(std::unique_ptr<ResultTableRowImpl> delegate)

Private Members

std::unique_ptr<ResultTableRowImpl> delegate

Friends

friend class ResultTable