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

Monotonic allocator for non-zero document ItemIds. More...

#include <clip.hpp>

Public Member Functions

constexpr ItemIdAllocator (std::uint64_t next=1) noexcept
 Creates an allocator whose next successful result is next.
runtime::Result< ItemId, ModelError > allocate () noexcept
 Returns the next identity and advances the allocator.
constexpr std::uint64_t next_value () const noexcept
 Returns the numeric value that the next successful allocation uses.

Detailed Description

Monotonic allocator for non-zero document ItemIds.

Allocation never wraps or reuses an identity; exhaustion is returned as a ModelError and leaves the allocator exhausted.

Constructor & Destructor Documentation

◆ ItemIdAllocator()

pulp::timeline::ItemIdAllocator::ItemIdAllocator ( std::uint64_t next = 1)
inlineexplicitconstexprnoexcept

Creates an allocator whose next successful result is next.

Zero and UINT64_MAX construct an exhausted allocator.

Member Function Documentation

◆ allocate()

runtime::Result< ItemId, ModelError > pulp::timeline::ItemIdAllocator::allocate ( )
noexcept

Returns the next identity and advances the allocator.

◆ next_value()

std::uint64_t pulp::timeline::ItemIdAllocator::next_value ( ) const
inlineconstexprnoexcept

Returns the numeric value that the next successful allocation uses.


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