Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::motion::Coordinator Class Reference

Process-wide singleton that owns one FrameClock subscription, holds the active trace set, and dispatches sample events to registered sinks. More...

#include <motion.hpp>

Public Member Functions

void bind (pulp::view::FrameClock &clock)
 Bind the coordinator's single tick subscription to a FrameClock.
void unbind ()
 Drop the FrameClock subscription. No effect if not bound.
bool is_bound () const noexcept
int add_sink (Sink sink)
 Add a sink and return its id (for later removal).
void remove_sink (int sink_id)
void clear_sinks ()
int install_default_log_sink ()
 Convenience: add the default make_log_sink() and return its id.
void set_tracing_enabled (bool on)
 Global tracing toggle. Off by default. When off, on_tick is a no-op.
bool tracing_enabled () const noexcept
void set_firehose (bool on)
 Filter-scope firehose toggle.
bool firehose () const noexcept
TraceBuilder trace (std::string view_name, TraceOptions opts={})
 Start building a trace.
void detach (int trace_id)
 Remove a trace by id (called automatically by TraceHandle destruction).
void reset ()
 Reset all state (binding, sinks, traces, counters). For tests.
std::size_t active_trace_count () const noexcept
std::size_t emitted_event_count () const noexcept
 Cumulative count of SampleEvents dispatched since reset(). For tests.
void publish_internal (std::string view_name, std::string metric_name, std::vector< std::pair< std::string, double > > components, PublishOptions opts)
 Called by publish_value / publish_components.
void set_ambient_provenance_internal (Provenance p)
 Called by set_ambient_provenance / clear_ambient_provenance.
Provenance current_ambient_provenance_internal () const
void dispatch_input_event (SampleEvent e)
 Stamp e with the bound FrameClock's t/frame and dispatch it to every installed sink.

Static Public Member Functions

static Coordinator & instance ()
 Process-wide instance. Bound to a FrameClock via bind().

Friends

class TraceBuilder

Detailed Description

Process-wide singleton that owns one FrameClock subscription, holds the active trace set, and dispatches sample events to registered sinks.

Off by default; call set_tracing_enabled(true) to start emitting events.

Member Function Documentation

◆ active_trace_count()

std::size_t pulp::view::motion::Coordinator::active_trace_count ( ) const
noexcept

◆ add_sink()

int pulp::view::motion::Coordinator::add_sink ( Sink sink)

Add a sink and return its id (for later removal).

◆ bind()

void pulp::view::motion::Coordinator::bind ( pulp::view::FrameClock & clock)

Bind the coordinator's single tick subscription to a FrameClock.

Replaces any prior binding.

◆ clear_sinks()

void pulp::view::motion::Coordinator::clear_sinks ( )

◆ current_ambient_provenance_internal()

Provenance pulp::view::motion::Coordinator::current_ambient_provenance_internal ( ) const

◆ detach()

void pulp::view::motion::Coordinator::detach ( int trace_id)

Remove a trace by id (called automatically by TraceHandle destruction).

◆ dispatch_input_event()

void pulp::view::motion::Coordinator::dispatch_input_event ( SampleEvent e)

Stamp e with the bound FrameClock's t/frame and dispatch it to every installed sink.

Called by record_simulated_input.

◆ emitted_event_count()

std::size_t pulp::view::motion::Coordinator::emitted_event_count ( ) const
noexcept

Cumulative count of SampleEvents dispatched since reset(). For tests.

◆ firehose()

bool pulp::view::motion::Coordinator::firehose ( ) const
noexcept

◆ install_default_log_sink()

int pulp::view::motion::Coordinator::install_default_log_sink ( )

Convenience: add the default make_log_sink() and return its id.

◆ instance()

Coordinator & pulp::view::motion::Coordinator::instance ( )
static

Process-wide instance. Bound to a FrameClock via bind().

◆ is_bound()

bool pulp::view::motion::Coordinator::is_bound ( ) const
noexcept

◆ publish_internal()

void pulp::view::motion::Coordinator::publish_internal ( std::string view_name,
std::string metric_name,
std::vector< std::pair< std::string, double > > components,
PublishOptions opts )

Called by publish_value / publish_components.

Public so the free functions can reach it without becoming friends; callers should prefer the publish_* free functions for forward compatibility.

◆ remove_sink()

void pulp::view::motion::Coordinator::remove_sink ( int sink_id)

◆ reset()

void pulp::view::motion::Coordinator::reset ( )

Reset all state (binding, sinks, traces, counters). For tests.

◆ set_ambient_provenance_internal()

void pulp::view::motion::Coordinator::set_ambient_provenance_internal ( Provenance p)

Called by set_ambient_provenance / clear_ambient_provenance.

Callers should prefer the free functions for forward compatibility.

◆ set_firehose()

void pulp::view::motion::Coordinator::set_firehose ( bool on)

Filter-scope firehose toggle.

Stored and exposed for diagnostics that want publish-channel events without explicit metric subscriptions.

◆ set_tracing_enabled()

void pulp::view::motion::Coordinator::set_tracing_enabled ( bool on)

Global tracing toggle. Off by default. When off, on_tick is a no-op.

◆ trace()

TraceBuilder pulp::view::motion::Coordinator::trace ( std::string view_name,
TraceOptions opts = {} )

Start building a trace.

◆ tracing_enabled()

bool pulp::view::motion::Coordinator::tracing_enabled ( ) const
noexcept

◆ unbind()

void pulp::view::motion::Coordinator::unbind ( )

Drop the FrameClock subscription. No effect if not bound.

◆ TraceBuilder

friend class TraceBuilder
friend

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