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