OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.0.3
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/HandlerCore/HandlerLogger.h>
24 
28 
29 #include "HandlerLogger.h"
30 
31 
32 namespace OnixS {
33 namespace Eurex {
34 namespace MarketData {
35 
36 class WarningListener;
37 class HandlerStateListener;
38 class ReferenceDataListener;
39 class DepthListener;
40 class CachedDepthIncrementalListener;
41 class TopOfBookImpliedListener;
42 class ProductStateChangeListener;
43 class MassInstrumentStateChangeListener;
44 class InstrumentStateChangeListener;
45 class QuoteRequestListener;
46 class CrossRequestListener;
47 class ComplexInstrumentUpdateListener;
48 class FlexibleInstrumentUpdateListener;
49 class OrderBookListener;
50 class TradeListener;
51 class SettlementListener;
52 class OpenInterestListener;
53 class ExchangeTradeListener;
54 
55 class ProductSnapshot;
56 class InstrumentSnapshot;
57 class InstrumentIncremental;
58 class VarianceFuturesStatus;
59 class TotalReturnFuturesStatus;
60 class TradeAtReferencePriceStatus;
61 class TopOfBookImplied;
62 class ProductStateChange;
63 class MassInstrumentStateChange;
64 class InstrumentStateChange;
65 class QuoteRequest;
66 class CrossRequest;
67 class ComplexInstrumentUpdate;
68 class FlexibleInstrumentUpdate;
69 class SnapshotTrade;
70 class IncrementalTrade;
71 class OpenInterest;
72 class Settlement;
73 class ExchangeTrade;
74 class OrderBook;
75 class SnapshotTrade;
76 class IncrementalTrade;
77 class DepthSnapshot;
78 class DepthIncremental;
79 
80 
81 namespace Implementation {
82 
83 class ListenerHolder : public Logging::LogFacility
84 {
85  typedef OnixS::Logging::LogFacility base;
86 
87 public:
88  ListenerHolder (const Logging::LogFacility* parent, HandlerCore::Common::HandlerLogger* logger = NULL);
89 
90  /*
91  Assign listeners
92  */
93 
94  void set (ErrorListener* listener);
95  void set (WarningListener* listener);
96  void set (HandlerStateListener* listener);
97  void set (ReferenceDataListener* listener);
98  void set (DepthListener* listener);
99  void set (CachedDepthIncrementalListener* listener);
100  void set (TopOfBookImpliedListener* listener);
101  void set (ProductStateChangeListener* listener);
102  void set (MassInstrumentStateChangeListener* listener);
103  void set (InstrumentStateChangeListener* listener);
104  void set (QuoteRequestListener* listener);
105  void set (CrossRequestListener* listener);
106  void set (ComplexInstrumentUpdateListener* listener);
107  void set (FlexibleInstrumentUpdateListener* listener);
108  void set (OrderBookListener* listener);
109  void set (TradeListener* listener);
110  void set (SettlementListener* listener);
111  void set (OpenInterestListener* listener);
112  void set (ExchangeTradeListener* listener);
113 
114 
115  /*
116  Check availability
117  */
118  bool hasErrorListener () const;
119  bool hasWarningListener () const;
120  bool hasHandlerStateListener () const;
121  bool hasReferenceDataListener () const;
122  bool hasDepthListener () const;
123  bool hasCachedDepthIncrementalListener () const;
124  bool hasTopOfBookImplied () const;
125  bool hasProductStateChangeListener () const;
127  bool hasInstrumentStateChangeListener () const;
128  bool hasQuoteRequestListener () const;
129  bool hasCrossRequestListener () const;
132  bool hasOrderBookListener () const;
133  bool hasTradeListener () const;
134  bool hasSettlementListener () const;
135  bool hasOpenInterestListener () const;
136  bool hasExchangeTradeListener () const;
137 
138  /*
139  User callback's
140  */
141  void invokeError (ErrorCode::Enum code, const std::string& description);
142  void invokeWarning (const std::string& description);
143  void invokeStateChanged (HandlerState::Enum newState);
144 
145  void invokeReferenceDataStart ();
146  void invokeReferenceDataProduct (const ProductSnapshot* msg, const DataSource& dataSource);
147  void invokeReferenceDataInstrument (const InstrumentSnapshot* msg, const DataSource& dataSource);
148  void invokeReferenceDataInstrumentUpdate (const InstrumentIncremental* msg, const DataSource& dataSource);
152 
153  void invokeReferenceDataEnd ();
154  void invokeDepthSnapshot (const DepthSnapshot* msg, const DataSource& dataSource);
155  void invokeDepthIncremental (const DepthIncremental* msg, const DataSource& dataSource);
156  void invokeDepthReset (MarketSegmentId marketSegmentId);
157  void invokeDepthOutOfDate (MarketSegmentId marketSegmentId);
158 
159  void invokeCachedDepthIncremental (const DepthIncremental* msg, const DataSource& dataSource);
160 
161  void invokeTopOfBookImplied (const TopOfBookImplied* msg, const DataSource& dataSource);
162  void invokeProductStateChange (const ProductStateChange* msg, const DataSource& dataSource);
163  void invokeMassInstrumentStateChange (const MassInstrumentStateChange* msg, const DataSource& dataSource);
164  void invokeInstrumentStateChange (const InstrumentStateChange* msg, const DataSource& dataSource);
165  void invokeQuoteRequest (const QuoteRequest* msg, const DataSource& dataSource);
166  void invokeCrossRequest (const CrossRequest* msg, const DataSource& dataSource);
167  void invokeComplexInstrumentUpdate (const ComplexInstrumentUpdate* msg, const DataSource& dataSource);
168  void invokeFlexibleInstrumentUpdate (const FlexibleInstrumentUpdate* msg, const DataSource& dataSource);
169 
170  void invokeOrderBookUpdated (const OrderBook& book);
171  void invokeOrderBookOutOfDate (const OrderBook& book);
172 
173  void invokeSnapshotTrade (const SnapshotTrade& trade);
174  void invokeIncrementalTrade (const IncrementalTrade& trade);
175 
176  void invokeOpenInterest(const OpenInterest* msg, const DataSource& dataSource);
177  void invokeSettlement(const Settlement* msg, const DataSource& dataSource);
178  void invokeExchangeTrade(const ExchangeTrade* msg, const DataSource& dataSource);
179 
180  void invokeExchangeTradeReplayCycleStart (UInt32 mdCount, const DataSource& dataSource);
181  void invokeExchangeTradeReplayCycleEnd (const DataSource& dataSource);
182  void invokeOpenInterestReplayCycleStart (UInt32 mdCount, const DataSource& dataSource);
183  void invokeOpenInterestReplayCycleEnd (const DataSource& dataSource);
184  void invokeSettlementReplayCycleStart (UInt32 mdCount, const DataSource& dataSource);
185  void invokeSettlementReplayCycleEnd (const DataSource& dataSource);
186 
187 
188 private:
189  HandlerCore::Common::HandlerLogger* const logger_;
190 
191  ErrorListener* errorListener_;
192  WarningListener* warningListener_;
193  HandlerStateListener* handlerStateListener_;
194 
195  ReferenceDataListener* referenceDataListener_;
196 
197  DepthListener* depthListener_;
198  CachedDepthIncrementalListener* cachedDepthIncrementalListener_;
199 
200  TopOfBookImpliedListener* topOfBookImplied_;
201  ProductStateChangeListener* productStateChangeListener_;
202  MassInstrumentStateChangeListener* massInstrumentStateChangeListener_;
203  InstrumentStateChangeListener* instrumentStateChangeListener_;
204  QuoteRequestListener* quoteRequestListener_;
205  CrossRequestListener* crossRequestListener_;
206  ComplexInstrumentUpdateListener* complexInstrumentUpdateListener_;
207  FlexibleInstrumentUpdateListener* flexibleInstrumentUpdateListener_;
208 
209  OrderBookListener* orderBookListener_;
210  TradeListener* tradeListener_;
211 
212  SettlementListener* settlementListener_;
213  OpenInterestListener* openInterestListener_;
214  ExchangeTradeListener* exchangeTradeListener_;
215 };
216 
217 
218 }}}}
219 
void invokeExchangeTradeReplayCycleStart(UInt32 mdCount, const DataSource &dataSource)
void invokeSettlement(const Settlement *msg, const DataSource &dataSource)
void invokeSettlementReplayCycleEnd(const DataSource &dataSource)
void invokeQuoteRequest(const QuoteRequest *msg, const DataSource &dataSource)
void invokeComplexInstrumentUpdate(const ComplexInstrumentUpdate *msg, const DataSource &dataSource)
ListenerHolder(const Logging::LogFacility *parent, HandlerCore::Common::HandlerLogger *logger=NULL)
void invokeReferenceDataInstrument(const InstrumentSnapshot *msg, const DataSource &dataSource)
void invokeError(ErrorCode::Enum code, const std::string &description)
void invokeOpenInterest(const OpenInterest *msg, const DataSource &dataSource)
void invokeSettlementReplayCycleStart(UInt32 mdCount, const DataSource &dataSource)
void invokeExchangeTrade(const ExchangeTrade *msg, const DataSource &dataSource)
void invokeDepthOutOfDate(MarketSegmentId marketSegmentId)
unsigned int UInt32
Definition: Numeric.h:41
void invokeInstrumentStateChange(const InstrumentStateChange *msg, const DataSource &dataSource)
Definition: Group.h:25
void invokeReferenceDataTradeAtReferencePriceStatus(const TradeAtReferencePriceStatus *msg, const DataSource &dataSource)
void invokeReferenceDataVarianceFuturesStatus(const VarianceFuturesStatus *msg, const DataSource &dataSource)
void invokeReferenceDataInstrumentUpdate(const InstrumentIncremental *msg, const DataSource &dataSource)
void invokeFlexibleInstrumentUpdate(const FlexibleInstrumentUpdate *msg, const DataSource &dataSource)
void invokeOpenInterestReplayCycleEnd(const DataSource &dataSource)
void invokeCachedDepthIncremental(const DepthIncremental *msg, const DataSource &dataSource)
void invokeOpenInterestReplayCycleStart(UInt32 mdCount, const DataSource &dataSource)
Enum
Known (selected) error codes.
Definition: ErrorListener.h:36
void invokeDepthReset(MarketSegmentId marketSegmentId)
void invokeWarning(const std::string &description)
Enum
Defines the state that the handler is in.
UInt32 MarketSegmentId
Alias for Market Segment ID type.
Definition: Defines.h:40
void invokeDepthIncremental(const DepthIncremental *msg, const DataSource &dataSource)
void invokeDepthSnapshot(const DepthSnapshot *msg, const DataSource &dataSource)
void invokeMassInstrumentStateChange(const MassInstrumentStateChange *msg, const DataSource &dataSource)
void invokeReferenceDataTotalReturnFuturesStatus(const TotalReturnFuturesStatus *msg, const DataSource &dataSource)
void invokeIncrementalTrade(const IncrementalTrade &trade)
void invokeCrossRequest(const CrossRequest *msg, const DataSource &dataSource)
void invokeReferenceDataProduct(const ProductSnapshot *msg, const DataSource &dataSource)
void invokeTopOfBookImplied(const TopOfBookImplied *msg, const DataSource &dataSource)
void invokeExchangeTradeReplayCycleEnd(const DataSource &dataSource)
void invokeProductStateChange(const ProductStateChange *msg, const DataSource &dataSource)