OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.2
API documentation
ListenerHolder.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*
4 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
5 *
6 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
7 * and international copyright treaties.
8 *
9 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
10 * Services Agreement (the Agreement) and Customer end user license agreements granting
11 * a non-assignable, non-transferable and non-exclusive license to use the software
12 * for it's own data processing purposes under the terms defined in the Agreement.
13 *
14 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
15 * of this source code or associated reference material to any other location for further reproduction
16 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
17 *
18 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
19 * the terms of the Agreement is a violation of copyright law.
20 */
21 #pragma once
22 
23 #include <OnixS/Core/Bootstrap/Compiler.h>
24 #include <OnixS/HandlerCore/HandlerLogger.h>
25 
29 
30 #include "HandlerLogger.h"
31 
32 
33 namespace OnixS {
34 namespace Eurex {
35 namespace MarketData {
36 
37 class WarningListener;
38 class HandlerStateListener;
39 class ReferenceDataListener;
40 class DepthListener;
41 class CachedDepthIncrementalListener;
42 class TopOfBookImpliedListener;
43 class ProductStateChangeListener;
44 class MassInstrumentStateChangeListener;
45 class InstrumentStateChangeListener;
46 class QuoteRequestListener;
47 class CrossRequestListener;
48 class ComplexInstrumentUpdateListener;
49 class FlexibleInstrumentUpdateListener;
50 class OrderBookListener;
51 class TradeListener;
52 class SettlementListener;
53 class OpenInterestListener;
54 class ExchangeTradeListener;
55 
56 class ProductSnapshot;
57 class InstrumentSnapshot;
58 class InstrumentIncremental;
59 class VarianceFuturesStatus;
60 class TotalReturnFuturesStatus;
61 class TradeAtReferencePriceStatus;
62 class TopOfBookImplied;
63 class ProductStateChange;
64 class MassInstrumentStateChange;
65 class InstrumentStateChange;
66 class QuoteRequest;
67 class CrossRequest;
68 class ComplexInstrumentUpdate;
69 class FlexibleInstrumentUpdate;
70 class SnapshotTrade;
71 class IncrementalTrade;
72 class OpenInterest;
73 class Settlement;
74 class ExchangeTrade;
75 class OrderBook;
76 class SnapshotTrade;
77 class IncrementalTrade;
78 class DepthSnapshot;
79 class DepthIncremental;
80 
81 
82 namespace Implementation {
83 
84 class ListenerHolder : public Logging::LogFacility
85 {
86  typedef OnixS::Logging::LogFacility base;
87 
88 public:
89  explicit
90  ListenerHolder (const Logging::LogFacility* parent, HandlerCore::Common::HandlerLogger* logger = nullptr);
91 
92  /*
93  Assign listeners
94  */
95 
96  void set (ErrorListener* listener) ONIXS_NOEXCEPT;
97  void set (WarningListener* listener) ONIXS_NOEXCEPT;
98  void set (HandlerStateListener* listener) ONIXS_NOEXCEPT;
99  void set (ReferenceDataListener* listener) ONIXS_NOEXCEPT;
100  void set (DepthListener* listener) ONIXS_NOEXCEPT;
101  void set (CachedDepthIncrementalListener* listener) ONIXS_NOEXCEPT;
102  void set (TopOfBookImpliedListener* listener) ONIXS_NOEXCEPT;
103  void set (ProductStateChangeListener* listener) ONIXS_NOEXCEPT;
104  void set (MassInstrumentStateChangeListener* listener) ONIXS_NOEXCEPT;
105  void set (InstrumentStateChangeListener* listener) ONIXS_NOEXCEPT;
106  void set (QuoteRequestListener* listener) ONIXS_NOEXCEPT;
107  void set (CrossRequestListener* listener) ONIXS_NOEXCEPT;
108  void set (ComplexInstrumentUpdateListener* listener) ONIXS_NOEXCEPT;
109  void set (FlexibleInstrumentUpdateListener* listener) ONIXS_NOEXCEPT;
110  void set (OrderBookListener* listener) ONIXS_NOEXCEPT;
111  void set (TradeListener* listener) ONIXS_NOEXCEPT;
112  void set (SettlementListener* listener) ONIXS_NOEXCEPT;
113  void set (OpenInterestListener* listener) ONIXS_NOEXCEPT;
114  void set (ExchangeTradeListener* listener) ONIXS_NOEXCEPT;
115 
116 
117  /*
118  Check availability
119  */
120  bool hasErrorListener () const ONIXS_NOEXCEPT;
121  bool hasWarningListener () const ONIXS_NOEXCEPT;
122  bool hasHandlerStateListener () const ONIXS_NOEXCEPT;
123  bool hasReferenceDataListener () const ONIXS_NOEXCEPT;
124  bool hasDepthListener () const ONIXS_NOEXCEPT;
125  bool hasCachedDepthIncrementalListener () const ONIXS_NOEXCEPT;
126  bool hasTopOfBookImplied () const ONIXS_NOEXCEPT;
127  bool hasProductStateChangeListener () const ONIXS_NOEXCEPT;
128  bool hasMassInstrumentStateChangeListener () const ONIXS_NOEXCEPT;
129  bool hasInstrumentStateChangeListener () const ONIXS_NOEXCEPT;
130  bool hasQuoteRequestListener () const ONIXS_NOEXCEPT;
131  bool hasCrossRequestListener () const ONIXS_NOEXCEPT;
132  bool hasComplexInstrumentUpdateListener () const ONIXS_NOEXCEPT;
133  bool hasFlexibleInstrumentUpdateListener () const ONIXS_NOEXCEPT;
134  bool hasOrderBookListener () const ONIXS_NOEXCEPT;
135  bool hasTradeListener () const ONIXS_NOEXCEPT;
136  bool hasSettlementListener () const ONIXS_NOEXCEPT;
137  bool hasOpenInterestListener () const ONIXS_NOEXCEPT;
138  bool hasExchangeTradeListener () const ONIXS_NOEXCEPT;
139 
140  /*
141  User callback's
142  */
143  void invokeError (ErrorCode::Enum code, const std::string& description) ONIXS_NOEXCEPT;
144  void invokeWarning (const std::string& description) ONIXS_NOEXCEPT;
145  void invokeStateChanged (HandlerState::Enum newState) ONIXS_NOEXCEPT;
146 
147  void invokeReferenceDataStart () ONIXS_NOEXCEPT;
148  void invokeReferenceDataProduct (const ProductSnapshot* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
149  void invokeReferenceDataInstrument (const InstrumentSnapshot* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
150  void invokeReferenceDataInstrumentUpdate (const InstrumentIncremental* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
151  void invokeReferenceDataVarianceFuturesStatus (const VarianceFuturesStatus* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
152  void invokeReferenceDataTotalReturnFuturesStatus (const TotalReturnFuturesStatus* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
153  void invokeReferenceDataTradeAtReferencePriceStatus (const TradeAtReferencePriceStatus* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
154 
155  void invokeReferenceDataEnd () ONIXS_NOEXCEPT;
156  void invokeDepthSnapshot (const DepthSnapshot* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
157  void invokeDepthIncremental (const DepthIncremental* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
158  void invokeDepthReset (MarketSegmentId marketSegmentId) ONIXS_NOEXCEPT;
159  void invokeDepthOutOfDate (MarketSegmentId marketSegmentId) ONIXS_NOEXCEPT;
160 
161  void invokeCachedDepthIncremental (const DepthIncremental* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
162 
163  void invokeTopOfBookImplied (const TopOfBookImplied* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
164  void invokeProductStateChange (const ProductStateChange* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
165  void invokeMassInstrumentStateChange (const MassInstrumentStateChange* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
166  void invokeInstrumentStateChange (const InstrumentStateChange* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
167  void invokeQuoteRequest (const QuoteRequest* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
168  void invokeCrossRequest (const CrossRequest* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
169  void invokeComplexInstrumentUpdate (const ComplexInstrumentUpdate* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
170  void invokeFlexibleInstrumentUpdate (const FlexibleInstrumentUpdate* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
171 
172  void invokeOrderBookUpdated (const OrderBook& book) ONIXS_NOEXCEPT;
173  void invokeOrderBookOutOfDate (const OrderBook& book) ONIXS_NOEXCEPT;
174 
175  void invokeSnapshotTrade (const SnapshotTrade& trade) ONIXS_NOEXCEPT;
176  void invokeIncrementalTrade (const IncrementalTrade& trade) ONIXS_NOEXCEPT;
177 
178  void invokeOpenInterest(const OpenInterest* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
179  void invokeSettlement(const Settlement* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
180  void invokeExchangeTrade(const ExchangeTrade* msg, const DataSource& dataSource) ONIXS_NOEXCEPT;
181 
182  void invokeExchangeTradeReplayCycleStart (UInt32 mdCount, const DataSource& dataSource) ONIXS_NOEXCEPT;
183  void invokeExchangeTradeReplayCycleEnd (const DataSource& dataSource) ONIXS_NOEXCEPT;
184  void invokeOpenInterestReplayCycleStart (UInt32 mdCount, const DataSource& dataSource) ONIXS_NOEXCEPT;
185  void invokeOpenInterestReplayCycleEnd (const DataSource& dataSource) ONIXS_NOEXCEPT;
186  void invokeSettlementReplayCycleStart (UInt32 mdCount, const DataSource& dataSource) ONIXS_NOEXCEPT;
187  void invokeSettlementReplayCycleEnd (const DataSource& dataSource) ONIXS_NOEXCEPT;
188 
189 
190 private:
191  HandlerCore::Common::HandlerLogger* const logger_;
192 
193  ErrorListener* errorListener_;
194  WarningListener* warningListener_;
195  HandlerStateListener* handlerStateListener_;
196 
197  ReferenceDataListener* referenceDataListener_;
198 
199  DepthListener* depthListener_;
200  CachedDepthIncrementalListener* cachedDepthIncrementalListener_;
201 
202  TopOfBookImpliedListener* topOfBookImplied_;
203  ProductStateChangeListener* productStateChangeListener_;
204  MassInstrumentStateChangeListener* massInstrumentStateChangeListener_;
205  InstrumentStateChangeListener* instrumentStateChangeListener_;
206  QuoteRequestListener* quoteRequestListener_;
207  CrossRequestListener* crossRequestListener_;
208  ComplexInstrumentUpdateListener* complexInstrumentUpdateListener_;
209  FlexibleInstrumentUpdateListener* flexibleInstrumentUpdateListener_;
210 
211  OrderBookListener* orderBookListener_;
212  TradeListener* tradeListener_;
213 
214  SettlementListener* settlementListener_;
215  OpenInterestListener* openInterestListener_;
216  ExchangeTradeListener* exchangeTradeListener_;
217 };
218 
219 
220 }}}}
221 
void invokeFlexibleInstrumentUpdate(const FlexibleInstrumentUpdate *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeTopOfBookImplied(const TopOfBookImplied *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeExchangeTradeReplayCycleStart(UInt32 mdCount, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeIncrementalTrade(const IncrementalTrade &trade) ONIXS_NOEXCEPT
void invokeComplexInstrumentUpdate(const ComplexInstrumentUpdate *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeOpenInterest(const OpenInterest *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeReferenceDataTradeAtReferencePriceStatus(const TradeAtReferencePriceStatus *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeSettlementReplayCycleStart(UInt32 mdCount, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeMassInstrumentStateChange(const MassInstrumentStateChange *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeSettlement(const Settlement *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeOpenInterestReplayCycleEnd(const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeDepthReset(MarketSegmentId marketSegmentId) ONIXS_NOEXCEPT
void invokeCachedDepthIncremental(const DepthIncremental *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeError(ErrorCode::Enum code, const std::string &description) ONIXS_NOEXCEPT
void invokeInstrumentStateChange(const InstrumentStateChange *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeOrderBookUpdated(const OrderBook &book) ONIXS_NOEXCEPT
void invokeSettlementReplayCycleEnd(const DataSource &dataSource) ONIXS_NOEXCEPT
unsigned int UInt32
Definition: Numeric.h:41
Definition: Defines.h:30
void invokeSnapshotTrade(const SnapshotTrade &trade) ONIXS_NOEXCEPT
void invokeStateChanged(HandlerState::Enum newState) ONIXS_NOEXCEPT
void invokeQuoteRequest(const QuoteRequest *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeDepthOutOfDate(MarketSegmentId marketSegmentId) ONIXS_NOEXCEPT
void invokeOrderBookOutOfDate(const OrderBook &book) ONIXS_NOEXCEPT
void invokeOpenInterestReplayCycleStart(UInt32 mdCount, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeDepthSnapshot(const DepthSnapshot *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
Enum
Known (selected) error codes.
Definition: ErrorListener.h:36
void invokeReferenceDataTotalReturnFuturesStatus(const TotalReturnFuturesStatus *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
Enum
Defines the state that the handler is in.
void invokeReferenceDataInstrument(const InstrumentSnapshot *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
UInt32 MarketSegmentId
Alias for Market Segment ID type.
Definition: Defines.h:40
void invokeProductStateChange(const ProductStateChange *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeWarning(const std::string &description) ONIXS_NOEXCEPT
void invokeExchangeTradeReplayCycleEnd(const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeReferenceDataProduct(const ProductSnapshot *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
ListenerHolder(const Logging::LogFacility *parent, HandlerCore::Common::HandlerLogger *logger=nullptr)
void invokeReferenceDataInstrumentUpdate(const InstrumentIncremental *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeCrossRequest(const CrossRequest *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeExchangeTrade(const ExchangeTrade *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeDepthIncremental(const DepthIncremental *msg, const DataSource &dataSource) ONIXS_NOEXCEPT
void invokeReferenceDataVarianceFuturesStatus(const VarianceFuturesStatus *msg, const DataSource &dataSource) ONIXS_NOEXCEPT