OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  11.0.0
API documentation
MdiHandler.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 
20 #pragma once
21 
25 
26 namespace OnixS
27 {
28  namespace Eurex
29  {
30  namespace MarketData
31  {
32  ONIXS_EUREX_EMDI_API_DECL(class, FeedEngine);
33 
34  struct ReplayOptions;
35  struct MdiHandlerSettings;
36 
37  class CrossRequestListener;
38  class FlexibleInstrumentUpdateListener;
39  class HandlerStateListener;
40  class InstrumentStateChangeListener;
41  class InterfaceDescriptorProvider;
42  class MassInstrumentStateChangeListener;
43  class OrderBookListener;
44  class TopOfBookImpliedListener;
45  class ProductStateChangeListener;
46  class QuoteRequestListener;
47  class TradeListener;
48  class WarningListener;
49  class DepthListener;
50  class ComplexInstrumentUpdateListener;
51  class ErrorListener;
52  class CachedDepthIncrementalListener;
53 
54 
55  /// Eurex Market Data Interface Handler.
56  class ONIXS_EUREX_EMDI_API MdiHandler
57  {
58  public:
59  /// Performs instance initialization.
60  /// @param settings defines values for various options
61  /// which affect handler behavior like enabling logging
62  /// during execution of the handler.
63  explicit
64  MdiHandler (const MdiHandlerSettings& settings,
65  const std::string& = ONIXS_COMPILER_INFO);
66 
67  /// Finalizes the Handler.
68  virtual ~MdiHandler();
69 
70  /// Assigns listener for errors occurred while executing handler.
71  /// It's permissible to change the listener multiple times during
72  /// handler's life-time, but only when handler is in disconnected state.
73  /// @throw OperationException if handler not disconnected
74  void registerErrorListener (ErrorListener* listener);
75 
76  /// Assigns listener for warnings occurred while executing handler.
77  /// It's permissible to change the listener multiple times during
78  /// handler's life-time, but only when handler is in disconnected state.
79  /// @throw OperationException if handler not disconnected
80  void registerWarningListener (WarningListener* listener);
81 
82  /// Assigns listener for state change events occurred while executing handler.
83  /// It's permissible to change the listener multiple times during
84  /// handler's life-time, but only when handler is in disconnected state.
85  /// @throw OperationException if handler not disconnected.
86  void registerHandlerStateListener (HandlerStateListener* listener);
87 
88  /// Assigns listener for depth messages received while executing handler.
89  /// It's permissible to change the listener multiple times during
90  /// handler's life-time, but only when handler is in disconnected state.
91  /// @throw OperationException if handler not disconnected.
92  void registerDepthListener (DepthListener* listener);
93 
94  /// Assigns listener for depth incremental messages received during recovery process.
95  /// It's permissible to change the listener multiple times during
96  /// handler's life-time, but only when handler is in disconnected state.
97  /// @throw OperationException if handler not disconnected.
98  void registerCachedDepthIncrementalListener (CachedDepthIncrementalListener* listener);
99 
100  /// Assigns listener for Top Of Book Implied message received while executing handler.
101  /// It's permissible to change the listener multiple times during
102  /// handler's life-time, but only when handler is in disconnected state.
103  /// @throw OperationException if handler not disconnected.
104  void registerTopOfBookImpliedListener (TopOfBookImpliedListener* listener);
105 
106  /// Assigns listener for Product State Change message received while executing handler.
107  /// It's permissible to change the listener multiple times during
108  /// handler's life-time, but only when handler is in disconnected state.
109  /// @throw OperationException if handler not disconnected.
110  void registerProductStateChangeListener (ProductStateChangeListener* listener);
111 
112  /// Assigns listener for Mass Instrument State Change message received while executing handler.
113  /// It's permissible to change the listener multiple times during
114  /// handler's life-time, but only when handler is in disconnected state.
115  /// @throw OperationException if handler not disconnected.
116  void registerMassInstrumentStateChangeListener (MassInstrumentStateChangeListener* listener);
117 
118  /// Assigns listener for Instrument State Change message received while executing handler.
119  /// It's permissible to change the listener multiple times during
120  /// handler's life-time, but only when handler is in disconnected state.
121  /// @throw OperationException if handler not disconnected.
122  void registerInstrumentStateChangeListener (InstrumentStateChangeListener* listener);
123 
124  /// Assigns listener for Quote Request message received while executing handler.
125  /// It's permissible to change the listener multiple times during
126  /// handler's life-time, but only when handler is in disconnected state.
127  /// @throw OperationException if handler not disconnected.
128  void registerQuoteRequestListener (QuoteRequestListener* listener);
129 
130  /// Assigns listener for Cross Request message received while executing handler.
131  /// It's permissible to change the listener multiple times during
132  /// handler's life-time, but only when handler is in disconnected state.
133  /// @throw OperationException if handler not disconnected.
134  void registerCrossRequestListener (CrossRequestListener* listener);
135 
136  /// Assigns listener for Complex Instrument Update message received while executing handler.
137  /// It's permissible to change the listener multiple times during
138  /// handler's life-time, but only when handler is in disconnected state.
139  /// @throw OperationException if handler not disconnected.
140  void registerComplexInstrumentUpdateListener (ComplexInstrumentUpdateListener* listener);
141 
142  /// Assigns listener for Flexible Instrument Update message received while executing handler.
143  /// It's permissible to change the listener multiple times during
144  /// handler's life-time, but only when handler is in disconnected state.
145  /// @throw OperationException if handler not disconnected.
146  void registerFlexibleInstrumentUpdateListener (FlexibleInstrumentUpdateListener* listener);
147 
148  /// Assigns listener for Order Book updates received while executing handler.
149  /// It's permissible to change the listener multiple times during
150  /// handler's life-time, but only when handler is in disconnected state.
151  /// @throw OperationException if handler not disconnected.
152  void registerOrderBookListener (OrderBookListener* listener);
153 
154  /// Assigns listener for trades received while executing handler.
155  /// It's permissible to change the listener multiple times during
156  /// handler's life-time, but only when handler is in disconnected state.
157  /// @throw OperationException if handler not disconnected.
158  void registerTradeListener (TradeListener* listener);
159 
160  /// Set market segment to maximum number of price levels for the product map
161  ///
162  /// @note Should be provided if EmdiHandlerSettings::buildInternalOrderBooks is true.
163  void setMarketSegmentId2Depth(const MarketSegmentId2Depth& map);
164 
165  /// Set the Market Segment Id filtering values.
166  ///
167  /// @note The filter is inclusive.
168  void setMarketSegmentIdFilters (const MarketSegmentIdFilters& filters);
169 
170  /// Remove all filters.
171  void removeAllMarketSegmentIdFilters();
172 
173  /// Set the Security Id filtering values.
174  ///
175  /// @note The filter is inclusive.
176  void setSecurityIdFilters (const SecurityIdFilters& filters);
177 
178  /// Remove all filters.
179  void removeAllSecurityIdFilters();
180 
181  /// Binds Feed Engine to the Handler.
182  ///
183  /// Handler must be in stopped state.
184  ///
185  /// @throw OperationException in case when handler is not in configurable state.
186  void bindFeedEngine(FeedEngine& feedEngine);
187 
188  /// Start handler.
189  ///
190  /// @note This action is asynchronous.
191  /// @throw std::exception in case of unable to start.
192  void start ();
193 
194  /// Starts replaying previously logged data.
195  void start (const ReplayOptions& options);
196 
197  /// Stop handler.
198  void stop ();
199 
200  /// Returns handler state.
201  HandlerState::Enum state () const;
202 
203  /// Logs the given user-level message to the handler log.
204  void log (LogLevel::Enum logLevel, const char* logMessage, size_t length);
205 
206  /// Logs the given user-level message to the handler log
207  void log (LogLevel::Enum logLevel, const char* logMessage);
208 
209  /// Logs the given user-level message to the handler log.
210  void log (LogLevel::Enum logLevel, const std::string& str);
211 
212  /// Returns the license expiration date.
213  const char* licenseExpirationDate () const;
214 
215  /// Returns Handler's version.
216  static const char* version ();
217 
218  private:
219  MdiHandler (const MdiHandler&); //no implementation
220  MdiHandler& operator = (const MdiHandler&); //no implementation
221 
222  private:
223  struct Impl;
224  Impl* impl_;
225  };
226 
227  }
228  }
229 }
Manages processing machinery for market data received from feeds.
Definition: FeedEngine.h:337
MarketDepthTraits::MarketSegmentId2Depth MarketSegmentId2Depth
MDI handler configuration settings.
Eurex Market Data Interface Handler.
Definition: MdiHandler.h:56
Definition: Defines.h:30
FilteringTraits::MarketSegmentIdFilters MarketSegmentIdFilters
Defines params which affect logs replay.
Definition: Replay.h:77
ONIXS_EUREX_EMDI_API_DECL(class, Message)
FilteringTraits::SecurityIdFilters SecurityIdFilters
Enum
Defines the state that the handler is in.