OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers  12.1.2
API documentation
RdiHandler.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 #pragma once
20 
25 
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 
37  class ErrorListener;
38  class WarningListener;
39  class ReferenceDataListener;
40  class HanlerSettings;
41 
42  /// Eurex Reference Data Interface Handler.
43  class ONIXS_EUREX_EMDI_API RdiHandler : public IInterfaceDescriptorProvider
44  {
45  public:
46  /// Performs instance initialization.
47  /// @param settings defines values for various options
48  /// which affect handler behavior like enabling logging
49  /// during execution of the handler.
50  explicit RdiHandler (const RdiHandlerSettings& settings,
51  const std::string& = ONIXS_COMPILER_INFO);
52 
53  /// Finalizes the Handler.
54  ~RdiHandler() ONIXS_EUREX_EMDI_OVERRIDE;
55 
56  /// Assigns listener for errors occurred while executing handler.
57  /// It's permissible to change the listener multiple times during
58  /// handler's life-time, but only when handler is in disconnected state.
59  /// @throw OperationException if handler not disconnected
60  void registerErrorListener (ErrorListener* listener);
61 
62  /// Assigns listener for warnings occurred while executing handler.
63  /// It's permissible to change the listener multiple times during
64  /// handler's life-time, but only when handler is in disconnected state.
65  /// @throw OperationException if handler not disconnected
66  void registerWarningListener (WarningListener* listener);
67 
68  /// Assigns listener for state change events occurred while executing handler.
69  /// It's permissible to change the listener multiple times during
70  /// handler's life-time, but only when handler is in disconnected state.
71  /// @throw OperationException if handler not disconnected.
72  void registerHandlerStateListener (HandlerStateListener* listener);
73 
74  /// Assigns listener for messages received while executing handler.
75  /// It's permissible to change the listener multiple times during
76  /// handler's life-time, but only when handler is in disconnected state.
77  /// @throw OperationException if handler not disconnected.
78  void registerReferenceDataListener (ReferenceDataListener* listener);
79 
80  /// Binds Feed Engine to the Handler.
81  ///
82  /// Handler must be in stopped state.
83  ///
84  /// @throw OperationException in case when handler is not in configurable state.
85  void bindFeedEngine(FeedEngine& feedEngine);
86 
87  /// Start handler.
88  ///
89  /// @note This action is asynchronous.
90  /// @throw std::exception in case of unable to start.
91  void start ();
92 
93  /// Starts replaying previously logged data.
94  void start (const ReplayOptions& options);
95 
96  /// Replay pcap files.
97  void replayPcap (const ReplayOptions& options);
98 
99  /// Stop handler.
100  void stop ();
101 
102  /// Returns handler state.
103  HandlerState::Enum state () const;
104 
105  /// Returns list of EMDI descriptors with filled partitionIdFilters and marketSegmentIdFilters to allow user
106  /// to receive market data for products specified by productNames.
107  EmdiDescriptors findEmdiDescriptors (const MarketSegments& productNames) const ONIXS_EUREX_EMDI_OVERRIDE;
108 
109  /// Returns list of EMDI descriptors with filled partitionIdFilters and marketSegmentIdFilters to allow user
110  /// to receive market data for all products.
111  EmdiDescriptors findAllEmdiDescriptors () const ONIXS_EUREX_EMDI_OVERRIDE;
112 
113  /// Returns list of MDI descriptors with filled partitionIdFilters and marketSegmentIdFilters to allow user
114  /// to receive market data for products specified by productNames.
115  MdiDescriptors findMdiDescriptors(const MarketSegments& productNames) const ONIXS_EUREX_EMDI_OVERRIDE;
116 
117  /// Returns list of MDI descriptors with filled partitionIdFilters and marketSegmentIdFilters to allow user
118  /// to receive market data for all products.
119  MdiDescriptors findAllMdiDescriptors() const ONIXS_EUREX_EMDI_OVERRIDE;
120 
121  /// Returns list of EOBI descriptors with filled partitionIdFilters and marketSegmentIdFilters to allow user
122  /// to receive market data for products specified by productNames.
123  EobiDescriptors findEobiDescriptors (const MarketSegments& productNames) const ONIXS_EUREX_EMDI_OVERRIDE;
124 
125  /// Returns list of EOBI descriptors with filled partitionIdFilters and marketSegmentIdFilters to allow user
126  /// to receive market data for all products.
127  EobiDescriptors findAllEobiDescriptors () const ONIXS_EUREX_EMDI_OVERRIDE;
128 
129  /// Logs the given user-level message to the handler log.
130  void log (LogLevel::Enum logLevel, const char* logMessage, size_t length);
131 
132  /// Logs the given user-level message to the handler log
133  void log (LogLevel::Enum logLevel, const char* logMessage);
134 
135  /// Logs the given user-level message to the handler log.
136  void log (LogLevel::Enum logLevel, const std::string& str);
137 
138  /// Returns the license expiration date.
139  const char* licenseExpirationDate () const;
140 
141  /// Returns Handler's version.
142  static const char* version ();
143 
144  private:
145  RdiHandler (const RdiHandler&); //no implementation
146  RdiHandler& operator = (const RdiHandler&); //no implementation
147 
148  private:
149  struct Impl;
150  Impl* impl_;
151  };
152 
153  }
154  }
155 }
156 
157 
Manages processing machinery for market data received from feeds.
Definition: FeedEngine.h:337
EobiDescriptor::Collection EobiDescriptors
Eurex Reference Data Interface Handler.
Definition: RdiHandler.h:43
Definition: Defines.h:30
Defines params which affect replay.
Definition: Replay.h:82
ONIXS_EUREX_EMDI_API void replayPcap(const std::vector< EmdiHandler * > &handlers, const ReplayOptions &options)
Replay pcap files.
ONIXS_EUREX_EMDI_API_DECL(class, Message)
RDI handler configuration settings.
EmdiDescriptor::Collection EmdiDescriptors
MdiDescriptor::Collection MdiDescriptors
Enum
Defines the state that the handler is in.