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

Move-only authority for submitting transactions to one DocumentSession. More...

#include <document_session.hpp>

Classes

class  Provenance
 Opaque identity of one writer authority within one document session. More...

Public Member Functions

 WriterToken ()=default
 Constructs an invalid token that cannot authorize submissions.
 WriterToken (const WriterToken &)=delete
WriterToken & operator= (const WriterToken &)=delete
 WriterToken (WriterToken &&other) noexcept
 Transfers writer authority and invalidates other.
WriterToken & operator= (WriterToken &&other) noexcept
 Replaces this authority with other and invalidates other.
WriterId id () const noexcept
 Returns the writer identity carried by this token.
Provenance provenance () const noexcept
 Returns an opaque fingerprint that remains stable when this token moves.
TransactionId allocate_transaction_id () noexcept
 Allocates the next transaction ID, or an invalid ID after exhaustion.
CommandId allocate_command_id () noexcept
 Allocates the next command ID, or an invalid ID after exhaustion.
UndoGroupId allocate_undo_group_id () noexcept
 Allocates the next undo-group ID, or an invalid ID after exhaustion.

Friends

class DocumentSession
class detail::WriterTokenTestAccess

Detailed Description

Move-only authority for submitting transactions to one DocumentSession.

A token is bound to the session that created it and remains valid until that session is destroyed. Its three allocation methods are safe to call concurrently and produce monotonically increasing, writer-scoped IDs. Exhaustion produces an invalid ID rather than wrapping.

Constructor & Destructor Documentation

◆ WriterToken() [1/3]

pulp::timeline::WriterToken::WriterToken ( )
default

Constructs an invalid token that cannot authorize submissions.

◆ WriterToken() [2/3]

pulp::timeline::WriterToken::WriterToken ( const WriterToken & )
delete

◆ WriterToken() [3/3]

pulp::timeline::WriterToken::WriterToken ( WriterToken && other)
noexcept

Transfers writer authority and invalidates other.

Member Function Documentation

◆ allocate_command_id()

CommandId pulp::timeline::WriterToken::allocate_command_id ( )
noexcept

Allocates the next command ID, or an invalid ID after exhaustion.

◆ allocate_transaction_id()

TransactionId pulp::timeline::WriterToken::allocate_transaction_id ( )
noexcept

Allocates the next transaction ID, or an invalid ID after exhaustion.

◆ allocate_undo_group_id()

UndoGroupId pulp::timeline::WriterToken::allocate_undo_group_id ( )
noexcept

Allocates the next undo-group ID, or an invalid ID after exhaustion.

◆ id()

WriterId pulp::timeline::WriterToken::id ( ) const
inlinenoexcept

Returns the writer identity carried by this token.

◆ operator=() [1/2]

WriterToken & pulp::timeline::WriterToken::operator= ( const WriterToken & )
delete

◆ operator=() [2/2]

WriterToken & pulp::timeline::WriterToken::operator= ( WriterToken && other)
noexcept

Replaces this authority with other and invalidates other.

◆ provenance()

Provenance pulp::timeline::WriterToken::provenance ( ) const
inlinenodiscardnoexcept

Returns an opaque fingerprint that remains stable when this token moves.

◆ detail::WriterTokenTestAccess

friend class detail::WriterTokenTestAccess
friend

◆ DocumentSession

friend class DocumentSession
friend

The documentation for this class was generated from the following file: