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