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