OnixS C++ CME MDP Conflated UDP Handler 1.1.2
API documentation
Loading...
Searching...
No Matches
Replay.h
Go to the documentation of this file.
1// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2//
3// This software owned by Onix Solutions Limited [OnixS] and is
4// protected by copyright law and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable
7// OnixS Software Services Agreement (the Agreement) and Customer end user license
8// agreements granting a non-assignable, non-transferable and non-exclusive license
9// to use the software for it's own data processing purposes under the terms defined
10// in the Agreement.
11//
12// Except as otherwise granted within the terms of the Agreement, copying or
13// reproduction of any part of this source code or associated reference material
14// to any other location for further reproduction or redistribution, and any
15// amendments to this copyright notice, are expressly prohibited.
16//
17// Any reproduction or redistribution for sale or hiring of the Software not in
18// accordance with the terms of the Agreement is a violation of copyright law.
19//
20
21#pragma once
22
23#include <string>
24#include <vector>
25#include <map>
26#include <functional>
27
30
35
37
38// A bit of forward declarations.
40(
41 Handler
42);
43
45typedef
46std::vector<std::string>
48
53ONIXS_CONFLATEDUDP_EXPORTED
54void
56 FileList&,
58 const std::string&);
59
66ONIXS_CONFLATEDUDP_EXPORTED
67void
69 FileList&,
71 const std::string&,
72 const std::string&);
73
81ONIXS_CONFLATEDUDP_EXPORTED
82void
84 FileList&,
85 const std::string&,
86 const std::string&);
87
88#if !defined (ONIXS_CONFLATEDUDP_NO_DEPRECATED)
89
95inline
96void
98 FileList& files,
99 const std::string& location,
100 const std::string& ext)
101{
102 gatherFiles(files, location, ext);
103}
104
105#endif // !ONIXS_CONFLATEDUDP_NO_DEPRECATED
106
126
129{
130 Timestamp begin_;
131 Timestamp end_;
132
133public:
136 : begin_()
137 , end_()
138 {
139 }
140
144 const Timestamp& begin,
145 const Timestamp& end)
146 : begin_(begin)
147 , end_(end)
148 {
149 }
150
154 const ReplaySpan& other)
155 : begin_(other.begin_)
156 , end_(other.end_)
157 {
158 }
159
161 bool empty() const
162 {
163 return (begin_ >= end_);
164 }
165
168 bool
170 const Timestamp& timestamp) const
171 {
172 return (
173 begin_ <= timestamp &&
174 timestamp < end_);
175 }
176
178 const Timestamp& begin() const
179 {
180 return begin_;
181 }
182
184 void
186 const Timestamp& value)
187 {
188 begin_ = value;
189 }
190
192 const Timestamp& end() const
193 {
194 return end_;
195 }
196
198 void
200 const Timestamp& value)
201 {
202 end_ = value;
203 }
204
206 ReplaySpan&
207 operator =(
208 const ReplaySpan& other)
209 {
210 begin_ = other.begin_;
211 end_ = other.end_;
212
213 return *this;
214 }
215};
216
219{
221 enum Enum
222 {
225
228
232 X2 = 2
233 };
234};
235
238template
239<
240 class DataSource,
241 class DataSourceLess = std::less<DataSource>
242>
244{
245public:
247 typedef
248 std::map
249 <
250 DataSource,
251 DataSource,
252 DataSourceLess
253 >
255
258 : settingsUse_(
260 Suggested)
261 , aliases_()
262 , timeSpan_()
263 , speed_(
265 NoDelay)
266 {
267 }
268
271 const ReplaySupplements& other)
272 : settingsUse_(
273 other.settingsUse_)
274 , aliases_(
275 other.aliases_)
276 , timeSpan_(
277 other.timeSpan_)
278 , speed_(
279 other.speed_)
280 {
281 }
282
286 {
287 return settingsUse_;
288 }
289
291 void
294 {
295 settingsUse_ = policy;
296 }
297
303 const
304 Aliases&
305 aliases() const
306 {
307 return aliases_;
308 }
309
316 {
317 return aliases_;
318 }
319
321 const
322 ReplaySpan&
323 timeSpan() const
324 {
325 return timeSpan_;
326 }
327
329 ReplaySpan&
331 {
332 return timeSpan_;
333 }
334
337 speed() const
338 {
339 return speed_;
340 }
341
343 void
345 ReplaySpeed::Enum policy)
346 {
347 speed_ = policy;
348 }
349
352 operator =(
353 const ReplaySupplements& other)
354 {
355 settingsUse_ =
356 other.settingsUse_;
357
358 aliases_ =
359 other.aliases_;
360
361 timeSpan_ =
362 other.timeSpan_;
363
364 speed_ =
365 other.speed_;
366
367 return *this;
368 }
369
370private:
371 HandlerSettingsUse::Enum settingsUse_;
372 Aliases aliases_;
373
374 ReplaySpan timeSpan_;
375 ReplaySpeed::Enum speed_;
376};
377
379typedef
380ReplaySupplements
381<
382 NetFeedId
383>
385
390typedef
393
397: public ReplaySupplements
398 <
401 >
402{
403 typedef
405 <
408 >
409 Base;
410
411 // Not applicable for the PCAP replay as no
412 // parameters are stored in the captured files.
413 using Base::settingsUse;
414
415public:
421
428};
429
434typedef
435PcapReplaySupplements::Aliases
437
443{
444 typedef
446 Base;
447
448 // Not applicable for the Datamine replay as no
449 // parameters are stored in the captured files.
450 using Base::settingsUse;
451
452public:
458
465};
466
470typedef
471DatamineReplaySupplements::Aliases
473
477ONIXS_CONFLATEDUDP_EXPORTED
478void
480 const FileList&,
481 Handler**,
482 size_t,
483 const LogReplaySupplements&);
484
488inline
489void
491 const FileList& logs,
492 Handler& handler,
493 const LogReplaySupplements& supplements)
494{
495 Handler* handlers[] = { &handler };
496
498 logs,
499 handlers,
500 1,
501 supplements);
502}
503
506inline
507void
509 const FileList& logs,
510 Handler** handlers,
511 size_t handlerQty)
512{
514 logs,
515 handlers,
516 handlerQty,
518}
519
522inline
523void
525 const FileList& logs,
526 Handler& handler)
527{
528 Handler* handlers[] = { &handler };
529
530 replayLogFiles(logs, handlers, 1);
531}
532
537
540inline
541void
543 const FileList& logs,
544 Handler** handlers,
545 size_t handlerQty,
547{
548 LogReplaySupplements supplements;
549
550 supplements.
551 settingsUse(
553 AsIs);
554
556 logs,
557 handlers,
558 handlerQty,
559 supplements);
560}
561
564inline
565void
567 const FileList& logs,
568 Handler& handler,
569 const UseHandlerSettingsAsIs& marker)
570{
571 Handler* handlers[] = { &handler };
572
573 replayLogFiles(logs, handlers, 1, marker);
574}
575
578ONIXS_CONFLATEDUDP_EXPORTED
579void
581 const FileList&,
582 Handler**,
583 size_t,
584 const PcapReplaySupplements&);
585
588inline
589void
591 const FileList& logs,
592 Handler& handler,
593 const PcapReplaySupplements& supplements)
594{
595 Handler* handlers[] = { &handler };
596
597 replayPcapFiles(logs, handlers, 1, supplements);
598}
599
602inline
603void
605 const FileList& logs,
606 Handler& handler)
607{
609 logs,
610 handler,
612}
613
616ONIXS_CONFLATEDUDP_EXPORTED
617void
619 const FileList&,
620 Handler**,
621 size_t,
623
626inline
627void
629 const FileList& logs,
630 Handler& handler,
631 const DatamineReplaySupplements& supplements)
632{
633 Handler* handlers[] = { &handler };
634
636 logs,
637 handlers,
638 1,
639 supplements);
640}
641
644inline
645void
647 const FileList& logs,
648 Handler& handler)
649{
651 logs,
652 handler,
654}
655
#define ONIXS_CONFLATEDUDP_LTWT_STRUCT
Definition Bootstrap.h:99
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
Definition Bootstrap.h:95
#define ONIXS_CONFLATEDUDP_EXPORTED_CLASS_DECL(typeName)
Definition Bootstrap.h:47
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition Bootstrap.h:157
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition Bootstrap.h:153
DatamineReplaySupplements()
Initializes settings with the default values.
Definition Replay.h:454
HandlerSettingsUse::Enum settingsUse() const
Definition Replay.h:461
Network feed connection attributes.
Replay supplements for the PCAP replay functionality.
Definition Replay.h:402
PcapReplaySupplements()
Initializes settings with the default values.
Definition Replay.h:417
HandlerSettingsUse::Enum settingsUse() const
Definition Replay.h:424
Defines range of log entries to be replayed.
Definition Replay.h:129
const Timestamp & end() const
Indicates the end of the range.
Definition Replay.h:192
bool empty() const
Indicates whether span is empty or not.
Definition Replay.h:161
void begin(const Timestamp &value)
Updates the beginning of the range.
Definition Replay.h:185
void end(const Timestamp &value)
Indicates the end of the range.
Definition Replay.h:199
ReplaySpan(const Timestamp &begin, const Timestamp &end)
Definition Replay.h:143
const Timestamp & begin() const
Indicates the beginning of the range.
Definition Replay.h:178
bool contain(const Timestamp &timestamp) const
Definition Replay.h:169
ReplaySpan(const ReplaySpan &other)
Definition Replay.h:153
ReplaySpan()
Initializes empty span.
Definition Replay.h:135
ReplaySpeed::Enum speed() const
Indicates processing speed policy.
Definition Replay.h:337
ReplaySupplements()
Initializes the settings with the default values.
Definition Replay.h:257
const ReplaySpan & timeSpan() const
Time span for which entries are to be processed.
Definition Replay.h:323
HandlerSettingsUse::Enum settingsUse() const
Handler settings use policy.
Definition Replay.h:285
void speed(ReplaySpeed::Enum policy)
Defines processing speed.
Definition Replay.h:344
ReplaySpan & timeSpan()
Time span for which entries are to be processed.
Definition Replay.h:330
void settingsUse(HandlerSettingsUse::Enum policy)
Defines handler settings use policy.
Definition Replay.h:292
std::map< DataSource, DataSource, DataSourceLess > Aliases
The table of data source aliases.
Definition Replay.h:254
ReplaySupplements(const ReplaySupplements &other)
Initializes as a copy of the other one.
Definition Replay.h:270
Represents time point without time-zone information.
Definition Time.h:472
void gatherPcapFiles(FileList &files, const std::string &location, const std::string &ext)
Definition Replay.h:97
ONIXS_CONFLATEDUDP_EXPORTED void gatherFiles(FileList &, const std::string &, const std::string &)
PcapReplaySupplements::Aliases NetAddressAliases
Definition Replay.h:436
ONIXS_CONFLATEDUDP_EXPORTED void replayLogFiles(const FileList &, Handler **, size_t, const LogReplaySupplements &)
DatamineReplaySupplements::Aliases ChannelIdAliases
Definition Replay.h:472
ONIXS_CONFLATEDUDP_EXPORTED void replayPcapFiles(const FileList &, Handler **, size_t, const PcapReplaySupplements &)
std::vector< std::string > FileList
Ordered list of logs to be replayed.
Definition Replay.h:47
LogReplaySupplements::Aliases FeedIdAliases
Definition Replay.h:392
ONIXS_CONFLATEDUDP_EXPORTED void replayDatamineFiles(const FileList &, Handler **, size_t, const DatamineReplaySupplements &)
ReplaySupplements< NetFeedId > LogReplaySupplements
Replay supplements for log replay functionality.
Definition Replay.h:384
UInt32 ChannelId
Identifies CME channel.
Definition Domain.h:28
ONIXS_CONFLATEDUDP_EXPORTED void gatherLogFiles(FileList &, ChannelId, const std::string &)
Establishes the order between two connections.
Controls speed of market data replay.
Definition Replay.h:219
Enum
Controls speed of market data replay.
Definition Replay.h:222
@ NoDelay
Replays run at maximal speed.
Definition Replay.h:224
@ Original
Data is replayed with the original speed.
Definition Replay.h:227