Class Tick
Defined in File tick-input.h
Class Documentation
-
class Tick
Immutable State and ordered records for one independently scheduled update.
The baseline is the last consumed sample. New polls are consumed together in publication order, regardless of how many transitions they contain. Owns sample handles/record storage. Read-only queries may cross threads; spans/filter views borrow this value and cannot survive its move/destruction.
Public Functions
Retain a nonnull baseline and strictly newer nonnull polls in nondecreasing observation order.
Default interval runs from baseline time to the last poll, or baseline time when empty. Invalid inputs throw; no live adapter is borrowed.
Retain an explicit monotonic observation interval.
since must be at/after baseline time, until at/after since, and every newer poll must be observed by until. Invalid input throws before construction completes.
-
Actions::ButtonTickState button(Actions::Id action) const
Declaration:
[[nodiscard]]Summarize direct-namespace levels, all edges/counts and observation durations into an owned value.
Missing actions are inactive; completed-hold storage may allocate. No device polling occurs.
-
Actions::AxisTickState axis(Actions::Id action) const
Declaration:
[[nodiscard]]Return final absolute state or summed relative deltas.
A reported axis-kind change within this batch rejects; changes between consumptions are supported. Missing/unbound relative samples do not invent an Absolute transition.
-
Actions::View actions(const Actions::Context &context) const
Declaration:
[[nodiscard]]Copy context.id() into a View borrowing this Tick, not the lease.
Keep the Tick alive/unmoved; reset/destruction of the lease does not rewrite historical data.
-
Actions::View actions(Actions::ContextId context) const
Declaration:
[[nodiscard]]Create a borrowed Tick view for a retained namespace identity.
Missing namespaces return inactive/zero results; a live lease is unnecessary.
-
inline std::span<const std::shared_ptr<const Actions::Snapshot>> polls() const
Declaration:
[[nodiscard]]Borrow the retained consumed sample-handle sequence; keep this Tick alive/unmoved, or copy handles for independent retention.
-
std::shared_ptr<const Actions::Snapshot> latest_poll() const
Declaration:
[[nodiscard]]Return the retained last sample, or baseline when no polls were consumed.
-
inline ObservationDuration elapsed() const
Declaration:
[[nodiscard]]Return until-since in observation seconds, independent of selected simulation delta/time scaling.
-
inline std::span<const Events::Record> records() const
Declaration:
[[nodiscard]]Borrow the shared ordered physical/Text stream for this update.
State-only construction has no records; complete-poll accumulation supplies them. The view cannot survive this Tick’s move/destruction.
-
inline auto records_for(const Routing::TargetId target, const std::optional<std::uint64_t> epoch = {}) const
Declaration:
[[nodiscard]]Return a lazy borrowed filter preserving observation order for this target and, when specified, exact focus epoch.
It selects matching records without consuming/modifying them; retain this unmoved Tick. Omitting epoch admits every collected epoch for that target.
Friends
- friend class Actions::View