Move-only UI-owned range slot. Equal/overlapping consumers are independent. Close/destruction retires only this consumer; outstanding worker reservations survive. Model and tree may close first. Destruction/move assignment on another thread terminates.
More...
#include <model.hpp>
|
|
| ModelConsumer ()=default |
| | Empty consumer.
|
|
| ~ModelConsumer () |
| | Logically retire without waiting for workers.
|
| | ModelConsumer (ModelConsumer &&other) noexcept |
| | Transfer on UI.
|
| ModelConsumer & | operator= (ModelConsumer other) noexcept |
| | Transfer on UI; retire old ownership only after the full replacement is complete.
|
|
| ModelConsumer (const ModelConsumer &)=delete |
| ModelRangeId | id () const noexcept |
| | Stable handle for ModelFrame::range.
|
| std::expected< ModelRequest< T >, TreeError > | request (RowRange range, std::shared_ptr< const void > work_owner={}) |
| | UI-only request or replace this slot's work; never starts a worker or reads provider data. Caller schedules the returned owning token. A null work owner retains the base snapshot. Oversized/out-of-bounds ranges are INVALID_ARGUMENT; live work budget is WOULD_BLOCK. All rejected requests leave this consumer unchanged. Mutations during frame are rejected.
|
| std::expected< void, TreeError > | close () |
| | Retire this consumer on UI. Idempotent; no allocation, cancellation never joins. Retained tables keep their old result; slot reuse removes the retired entry.
|
|
|
template<class> |
| class | Model |
template<class T>
class portals::ModelConsumer< T >
Move-only UI-owned range slot. Equal/overlapping consumers are independent. Close/destruction retires only this consumer; outstanding worker reservations survive. Model and tree may close first. Destruction/move assignment on another thread terminates.
- Template Parameters
-
| T | Domain row value type; snapshot-owned reachable data must remain immutable and support destruction on the final owner's thread. Library range/frame/request operations do not copy T values. |
◆ ModelConsumer()
Transfer on UI.
- Parameters
-
| other | UI-owned consumer to empty and transfer; a live consumer requires its owner thread. |
◆ close()
Retire this consumer on UI. Idempotent; no allocation, cancellation never joins. Retained tables keep their old result; slot reuse removes the retired entry.
- Returns
- Success after retirement, including repeated close; WRONG_THREAD leaves ownership unchanged.
◆ id()
Stable handle for ModelFrame::range.
- Returns
- Stable session/consumer identity, or zero identity for an empty/moved-from consumer.
◆ operator=()
Transfer on UI; retire old ownership only after the full replacement is complete.
- Parameters
-
| other | Replacement consumer moved into this call; old ownership retires after all fields are replaced. |
- Returns
- This consumer; do not use the reference if reentrant old-storage destruction destroyed this object.
◆ request()
UI-only request or replace this slot's work; never starts a worker or reads provider data. Caller schedules the returned owning token. A null work owner retains the base snapshot. Oversized/out-of-bounds ranges are INVALID_ARGUMENT; live work budget is WOULD_BLOCK. All rejected requests leave this consumer unchanged. Mutations during frame are rejected.
- Parameters
-
| range | Bounded interval in the current base snapshot's logical row count. |
| work_owner | Optional immutable provider work/storage owner; null retains the base snapshot. |
- Returns
- Worker token after committing pending readiness and layout invalidation; closed, tree/frame errors, INVALID_ARGUMENT, WOULD_BLOCK at the work limit, IDENTITY_EXHAUSTED, or NO_MEMORY without commit.
The documentation for this class was generated from the following file: