Class Snapshot

Class Documentation

class Snapshot

The complete set of semantic actions from one poll.

Copies/handles stay stable after later polls.

Public Functions

inline std::uint64_t poll() const

Declaration: [[nodiscard]]

Return publication ID, initially0; monotonic publications may skip IDs on failed preparation.

inline std::chrono::steady_clock::time_point observed_at() const

Declaration: [[nodiscard]]

Return completed poll observation time, not simulation or hardware time.

inline bool has_changes() const

Declaration: [[nodiscard]]

Report any button edge/axis delta in direct or contextual state.

An unchanged poll still represents a completed observation.

inline ButtonPollState button(Id action) const

Declaration: [[nodiscard]]

Return an owned direct-namespace button state; an absent action returns inactive defaults.

Copying completed-hold storage can allocate.

inline AxisPollState axis(Id action) const

Declaration: [[nodiscard]]

Return a direct-namespace axis copy; absent actions return zero Absolute state.

inline bool has_axis(Id action) const

Declaration: [[nodiscard]]

Test whether a direct axis is explicitly present, distinguishing absent state from a reported zero.

inline ButtonPollState button(ContextId context, Id action) const

Declaration: [[nodiscard]]

Return a context-local button copy.

Unknown/absent context or action returns inactive defaults; retained snapshots are not rewritten by lease removal.

inline AxisPollState axis(ContextId context, Id action) const

Declaration: [[nodiscard]]

Return context-local axis state; missing context/action returns zero Absolute defaults.

inline bool has_axis(ContextId context, Id action) const

Declaration: [[nodiscard]]

Test explicit axis presence within the given retained namespace; no live lease is required.