OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers  12.1.0
API documentation
EmdiHandlerManager.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 
22 #include <vector>
23 
27 
28 namespace OnixS
29 {
30  namespace Eurex
31  {
32  namespace MarketData
33  {
34  struct EmdiHandlerSettings;
35  class FeedEngine;
36  class ErrorListener;
37  class WarningListener;
38  class DepthListener;
39  class TopOfBookImpliedListener;
40  class ProductStateChangeListener;
41  class MassInstrumentStateChangeListener;
42  class InstrumentStateChangeListener;
43  class QuoteRequestListener;
44  class CrossRequestListener;
45  class ComplexInstrumentUpdateListener;
46  class FlexibleInstrumentUpdateListener;
47  class OrderBookListener;
48  class TradeListener;
49 
50  /// EMDI Handler Manager.
51  class ONIXS_EUREX_EMDI_API EmdiHandlerManager
52  {
53  public:
54  /// Performs instance initialization.
55  /// @param settings defines values for various options
56  /// which affect handler behavior like enabling logging
57  /// during execution of the handler.
58  explicit EmdiHandlerManager (const EmdiHandlerSettings& settings,
59  const std::string& = ONIXS_COMPILER_INFO);
60 
61  /// Finalizes the Handler.
62  virtual ~EmdiHandlerManager();
63 
64  /// Assigns listener for errors occurred while executing handler.
65  /// It's permissible to change the listener multiple times during
66  /// handler's life-time, but only when handler is in disconnected state.
67  /// @throw OperationException if handler not disconnected
68  void registerErrorListener (ErrorListener* listener);
69 
70  /// Assigns listener for warnings 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 registerWarningListener (WarningListener* listener);
75 
76  /// Assigns listener for depth messages received 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 registerDepthListener (DepthListener* listener);
81 
82  /// Assigns listener for Top Of Book Implied message received 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 registerTopOfBookImpliedListener (TopOfBookImpliedListener* listener);
87 
88  /// Assigns listener for Product State Change message 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 registerProductStateChangeListener (ProductStateChangeListener* listener);
93 
94  /// Assigns listener for Mass Instrument State Change message received while executing handler.
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 registerMassInstrumentStateChangeListener (MassInstrumentStateChangeListener* listener);
99 
100  /// Assigns listener for Instrument State Change 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 registerInstrumentStateChangeListener (InstrumentStateChangeListener* listener);
105 
106  /// Assigns listener for Quote Request 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 registerQuoteRequestListener (QuoteRequestListener* listener);
111 
112  /// Assigns listener for Cross Request 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 registerCrossRequestListener (CrossRequestListener* listener);
117 
118  /// Assigns listener for Complex Instrument Update 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 registerComplexInstrumentUpdateListener (ComplexInstrumentUpdateListener* listener);
123 
124  /// Assigns listener for Flexible Instrument Update 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 registerFlexibleInstrumentUpdateListener (FlexibleInstrumentUpdateListener* listener);
129 
130  /// Assigns listener for Order Book updates 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 registerOrderBookListener (OrderBookListener* listener);
135 
136  /// Assigns listener for trades 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 registerTradeListener (TradeListener* listener);
141 
142  /// Start manager.
143  ///
144  /// @note This action is asynchronous.
145  /// @throw std::exception in case of unable to start all necessary EMDI handlers.
146  void start (const IInterfaceDescriptorProvider* provider, const MarketSegments& productNames, FeedEngine& feedEngine);
147 
148  /// Replay pcap files.
149  void replayPcap (const IInterfaceDescriptorProvider* provider, const MarketSegments& productNames, const ReplayOptions& options);
150 
151  /// Stop manager.
152  void stop ();
153 
154  private:
155  EmdiHandlerManager (const EmdiHandlerManager&); //no implementation
156  EmdiHandlerManager& operator = (const EmdiHandlerManager&); //no implementation
157 
158  void prepareHandlers(const IInterfaceDescriptorProvider* provider, const MarketSegments& productNames);
159 
160  private:
161  struct Impl;
162  Impl* impl_;
163 
164  ErrorListener* errorListener_;
165  WarningListener* warningListener_;
166  DepthListener* depthListener_;
167  TopOfBookImpliedListener* topOfBookImpliedListener_;
168  ProductStateChangeListener* productStateChangeListener_;
169  MassInstrumentStateChangeListener* massInstrumentStateChangeListener_;
170  InstrumentStateChangeListener* instrumentStateChangeListener_;
171  QuoteRequestListener* quoteRequestListener_;
172  CrossRequestListener* crossRequestListener_;
173  ComplexInstrumentUpdateListener* complexInstrumentUpdateListener_;
174  FlexibleInstrumentUpdateListener* flexibleInstrumentUpdateListener_;
175  OrderBookListener* orderBookListener_;
176  TradeListener* tradeListener_;
177  };
178 
179  }
180  }
181 }
Manages processing machinery for market data received from feeds.
Definition: FeedEngine.h:337
Definition: Defines.h:30
Defines params which affect replay.
Definition: Replay.h:82
ONIXS_EUREX_EMDI_API void replayPcap(const std::vector< EmdiHandler * > &handlers, const ReplayOptions &options)
Replay pcap files.
EMDI handler configuration settings.
IInterfaceDescriptorProvider::MarketSegments MarketSegments