|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
An immutable view of a table's rows at one moment. More...
#include <data_source.hpp>
Public Member Functions | |
| virtual std::size_t | rowCount () const =0 |
| The number of rows. | |
| virtual RowId | rowId (std::size_t row) const =0 |
| A row's key. | |
| virtual Cell | cell (std::size_t row, std::size_t column) const =0 |
| One cell. | |
| virtual void | readColumn (std::size_t column, ColumnSink &sink, std::size_t first, std::size_t last) const |
Hands rows [first, last) of column to sink. | |
Protected Member Functions | |
| RowSnapshot (RowSnapshot const &)=default | |
| Copies the base of a snapshot: a derived snapshot makes a changed copy of itself this way. | |
| RowSnapshot (RowSnapshot &&)=default | |
| Moves the base of a snapshot. | |
| RowSnapshot & | operator= (RowSnapshot const &)=default |
| Copy-assigns the base of a snapshot. | |
| RowSnapshot & | operator= (RowSnapshot &&)=default |
| Move-assigns the base of a snapshot. | |
An immutable view of a table's rows at one moment.
Nothing changes a snapshot after it is published, so it is safe to read from any thread, concurrently, for as long as it is held.
Definition at line 457 of file data_source.hpp.
|
nodiscardpure virtual |
The number of rows.
Implemented in morph::table::RowsSnapshot< Row >, and morph::table::TableSnapshot.
|
nodiscardpure virtual |
A row's key.
| row | Row index, below rowCount(). |
Implemented in morph::table::RowsSnapshot< Row >, and morph::table::TableSnapshot.
|
nodiscardpure virtual |
One cell.
| row | Row index, below rowCount(). |
| column | Column index, below the source's column count. |
Implemented in morph::table::RowsSnapshot< Row >, and morph::table::TableSnapshot.
|
inlinevirtual |
Hands rows [first, last) of column to sink.
The default calls cell per row. A snapshot that stores cells contiguously overrides it to hand whole runs, which is how the engine reads a column of 100,000 rows without as many virtual calls.
| column | Column index. |
| sink | Receives the cells. |
| first | First row. |
| last | One past the last row. |
Reimplemented in morph::table::RowsSnapshot< Row >, and morph::table::TableSnapshot.
Definition at line 486 of file data_source.hpp.
|
protecteddefault |
Copy-assigns the base of a snapshot.
|
protecteddefault |
Move-assigns the base of a snapshot.