|
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
|
#include <fastmm/sim/param_schedule.hpp>
Public Types | |
| using | Refill = Timestamp(*)(void *ctx, Timestamp due) |
refill(ctx, due) adds the updates due at due (at() with that time) and returns when the next ones are due (Timestamp::max(): none). | |
Public Member Functions | |
| void | at (Timestamp ts, const ParamUpdateMsg &m) |
Delivers m at ts; updates with the same time keep the order they were added in. | |
| void | set_delay (Duration d) noexcept |
| Added to the time of updates that arrive through sink() (the slow tier's delay). | |
| Duration | delay () const noexcept |
| ParamSink | sink (const SimClock &clock) noexcept |
A ParamPublisher sink: each update is delivered delay() after clock's time at the publish. | |
| ParamSink | threaded_sink (const SimClock &clock) noexcept |
Like sink(), for a schedule that other threads publish to as well: an update from the thread that called threaded_sink() (the thread that runs the SimDriver) is delivered delay() after clock's time; one from another thread goes to the inbox (post()). | |
| void | set_refill (const SimClock &clock, void *ctx, Refill refill, Timestamp first) noexcept |
| void | post (const ParamUpdateMsg &m) |
Any thread: holds m until the next collect(). | |
| void | collect () |
| Driver thread: schedules the posted updates delay() after the clock's time (the clock passed to sink() or threaded_sink()). | |
| bool | empty () const noexcept |
| std::size_t | size () const noexcept |
| Timestamp | next_ts () const noexcept |
| The earliest delivery time (Timestamp::max() when empty). | |
| ParamUpdateMsg | pop () noexcept |
| Removes the earliest update; its recv_ts is the delivery time. | |
| using fastmm::sim::ParamSchedule::Refill = Timestamp (*)(void* ctx, Timestamp due) |
refill(ctx, due) adds the updates due at due (at() with that time) and returns when the next ones are due (Timestamp::max(): none).
The first call asks for first; each later one comes once clock has reached the time the call before it asked for.
|
inline |
Delivers m at ts; updates with the same time keep the order they were added in.
|
inlinenoexcept |
Added to the time of updates that arrive through sink() (the slow tier's delay).
|
inlinenoexcept |
A ParamPublisher sink: each update is delivered delay() after clock's time at the publish.
Like sink(), for a schedule that other threads publish to as well: an update from the thread that called threaded_sink() (the thread that runs the SimDriver) is delivered delay() after clock's time; one from another thread goes to the inbox (post()).
|
inlinenoexcept |
|
inline |
Any thread: holds m until the next collect().
|
inline |
Driver thread: schedules the posted updates delay() after the clock's time (the clock passed to sink() or threaded_sink()).
Cheap when nothing was posted.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
The earliest delivery time (Timestamp::max() when empty).
|
inlinenoexcept |
Removes the earliest update; its recv_ts is the delivery time.