Allocates one undo group and submits a construction-safe stream of gesture identities.
More...
|
| | EditGestureIdentityAllocator (const EditGestureIdentityAllocator &)=delete |
| EditGestureIdentityAllocator & | operator= (const EditGestureIdentityAllocator &)=delete |
| | EditGestureIdentityAllocator (EditGestureIdentityAllocator &&other) noexcept |
| | Transfers allocator lifecycle and invalidates other.
|
| EditGestureIdentityAllocator & | operator= (EditGestureIdentityAllocator &&)=delete |
| runtime::Result< EditGestureIdentityIssue, EditGestureIdentityError > | issue (timeline::WriterToken &writer, timeline::DocumentRevision expected_revision, timeline::GesturePhase phase) noexcept |
| | Issues fresh transaction and command IDs for one legal lifecycle step.
|
| runtime::Result< EditGestureSubmitOutcome, EditGestureSubmitError > | submit (timeline::DocumentSession &session, timeline::WriterToken &writer, EditGestureIdentityIssue &&issue, EditIntent intent) |
| | Lowers and submits exactly one issued gesture intent.
|
| runtime::Result< EditGestureSubmitOutcome, EditGestureSubmitError > | submit (timeline::DocumentSession &session, timeline::WriterToken &writer, EditGestureIdentityIssue &&issue, ValidatedNoteEditIntent intent, std::span< const timeline::NoteEvent > current_notes) |
| | Lowers and submits one note gesture using this allocator's opaque identity.
|
| timeline::UndoGroupId | undo_group () const noexcept |
| | Returns the one undo group shared by every issue from this allocator.
|
| EditGestureIdentityState | state () const noexcept |
| | Returns the last submission-confirmed lifecycle state.
|
| bool | has_pending_identity () const noexcept |
| | Returns whether one issued identity still needs submission.
|
Allocates one undo group and submits a construction-safe stream of gesture identities.
A transaction can be rejected after its IDs are allocated, so issuing an identity never advances the confirmed lifecycle. submit() validates the issue, lowers the supplied intent without exposing its identity, calls DocumentSession::submit() itself, and derives the transition from that result. A rejection keeps the last confirmed state and permits a fresh-ID retry with the same undo group. Every attempted session submission consumes its issue, and exactly one issue may await submission.
This is control-thread state, not a concurrent reservation in DocumentSession. The session owns the one-open-gesture rule and is the only submission authority; the allocator retains neither it nor the WriterToken. While this allocator lives, callers must serialize every submission for its writer/group through it; concurrent direct same-group submission is outside the contract. If a pending issue is abandoned without submission, discard that allocator instance. Opaque writer provenance prevents equal numeric ID streams from separate sessions from being mistaken for one another here. Cancel closes the group after a successful submission; reverting its applied edits remains the caller's subsequent DocumentSession::undo() operation.