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 |
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.
|
noexcept |
| int pulp::view::motion::Coordinator::add_sink | ( | Sink | sink | ) |
Add a sink and return its id (for later removal).
| void pulp::view::motion::Coordinator::bind | ( | pulp::view::FrameClock & | clock | ) |
Bind the coordinator's single tick subscription to a FrameClock.
Replaces any prior binding.
| void pulp::view::motion::Coordinator::clear_sinks | ( | ) |
| Provenance pulp::view::motion::Coordinator::current_ambient_provenance_internal | ( | ) | const |
| void pulp::view::motion::Coordinator::detach | ( | int | trace_id | ) |
Remove a trace by id (called automatically by TraceHandle destruction).
| 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.
|
noexcept |
Cumulative count of SampleEvents dispatched since reset(). For tests.
|
noexcept |
| int pulp::view::motion::Coordinator::install_default_log_sink | ( | ) |
Convenience: add the default make_log_sink() and return its id.
|
static |
Process-wide instance. Bound to a FrameClock via bind().
|
noexcept |
| 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.
| void pulp::view::motion::Coordinator::remove_sink | ( | int | sink_id | ) |
| void pulp::view::motion::Coordinator::reset | ( | ) |
Reset all state (binding, sinks, traces, counters). For tests.
| 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.
| 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.
| void pulp::view::motion::Coordinator::set_tracing_enabled | ( | bool | on | ) |
Global tracing toggle. Off by default. When off, on_tick is a no-op.
| TraceBuilder pulp::view::motion::Coordinator::trace | ( | std::string | view_name, |
| TraceOptions | opts = {} ) |
Start building a trace.
|
noexcept |
| void pulp::view::motion::Coordinator::unbind | ( | ) |
Drop the FrameClock subscription. No effect if not bound.
|
friend |