|
| | PageWindow (std::int64_t pageSize=200, std::size_t maxPages=8) |
| | An empty window.
|
| std::vector< PageFetch > | visible (std::int64_t first, std::int64_t count) |
| | Declares the visible rows; returns the fetches to send.
|
| bool | accept (PageFetch const &fetch, Page< Row > page) |
| | Stores a reply.
|
| bool | fail (PageFetch const &fetch, TableError error) |
| | Records a failed request; the error is shown until a reply arrives.
|
| void | reset () |
| | Drops every page, request and error and starts a new query: the sort or filter changed.
|
| std::uint64_t | query () const noexcept |
| | The current query, which reset advances.
|
| Row const * | row (std::int64_t index) const |
| | The row at a view row, when it is held.
|
| std::optional< std::int64_t > | total () const noexcept |
| | The view's total rows, when a reply of this query reported it.
|
| std::optional< TableError > const & | error () const noexcept |
| | The last error, until a reply clears it.
|
| std::size_t | pagesHeld () const noexcept |
| | Pages held, complete or in part.
|
| bool | pending () const noexcept |
| | Whether any request is in flight.
|
template<typename Row>
class morph::table::PageWindow< Row >
The pages a server-mode table holds: those around the visible rows, up to a bound, plus the request state and the last error.
The client calls visible as the view scrolls and sends the request of each fetch it returns, then hands the fetch back with its reply to accept (or with its error to fail). A change of sort or filter is a new query: call reset. A reply to a fetch made before the last reset is ignored, so a late page of the old query never shows under the new one.
A server may return fewer rows than a fetch asked for (validate clamps the limit to its maxLimit): the window then fetches the rest of the page from where the reply ended. A page is complete when it is full, reaches the known total, or a reply to it is empty.
- Template Parameters
-
Definition at line 696 of file query.hpp.