OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers  17.0.1
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 
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 MdiHandlerManager
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
59  MdiHandlerManager(const MdiHandlerSettings& settings,
60  const std::string& = ONIXS_EUREX_EMDI_COMPILER_INFO);
61 
62  /// Finalizes the Handler.
63  virtual ~MdiHandlerManager();
64 
65  /// Assigns listener for errors occurred while executing handler.
66  /// It's permissible to change the listener multiple times during
67  /// handler's life-time, but only when handler is in disconnected state.
68  /// @throw OperationException if handler not disconnected
69  MdiHandlerManager& registerErrorListener (ErrorListener* listener);
70 
71  /// Assigns listener for warnings occurred while executing handler.
72  /// It's permissible to change the listener multiple times during
73  /// handler's life-time, but only when handler is in disconnected state.
74  /// @throw OperationException if handler not disconnected
75  MdiHandlerManager& registerWarningListener (WarningListener* listener);
76 
77  /// Assigns listener for depth messages received while executing handler.
78  /// It's permissible to change the listener multiple times during
79  /// handler's life-time, but only when handler is in disconnected state.
80  /// @throw OperationException if handler not disconnected.
81  MdiHandlerManager& registerDepthListener (DepthListener* listener);
82 
83  /// Assigns listener for Top Of Book Implied message received while executing handler.
84  /// It's permissible to change the listener multiple times during
85  /// handler's life-time, but only when handler is in disconnected state.
86  /// @throw OperationException if handler not disconnected.
87  MdiHandlerManager& registerTopOfBookImpliedListener (TopOfBookImpliedListener* listener);
88 
89  /// Assigns listener for Product State Change message received while executing handler.
90  /// It's permissible to change the listener multiple times during
91  /// handler's life-time, but only when handler is in disconnected state.
92  /// @throw OperationException if handler not disconnected.
93  MdiHandlerManager& registerProductStateChangeListener (ProductStateChangeListener* listener);
94 
95  /// Assigns listener for Mass Instrument State Change message received while executing handler.
96  /// It's permissible to change the listener multiple times during
97  /// handler's life-time, but only when handler is in disconnected state.
98  /// @throw OperationException if handler not disconnected.
99  MdiHandlerManager& registerMassInstrumentStateChangeListener (MassInstrumentStateChangeListener* listener);
100 
101  /// Assigns listener for Instrument State Change message received while executing handler.
102  /// It's permissible to change the listener multiple times during
103  /// handler's life-time, but only when handler is in disconnected state.
104  /// @throw OperationException if handler not disconnected.
105  MdiHandlerManager& registerInstrumentStateChangeListener (InstrumentStateChangeListener* listener);
106 
107  /// Assigns listener for Quote Request message received while executing handler.
108  /// It's permissible to change the listener multiple times during
109  /// handler's life-time, but only when handler is in disconnected state.
110  /// @throw OperationException if handler not disconnected.
111  MdiHandlerManager& registerQuoteRequestListener (QuoteRequestListener* listener);
112 
113  /// Assigns listener for Cross Request message received while executing handler.
114  /// It's permissible to change the listener multiple times during
115  /// handler's life-time, but only when handler is in disconnected state.
116  /// @throw OperationException if handler not disconnected.
117  MdiHandlerManager& registerCrossRequestListener (CrossRequestListener* listener);
118 
119  /// Assigns listener for Complex Instrument Update message received while executing handler.
120  /// It's permissible to change the listener multiple times during
121  /// handler's life-time, but only when handler is in disconnected state.
122  /// @throw OperationException if handler not disconnected.
123  MdiHandlerManager& registerComplexInstrumentUpdateListener (ComplexInstrumentUpdateListener* listener);
124 
125  /// Assigns listener for Flexible Instrument Update message received while executing handler.
126  /// It's permissible to change the listener multiple times during
127  /// handler's life-time, but only when handler is in disconnected state.
128  /// @throw OperationException if handler not disconnected.
129  MdiHandlerManager& registerFlexibleInstrumentUpdateListener (FlexibleInstrumentUpdateListener* listener);
130 
131  /// Assigns listener for Order Book updates received while executing handler.
132  /// It's permissible to change the listener multiple times during
133  /// handler's life-time, but only when handler is in disconnected state.
134  /// @throw OperationException if handler not disconnected.
135  MdiHandlerManager& registerOrderBookListener (OrderBookListener* listener);
136 
137  /// Assigns listener for trades received while executing handler.
138  /// It's permissible to change the listener multiple times during
139  /// handler's life-time, but only when handler is in disconnected state.
140  /// @throw OperationException if handler not disconnected.
141  MdiHandlerManager& registerTradeListener (TradeListener* listener);
142 
143  /// Start manager.
144  ///
145  /// @note This action is asynchronous.
146  /// @throw std::exception in case of unable to start all necessary EMDI handlers.
147  void start (const IInterfaceDescriptorProvider* provider, const MarketSegments& productNames, FeedEngine& feedEngine);
148 
149  /// Replay pcap files.
150  void replayPcap (const IInterfaceDescriptorProvider* provider, const MarketSegments& productNames, const ReplayOptions& options);
151 
152  /// Stop manager.
153  void stop ();
154 
155  private:
156  MdiHandlerManager(const MdiHandlerManager&); //no implementation
157  MdiHandlerManager& operator = (const MdiHandlerManager&); //no implementation
158 
159  void prepareHandlers(const IInterfaceDescriptorProvider* provider, const MarketSegments& productNames);
160 
161  private:
162  struct Impl;
163  Impl* impl_;
164 
165  ErrorListener* errorListener_;
166  WarningListener* warningListener_;
167  DepthListener* depthListener_;
168  TopOfBookImpliedListener* topOfBookImpliedListener_;
169  ProductStateChangeListener* productStateChangeListener_;
170  MassInstrumentStateChangeListener* massInstrumentStateChangeListener_;
171  InstrumentStateChangeListener* instrumentStateChangeListener_;
172  QuoteRequestListener* quoteRequestListener_;
173  CrossRequestListener* crossRequestListener_;
174  ComplexInstrumentUpdateListener* complexInstrumentUpdateListener_;
175  FlexibleInstrumentUpdateListener* flexibleInstrumentUpdateListener_;
176  OrderBookListener* orderBookListener_;
177  TradeListener* tradeListener_;
178  };
179 
180  }
181  }
182 }
The Feed Engine machinery.
Definition: FeedEngine.h:103
MDI handler configuration settings.
Definition: Defines.h:30
Defines params which affect replay.
Definition: Replay.h:82
IInterfaceDescriptorProvider::MarketSegments MarketSegments
void replayPcap(const std::vector< EmdiHandler * > &handlers, const ReplayOptions &options)
Replay pcap files.
#define ONIXS_EUREX_EMDI_COMPILER_INFO
Definition: Compiler.h:35