OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers 19.0.4
Users' manual and API documentation
Loading...
Searching...
No Matches
Replay.h
Go to the documentation of this file.
1// Copyright 2005-2012 Onix Solutions Limited [OnixS]. All rights reserved.
2//
3// This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
4// and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable ONIXS Software
7// Services Agreement (the Agreement) and Customer end user license agreements granting
8// a non-assignable, non-transferable and non-exclusive license to use the software
9// for it's own data processing purposes under the terms defined in the Agreement.
10//
11// Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
12// of this source code or associated reference material to any other location for further reproduction
13// or redistribution, and any amendments to this copyright notice, are expressly prohibited.
14//
15// Any reproduction or redistribution for sale or hiring of the Software not in accordance with
16// the terms of the Agreement is a violation of copyright law.
17//
18
19#pragma once
20
21#include <string>
22#include <vector>
23
26
27namespace OnixS
28{
29 namespace Eurex
30 {
31 namespace MarketData
32 {
33 namespace Implementation { struct PcapReplayHelper; }
34
37 typedef std::vector<std::string> FilesList;
38
40 class ONIXS_EUREX_EMDI_API ReplayListener
41 {
42 public:
44 virtual void onReplayError (const std::string& errorDescription) = 0;
45
47 virtual void onReplayFinished() = 0;
48
49 protected:
52 virtual ~ReplayListener();
53 };
54
56 struct ONIXS_EUREX_EMDI_API ReplayMode
57 {
69 };
70
72 void ONIXS_EUREX_EMDI_API gatherFiles(FilesList* gatheredFiles, const std::string& root, const std::string& extension);
73
75 inline
76 void gatherLogs(FilesList* gatheredLogs, const std::string& root)
77 {
78 gatherFiles(gatheredLogs, root, ".log");
79 }
80
83 {
88
91
95 unsigned int packetReplayDelay;
96
100
103
106 : listener(defaultReplayListener())
109 , replayMode(ReplayMode::ConstantPacketReplayDelay)
110 {
111 }
112
114 explicit
115 ReplayOptions (const std::string& filesRoot, const std::string& filesExtension = ".log")
116 : listener(defaultReplayListener())
119 , replayMode(ReplayMode::ConstantPacketReplayDelay)
120 {
121 gatherFiles(&logs, filesRoot, filesExtension);
122 }
123
124 private:
125 ONIXS_EUREX_EMDI_API static ReplayListener* defaultReplayListener();
126 };
127
129 struct ONIXS_EUREX_EMDI_API NoDelayReplay : public ReplayOptions
130 {
132 explicit NoDelayReplay(const std::string& filesRoot, const std::string& filesExtension = ".log");
133
136 };
137
139 struct ONIXS_EUREX_EMDI_API OriginalDelayReplay : public ReplayOptions
140 {
142 explicit OriginalDelayReplay(const std::string& filesRoot, const std::string& filesExtension = ".log");
143
146 };
147
149 struct ONIXS_EUREX_EMDI_API X2SpeedReplay : public ReplayOptions
150 {
152 explicit X2SpeedReplay(const std::string& filesRoot, const std::string& filesExtension = ".log");
153
156 };
157
158
159 inline
160 NoDelayReplay::NoDelayReplay(const std::string& filesRoot, const std::string& filesExtension)
161 : ReplayOptions(filesRoot, filesExtension)
162 {
166 }
167
168 inline
175
176 inline
177 OriginalDelayReplay::OriginalDelayReplay(const std::string& filesRoot, const std::string& filesExtension)
178 : ReplayOptions(filesRoot, filesExtension)
179 {
183 }
184
185 inline
192
193 inline
194 X2SpeedReplay::X2SpeedReplay (const std::string& filesRoot, const std::string& filesExtension)
195 : ReplayOptions(filesRoot, filesExtension)
196 {
200 }
201
202 inline
209 }
210 }
211}
Listening interface for log replay-related events.
Definition Replay.h:41
virtual void onReplayFinished()=0
Is called once the replay is finished.
virtual void onReplayError(const std::string &errorDescription)=0
Is called once error occurs while replaying.
std::vector< std::string > FilesList
Definition Replay.h:37
void gatherFiles(FilesList *gatheredFiles, const std::string &root, const std::string &extension)
Gathers files which are stored in a given folder.
void gatherLogs(FilesList *gatheredLogs, const std::string &root)
Gathers log files which are stored in a given folder.
Definition Replay.h:76
NoDelayReplay(const std::string &filesRoot, const std::string &filesExtension=".log")
Initializes with all the files which are available and stored in a given folder.
Definition Replay.h:160
NoDelayReplay()
Initializes instance with default values.
Definition Replay.h:169
OriginalDelayReplay(const std::string &filesRoot, const std::string &filesExtension=".log")
Initializes with all the files which are available and stored in a given folder.
Definition Replay.h:177
OriginalDelayReplay()
Initializes instance with default values.
Definition Replay.h:186
ReplayMode::Enum replayMode
Replay mode. The default value is ReplayMode::ConstantPacketReplayDelay.
Definition Replay.h:102
ReplayOptions(const std::string &filesRoot, const std::string &filesExtension=".log")
Initializes with all the files which are available and stored in a given folder.
Definition Replay.h:115
ReplayListener * listener
Instance to notify about replay events.
Definition Replay.h:90
ReplayOptions()
Initializes instance with default values.
Definition Replay.h:105
X2SpeedReplay()
Initializes instance with default values.
Definition Replay.h:203
X2SpeedReplay(const std::string &filesRoot, const std::string &filesExtension=".log")
Initializes with all the files which are available and stored in a given folder.
Definition Replay.h:194