ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
Loading...
Searching...
No Matches
replay.hpp
Go to the documentation of this file.
1#pragma once
2
11
12#include <cstdint>
13#include <span>
14
15#include "itch/parser.hpp"
16
17namespace itch {
18
28 public:
34 explicit ReplayEngine(double speed_multiplier = 1.0) noexcept
35 : m_speed_multiplier {speed_multiplier} {}
36
41 auto set_speed(double speed_multiplier) noexcept -> void {
42 m_speed_multiplier = speed_multiplier;
43 }
44
48 [[nodiscard]] auto speed() const noexcept -> double { return m_speed_multiplier; }
49
56 auto replay(std::span<const std::byte> data, const MessageCallback& callback) const
57 -> std::uint64_t;
58
59 private:
60 double m_speed_multiplier {1.0};
61};
62
63} // namespace itch
Replays a parsed ITCH stream paced by message timestamps.
Definition replay.hpp:27
ReplayEngine(double speed_multiplier=1.0) noexcept
Constructs an engine with a speed multiplier.
Definition replay.hpp:34
auto speed() const noexcept -> double
The current speed multiplier.
Definition replay.hpp:48
auto replay(std::span< const std::byte > data, const MessageCallback &callback) const -> std::uint64_t
Parses data and invokes callback for each message, paced by the message timestamps.
Definition replay.cpp:18
auto set_speed(double speed_multiplier) noexcept -> void
Sets the speed multiplier (see the constructor).
Definition replay.hpp:41
std::function< void(const Message &)> MessageCallback
The signature for the callback function used in streaming parse methods.
Definition parser.hpp:40
Public parsing interface for NASDAQ TotalView-ITCH 5.0 feeds, plus the low-level byte-unpacking utili...