OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers  12.1.0
API documentation
EobiHandler.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 
26 
27 namespace OnixS
28 {
29  namespace Eurex
30  {
31  namespace MarketData
32  {
33  ONIXS_EUREX_EMDI_API_DECL(class, FeedEngine);
34 
35  struct ReplayOptions;
36  class HandlerStateListener;
37  class WarningListener;
38  class ErrorListener;
39  class PacketListener;
40 
41  namespace EOBI
42  {
43  struct EobiHandlerSettings;
44 
45  class OrderDataListener;
46  class TradeDataListener;
47  class StateChangeListener;
48  class ReferenceDataListener;
49  class SnapshotListener;
50  class MessageListener;
51  class OrderBookListener;
52 
53  /// Eurex Enhanced Order Book Interface Handler.
54  class ONIXS_EUREX_EMDI_API EobiHandler
55  {
56  public:
57  /// Performs instance initialization.
58  /// @param settings defines values for various options
59  /// which affect handler behavior like enabling logging
60  /// during execution of the handler.
61  explicit EobiHandler (const EobiHandlerSettings& settings,
62  const std::string& = ONIXS_COMPILER_INFO);
63 
64  /// Finalizes the Handler.
65  virtual ~EobiHandler();
66 
67  /// Assigns listener for errors occurred while executing handler.
68  /// It's permissible to change the listener multiple times during
69  /// handler's life-time, but only when handler is in disconnected state.
70  /// @throw OperationException if handler not disconnected
71  void registerErrorListener (ErrorListener* listener);
72 
73  /// Assigns listener for warnings occurred while executing handler.
74  /// It's permissible to change the listener multiple times during
75  /// handler's life-time, but only when handler is in disconnected state.
76  /// @throw OperationException if handler not disconnected
77  void registerWarningListener (WarningListener* listener);
78 
79  /// Assigns listener for state change events occurred while executing handler.
80  /// It's permissible to change the listener multiple times during
81  /// handler's life-time, but only when handler is in disconnected state.
82  /// @throw OperationException if handler not disconnected.
83  void registerHandlerStateListener (HandlerStateListener* listener);
84 
85  void registerOrderDataListener (OrderDataListener* listener);
86  void registerTradeDataListener (TradeDataListener* listener);
87  void registerStateChangeListener (StateChangeListener* listener);
88  void registerReferenceDataListener (ReferenceDataListener* listener);
89  void registerSnapshotListener (SnapshotListener* listener);
90  void registerMessageListener (MessageListener* listener);
91  void registerOrderBookListener (OrderBookListener* listener);
92  void registerPacketListener (PacketListener* listener);
93 
94  /// Set the Partition Id filtering values.
95  ///
96  /// @note The filter is inclusive.
97  void setPartitionIdFilters (const PartitionIdFilters& filters);
98 
99  /// Remove all filters.
100  void removeAllPartitionIdFilters();
101 
102  /// Set the Market Segment Id filtering values.
103  ///
104  /// @note The filter is inclusive.
105  void setMarketSegmentIdFilters (const MarketSegmentIdFilters& filters);
106 
107  /// Remove all filters.
108  void removeAllMarketSegmentIdFilters();
109 
110  /// Set the Security Id filtering values.
111  ///
112  /// @note The filter is inclusive.
113  void setSecurityIdFilters (const SecurityIdFilters& filters);
114 
115  /// Remove all filters.
116  void removeAllSecurityIdFilters();
117 
118  /// Binds Feed Engine to the Handler.
119  ///
120  /// Handler must be in stopped state.
121  ///
122  /// @throw OperationException in case when handler is not in configurable state.
123  void bindFeedEngine(FeedEngine& feedEngine);
124 
125  /// Start handler.
126  ///
127  /// @note This action is asynchronous.
128  /// @throw std::exception in case of unable to start.
129  void start ();
130 
131  /// Starts replaying previously logged data.
132  void start (const ReplayOptions& options);
133 
134  /// Stop handler.
135  void stop ();
136 
137  /// Replay pcap files.
138  void replayPcap (const ReplayOptions& options);
139 
140  /// Returns handler state.
141  HandlerState::Enum state () const;
142 
143  /// Logs the given user-level message to the handler log.
144  void log (LogLevel::Enum logLevel, const char* logMessage, size_t length);
145 
146  /// Logs the given user-level message to the handler log
147  void log (LogLevel::Enum logLevel, const char* logMessage);
148 
149  /// Logs the given user-level message to the handler log.
150  void log (LogLevel::Enum logLevel, const std::string& str);
151 
152  /// Returns the license expiration date.
153  const char* licenseExpirationDate () const;
154 
155  /// Returns Handler's version.
156  static const char* version ();
157 
158  private:
159  EobiHandler (const EobiHandler&); //no implementation
160  EobiHandler& operator = (const EobiHandler&); //no implementation
161 
162  private:
163  friend struct Implementation::PcapPeplayHelper;
164  struct Impl;
165  Impl* impl_;
166  };
167 
168  /// Replay pcap files.
169  ONIXS_EUREX_EMDI_API
170  void replayPcap (const std::vector<EobiHandler*>& handlers, const ReplayOptions& options);
171  }
172  }
173  }
174 }
Manages processing machinery for market data received from feeds.
Definition: FeedEngine.h:337
FilteringTraits::PartitionIdFilters PartitionIdFilters
Definition: Defines.h:30
Product State Change listener.
FilteringTraits::MarketSegmentIdFilters MarketSegmentIdFilters
Defines params which affect replay.
Definition: Replay.h:82
ONIXS_EUREX_EMDI_API_DECL(class, Message)
EOBI handler configuration settings.
ONIXS_EUREX_EMDI_API void replayPcap(const std::vector< EobiHandler * > &handlers, const ReplayOptions &options)
Replay pcap files.
FilteringTraits::SecurityIdFilters SecurityIdFilters
Enum
Defines the state that the handler is in.
Eurex Enhanced Order Book Interface Handler.
Definition: EobiHandler.h:54