OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.2
API documentation
RdiDataRepositoryGeneric.h
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 #pragma once
20 
21 #include "DataRepository.hpp"
22 #include "ListenerHolder.h"
23 #include "MessageQueue.h"
24 #include "InternalDefines.h"
26 
27 
28 namespace OnixS {
29 namespace Eurex {
30 namespace MarketData {
31 namespace Implementation {
32 
34 
35 
36 class RdiDataRepositoryGeneric : public DataRepository<RdiDataRepositoryConfig>
37 {
38 public:
39  virtual ~RdiDataRepositoryGeneric();
40 
41  void onIncrementalMessage(const DataSource&, const CORE::Message&, TemplateId);
42 
43  bool hasCashedIncrementals() const;
44 
46 
47  virtual
48  void onSnapshotMessage(const DataSource&, const CORE::Message&, TemplateId, bool* skipRestOfPacket) = 0;
49 
52 
55 
58 
59 private:
60  void processBeaconMsg(const DataSource& dataSource, const CORE::Message&);
61 
62  void processIncremental(const DataSource&, const CORE::Message&, TemplateId);
63  void applyIncremental(const DataSource&, const CORE::Message&, TemplateId);
64  void dispatchIncremental(const DataSource&, const CORE::Message&, TemplateId);
65  void enqueueIncremental(const DataSource&, const CORE::Message&, TemplateId);
66 
67  void playCashedIncrementals();
68  void processGapDetected();
69 
70  bool shouldStartRecoveryOnPacketGap() const;
71 
72 protected:
73  explicit RdiDataRepositoryGeneric(const RdiDataRepositoryConfig&);
74 
75  void finishRecovery();
76 
77  void apply(const ProductSnapshot&, const DataSource&);
78  void apply(const InstrumentSnapshot&, const DataSource&);
79  void apply(const InstrumentIncremental&, const DataSource&);
80  void apply(const VarianceFuturesStatus&, const DataSource&);
81  void apply(const TotalReturnFuturesStatus&, const DataSource&);
82  void apply(const TradeAtReferencePriceStatus&, const DataSource&);
83 
84 
85  // for testing
86  bool& synchronized() { return synchronized_; }
87  unsigned int& nextIncrementalMsgSeqNum() { return nextIncrementalMsgSeqNum_; }
88  void referenceDataReady() { return descriptors_.referenceDataReady(); }
89 
91 
92  bool senderCompIdChanged(UInt32 value);
93 
94 private:
95  bool synchronized_;
96 
97  SequenceNumber nextIncrementalMsgSeqNum_;
98  UInt32 senderCompId_;
99 
100  MessageQueue cachedIncremetalQueue_;
101 
102  InterfaceDescriptorBuilder descriptors_;
103 };
104 
105 
106 
107 }}}}
unsigned int SequenceNumber
Alias for sequence numbers.
EobiDescriptor::Collection EobiDescriptors
unsigned int UInt32
Definition: Numeric.h:41
Definition: Defines.h:30
DataRepositoryConfig< ListenerHolder, RdiHandlerSettings > RdiDataRepositoryConfig
EmdiDescriptor::Collection EmdiDescriptors
MdiDescriptor::Collection MdiDescriptors
virtual void onSnapshotMessage(const DataSource &, const CORE::Message &, TemplateId, bool *skipRestOfPacket)=0
void onIncrementalMessage(const DataSource &, const CORE::Message &, TemplateId)
OnixS::FIX::Core::FAST::TemplateId TemplateId
IInterfaceDescriptorProvider::MarketSegments MarketSegments