OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  11.0.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  const std::string& = ONIXS_COMPILER_INFO);
60 
61  /// Finalizes the Handler.
62  virtual ~MdiHandlerManager();
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  /// Stop manager.
149  void stop ();
150 
151  private:
152  MdiHandlerManager(const MdiHandlerManager&); //no implementation
153  MdiHandlerManager& operator = (const MdiHandlerManager&); //no implementation
154 
155  private:
156  struct Impl;
157  Impl* impl_;
158 
159  ErrorListener* errorListener_;
160  WarningListener* warningListener_;
161  DepthListener* depthListener_;
162  TopOfBookImpliedListener* topOfBookImpliedListener_;
163  ProductStateChangeListener* productStateChangeListener_;
164  MassInstrumentStateChangeListener* massInstrumentStateChangeListener_;
165  InstrumentStateChangeListener* instrumentStateChangeListener_;
166  QuoteRequestListener* quoteRequestListener_;
167  CrossRequestListener* crossRequestListener_;
168  ComplexInstrumentUpdateListener* complexInstrumentUpdateListener_;
169  FlexibleInstrumentUpdateListener* flexibleInstrumentUpdateListener_;
170  OrderBookListener* orderBookListener_;
171  TradeListener* tradeListener_;
172  };
173 
174  }
175  }
176 }
Manages processing machinery for market data received from feeds.
Definition: FeedEngine.h:337
MDI handler configuration settings.
Definition: Defines.h:30
IInterfaceDescriptorProvider::MarketSegments MarketSegments