Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::timeline_editor::EditGestureIdentityAllocator Class Reference

Allocates one undo group and submits a construction-safe stream of gesture identities. More...

#include <edit_intent.hpp>

Public Member Functions

 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.

Static Public Member Functions

static runtime::Result< EditGestureIdentityAllocator, EditGestureIdentityError > create (timeline::WriterToken &writer) noexcept
 Allocates the gesture's sole undo group at pointer-down.

Detailed Description

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.

Constructor & Destructor Documentation

◆ EditGestureIdentityAllocator() [1/2]

pulp::timeline_editor::EditGestureIdentityAllocator::EditGestureIdentityAllocator ( const EditGestureIdentityAllocator & )
delete

◆ EditGestureIdentityAllocator() [2/2]

pulp::timeline_editor::EditGestureIdentityAllocator::EditGestureIdentityAllocator ( EditGestureIdentityAllocator && other)
inlinenoexcept

Transfers allocator lifecycle and invalidates other.

Member Function Documentation

◆ create()

runtime::Result< EditGestureIdentityAllocator, EditGestureIdentityError > pulp::timeline_editor::EditGestureIdentityAllocator::create ( timeline::WriterToken & writer)
inlinestaticnoexcept

Allocates the gesture's sole undo group at pointer-down.

◆ has_pending_identity()

bool pulp::timeline_editor::EditGestureIdentityAllocator::has_pending_identity ( ) const
inlinenoexcept

Returns whether one issued identity still needs submission.

◆ issue()

runtime::Result< EditGestureIdentityIssue, EditGestureIdentityError > pulp::timeline_editor::EditGestureIdentityAllocator::issue ( timeline::WriterToken & writer,
timeline::DocumentRevision expected_revision,
timeline::GesturePhase phase )
inlinenoexcept

Issues fresh transaction and command IDs for one legal lifecycle step.

Invalid writers and phases are rejected before either ID stream advances. If transaction allocation succeeds but command allocation is exhausted, that transaction ID remains consumed; writer-local IDs are never reused.

◆ operator=() [1/2]

EditGestureIdentityAllocator & pulp::timeline_editor::EditGestureIdentityAllocator::operator= ( const EditGestureIdentityAllocator & )
delete

◆ operator=() [2/2]

EditGestureIdentityAllocator & pulp::timeline_editor::EditGestureIdentityAllocator::operator= ( EditGestureIdentityAllocator && )
delete

◆ state()

EditGestureIdentityState pulp::timeline_editor::EditGestureIdentityAllocator::state ( ) const
inlinenoexcept

Returns the last submission-confirmed lifecycle state.

◆ submit() [1/2]

runtime::Result< EditGestureSubmitOutcome, EditGestureSubmitError > pulp::timeline_editor::EditGestureIdentityAllocator::submit ( timeline::DocumentSession & session,
timeline::WriterToken & writer,
EditGestureIdentityIssue && issue,
EditIntent intent )
inline

Lowers and submits exactly one issued gesture intent.

Protocol or lowering errors touch neither DocumentSession nor the pending issue. Once DocumentSession is called, both its success and rejection consume the issue. A success advances only when it is still the session's current publication; a stale cached Begin reconciles from session-owned gesture state before returning the exact mismatch.

◆ submit() [2/2]

runtime::Result< EditGestureSubmitOutcome, EditGestureSubmitError > pulp::timeline_editor::EditGestureIdentityAllocator::submit ( timeline::DocumentSession & session,
timeline::WriterToken & writer,
EditGestureIdentityIssue && issue,
ValidatedNoteEditIntent intent,
std::span< const timeline::NoteEvent > current_notes )
inline

Lowers and submits one note gesture using this allocator's opaque identity.

◆ undo_group()

timeline::UndoGroupId pulp::timeline_editor::EditGestureIdentityAllocator::undo_group ( ) const
inlinenoexcept

Returns the one undo group shared by every issue from this allocator.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/timeline_editor/include/pulp/timeline_editor/edit_intent.hpp