|
tess 1.0.0
Performance-first tile and path simulation substrate
|
#include <tess/sim/event_stream.h>
Public Types | |
| using | event_type = TickStampedEvent<T> |
Public Member Functions | |
| void | reserve_events (std::size_t count) |
| auto | publish (std::uint64_t tick, const T &value) -> bool |
| auto | publish (std::uint64_t tick, T &&value) -> bool |
| auto | events () const noexcept -> std::span< const event_type > |
| auto | size () const noexcept -> std::size_t |
| bool | empty () const noexcept |
| auto | rejected_events () const noexcept -> std::uint64_t |
| void | clear () noexcept |
| void | consume_all () noexcept |
| Retires the batch as read: every event counts completed. | |
| void | discard_all () noexcept |
| Retires the batch unread: every event counts dropped. | |
| void | set_flow_accounting (diagnostics::FlowAccounting *accounting) noexcept |
| void | observe_flow_tick (std::uint64_t tick) noexcept |
| EventStream (const EventStream &other) | |
| auto | operator= (const EventStream &other) -> EventStream & |
| EventStream (EventStream &&other) noexcept | |
| auto | operator= (EventStream &&other) noexcept -> EventStream & |
Caller-owned, bounded batch of exact tick-stamped events.
Call reserve_events during setup. Publication then performs no container allocation and rejects overflow instead of silently dropping or overwriting an event; payload copy/move operations must themselves be allocation-free for the whole publication call to be allocation-free. clear starts a new batch without resetting sequence numbers, allowing consumers and diagnostics to detect gaps across ticks.
|
inlinenoexcept |
Starts a new batch without judging the old one.
With flow accounting attached this conservatively counts the discarded batch as dropped after admission; consumers that read the batch should prefer consume_all.
|
inlinenoexcept |
Observes one monotonic simulation tick for time accounting.
Ages derive from the accounting clock at publication, not from the events' payload ticks, which callers may stamp into the future.
|
inlinenoexcept |
Attaches caller-owned flow accounting; null detaches.
Attach or detach only on an empty batch; the accountant must outlive the attachment. Events are retained inventory: publication admits, and consume_all/discard_all/clear terminalize.