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

The declaration side of the compile-context subscription contract. More...

#include <compile_context_registry.hpp>

Public Member Functions

 CompileContextRegistry ()
 CompileContextRegistry (const CompileContextRegistry &other)
 CompileContextRegistry (CompileContextRegistry &&other)
CompileContextRegistry & operator= (const CompileContextRegistry &other)
CompileContextRegistry & operator= (CompileContextRegistry &&other)
std::optional< ContextRegistrationError > declare (ContentRendererRegistration registration)
 Returns the refusal, or nothing when the registration was accepted.
std::optional< ContextRegistrationError > declare (ContentRendererRegistration registration, const timeline::SchemaRegistry &schemas)
 Declares a trusted compiler after proving its exact Content schema and codec exist in the immutable schema registry.
timeline::CompileContextSubscriptions subscriptions_for (std::string_view content_type_name) const noexcept
 What the renderer for content_type_name declared.
const ContentRendererRegistration * find (const timeline::SchemaIdentity &schema) const noexcept
 Finds the exact schema-version registration.
const ContentRendererRegistration * find (const timeline::RegisteredContent &content) const noexcept
std::size_t size () const noexcept
std::uint64_t revision () const noexcept
 Monotonic version within this registry generation's declarations.
std::shared_ptr< const void > generation_identity () const noexcept

Static Public Attributes

static constexpr std::size_t kMaxRegistrations = 1024
static constexpr std::size_t kMaximumFragmentNotesPerClip = 4096

Friends

class CompileInvalidationIndex
class PlaybackProgramCompiler
struct CompileInvalidationInput

Detailed Description

The declaration side of the compile-context subscription contract.

A registry is mutated only on the control thread. Each compile invalidation input takes an immutable declaration snapshot, so later control-thread changes apply to the next request and never race a worker. Registration is refused rather than overwritten on a duplicate type name: two renderers disagreeing about what a content kind reads is a configuration bug, and silently keeping one of them would make the invalidation depend on registration order.

Constructor & Destructor Documentation

◆ CompileContextRegistry() [1/3]

pulp::playback::CompileContextRegistry::CompileContextRegistry ( )

◆ CompileContextRegistry() [2/3]

pulp::playback::CompileContextRegistry::CompileContextRegistry ( const CompileContextRegistry & other)

◆ CompileContextRegistry() [3/3]

pulp::playback::CompileContextRegistry::CompileContextRegistry ( CompileContextRegistry && other)

Member Function Documentation

◆ declare() [1/2]

std::optional< ContextRegistrationError > pulp::playback::CompileContextRegistry::declare ( ContentRendererRegistration registration)

Returns the refusal, or nothing when the registration was accepted.

◆ declare() [2/2]

std::optional< ContextRegistrationError > pulp::playback::CompileContextRegistry::declare ( ContentRendererRegistration registration,
const timeline::SchemaRegistry & schemas )

Declares a trusted compiler after proving its exact Content schema and codec exist in the immutable schema registry.

Compiler registrations cannot enter through the subscription-only overload above.

◆ find() [1/2]

const ContentRendererRegistration * pulp::playback::CompileContextRegistry::find ( const timeline::RegisteredContent & content) const
noexcept

◆ find() [2/2]

const ContentRendererRegistration * pulp::playback::CompileContextRegistry::find ( const timeline::SchemaIdentity & schema) const
noexcept

Finds the exact schema-version registration.

The returned pointer is registry-owned and remains valid only until the next mutation; compile callers hold an immutable copied registry snapshot for the full hook.

◆ generation_identity()

std::shared_ptr< const void > pulp::playback::CompileContextRegistry::generation_identity ( ) const
inlinenoexcept

◆ operator=() [1/2]

CompileContextRegistry & pulp::playback::CompileContextRegistry::operator= ( CompileContextRegistry && other)

◆ operator=() [2/2]

CompileContextRegistry & pulp::playback::CompileContextRegistry::operator= ( const CompileContextRegistry & other)

◆ revision()

std::uint64_t pulp::playback::CompileContextRegistry::revision ( ) const
noexcept

Monotonic version within this registry generation's declarations.

A compiler pairs this with the opaque generation identity. Ordinary mutable copies and assignments begin a new generation even when they contain the same declarations, so replacement cannot alias an older revision number. Internal immutable dispatch snapshots retain their captured source watermark and are safe to resubmit unchanged.

◆ size()

std::size_t pulp::playback::CompileContextRegistry::size ( ) const
inlinenoexcept

◆ subscriptions_for()

timeline::CompileContextSubscriptions pulp::playback::CompileContextRegistry::subscriptions_for ( std::string_view content_type_name) const
noexcept

What the renderer for content_type_name declared.

An unregistered type reads nothing: no renderer compiles it, so there is no program that could go stale.

◆ CompileInvalidationIndex

friend class CompileInvalidationIndex
friend

◆ CompileInvalidationInput

friend struct CompileInvalidationInput
friend

◆ PlaybackProgramCompiler

friend class PlaybackProgramCompiler
friend

Member Data Documentation

◆ kMaximumFragmentNotesPerClip

std::size_t pulp::playback::CompileContextRegistry::kMaximumFragmentNotesPerClip = 4096
staticconstexpr

◆ kMaxRegistrations

std::size_t pulp::playback::CompileContextRegistry::kMaxRegistrations = 1024
staticconstexpr

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