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