|
Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
|
Decides when a packet captured at some time is due, on the wall clock. More...
#include <md_feed/pcap_replay_source.hpp>
Public Member Functions | |
| ReplayPacer (double speed=1.0) | |
| double | speed () const |
| void | anchor (uint64_t capture_ns, uint64_t wall_ns) |
| Pins the capture time capture_ns to the wall time wall_ns. | |
| bool | anchored () const |
| uint64_t | due_ns (uint64_t capture_ns) const |
| The wall time at which a packet captured at capture_ns should go out. | |
| bool | is_due (uint64_t capture_ns, uint64_t now_ns) const |
| True when the packet may go out at wall time now_ns. | |
| uint64_t | rebase_ns (uint64_t capture_ns, uint64_t now_ns) const |
| The time to stamp on a packet's events when it goes out at now_ns: its due time, so the replay keeps the capture's spacing, or now_ns when unpaced (speed 0). | |
Decides when a packet captured at some time is due, on the wall clock.
Speed 1 releases a packet once as much wall time has passed since the anchor as separated it from the anchor packet in the capture; speed N releases it N times sooner; speed 0 never waits. Not thread-safe.
Definition at line 444 of file pcap_replay_source.hpp.
|
inlineexplicit |
Definition at line 446 of file pcap_replay_source.hpp.
References speed().
|
inline |
Pins the capture time capture_ns to the wall time wall_ns.
Call when the replay starts, with the first packet's time.
Definition at line 452 of file pcap_replay_source.hpp.
|
inlinenodiscard |
Definition at line 458 of file pcap_replay_source.hpp.
|
inlinenodiscard |
The wall time at which a packet captured at capture_ns should go out.
Definition at line 461 of file pcap_replay_source.hpp.
Referenced by is_due(), and rebase_ns().
|
inlinenodiscard |
True when the packet may go out at wall time now_ns.
Definition at line 469 of file pcap_replay_source.hpp.
References due_ns().
|
inlinenodiscard |
The time to stamp on a packet's events when it goes out at now_ns: its due time, so the replay keeps the capture's spacing, or now_ns when unpaced (speed 0).
Never later than now_ns.
Definition at line 476 of file pcap_replay_source.hpp.
References due_ns().
|
inlinenodiscard |
Definition at line 448 of file pcap_replay_source.hpp.
Referenced by ReplayPacer().