OnixS C++ Cboe CFE Multicast PITCH Market Data Handler  1.10.3
API documentation
Handler.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 CboeCFE
29  {
30  namespace MarketData
31  {
32  namespace Pitch
33  {
34  class ErrorListener;
35  class FeedEngine;
36  class WarningListener;
37  class MessageListener;
38  class OrderBookListener;
39  class ProtocolListener;
40  class MarketByPriceListener;
41  class TradeOnOrderExecutedListener;
42 
43  struct HandlerSettings;
44  struct ReplayOptions;
45 
46  /// Cboe CFE Multicast PITCH Market Data Handler class.
47  class ONIXS_CBOECFE_PITCH_API Handler
48  {
49  public:
50  /// Performs instance initialization.
51  /// @param settings defines values for various options
52  /// which affect handler behavior like enabling logging
53  /// during execution of the handler.
54  explicit
55  Handler (const HandlerSettings& settings);
56 
57  /// Finalizes the Handler.
58  virtual ~Handler();
59 
60  /// Assigns listener for errors occurred while executing handler.
61  /// It's permissible to change the listener multiple times during
62  /// handler's life-time, but only when handler is in disconnected state.
63  /// @throw OperationException if handler not disconnected
64  void registerErrorListener (ErrorListener* listener);
65 
66  /// Assigns listener for warnings occurred while executing handler.
67  /// It's permissible to change the listener multiple times during
68  /// handler's life-time, but only when handler is in disconnected state.
69  /// @throw OperationException if handler not disconnected
70  void registerWarningListener (WarningListener* listener);
71 
72  /// Assigns listener for state change events occurred while executing handler.
73  /// It's permissible to change the listener multiple times during
74  /// handler's life-time, but only when handler is in disconnected state.
75  /// @throw OperationException if handler not disconnected.
76  void registerHandlerStateListener (HandlerStateListener* listener);
77 
78  /// Assigns listener to receive notification when Pitch messages is received while executing handler.
79  /// It's permissible to change the listener multiple times during
80  /// handler's life-time, but only when handler is in disconnected state.
81  /// @throw OperationException if handler not disconnected.
82  void registerMessageListener (MessageListener* listener);
83 
84  /// Assigns listener to receive notifications about message processing while executing handler.
85  /// It's permissible to change the listener multiple times during
86  /// handler's life-time, but only when handler is in disconnected state.
87  /// @throw OperationException if handler not disconnected.
88  void registerProtocolListener (ProtocolListener* listener);
89 
90  /// Assigns listener to receive notification about order book states while executing handler.
91  /// It's permissible to change the listener multiple times during
92  /// handler's life-time, but only when handler is in disconnected state.
93  /// @throw OperationException if handler not disconnected.
94  void registerOrderBookListener (OrderBookListener* listener);
95 
96  /// Assigns listener to receive notification about price level updates
97  /// It's permissible to change the listener multiple times during
98  /// handler's life-time, but only when handler is in disconnected state.
99  /// @throw OperationException if handler not disconnected.
100  void registerMarketByPriceListener (MarketByPriceListener* listener);
101 
102 
103  /// Assigns listener to receive notification additionally generated events
104  /// It's permissible to change the listener multiple times during
105  /// handler's life-time, but only when handler is in disconnected state.
106  /// @throw OperationException if handler not disconnected.
107  void registerTradeOnOrderExecutedListener (TradeOnOrderExecutedListener* listener);
108 
109 
110  /// Binds Feed Engine to the Handler.
111  ///
112  /// Handler must be in stopped state.
113  ///
114  /// @throw OperationException in case when handler is not in configurable state.
115  void bindFeedEngine(FeedEngine& feedEngine);
116 
117  /// Start handler.
118  ///
119  /// @note This action is asynchronous.
120  /// @throw std::exception in case of unable to start.
121  void start ();
122 
123  /// Starts replaying previously logged data.
124  void start (const ReplayOptions& options);
125 
126  /// Stop handler.
127  void stop (bool wait);
128 
129  /// Returns handler state.
130  HandlerState::Enum state () const;
131 
132  /// Logs the given user-level message to the handler log.
133  void log (LogLevel::Enum logLevel, const char* logMessage, size_t length);
134 
135  /// Logs the given user-level message to the handler log
136  void log (LogLevel::Enum logLevel, const char* logMessage);
137 
138  /// Logs the given user-level message to the handler log.
139  void log (LogLevel::Enum logLevel, const std::string& str);
140 
141  /// Returns the license expiration date.
142  std::string licenseExpirationDate () const;
143 
144  /// Returns Handler's version.
145  static const char* version ();
146 
147  private:
148  Handler (const Handler&); //no implementation
149  Handler& operator = (const Handler&); //no implementation
150 
151  private:
152  struct Impl;
153  Impl* impl_;
154  };
155  }
156  }
157  }
158 }
159 
160 
161 
162 
Manages processing machinery for market data received from feeds.
Definition: FeedEngine.h:208
Cboe CFE Multicast PITCH Market Data Handler class.
Definition: Handler.h:47
Is generated when Execution messages are received and contains additional information about instrumen...
Defines ONIXS_CBOECFE_PITCH_API which affect logs replay.
Definition: Replay.h:59
Enum
Defines the state that the handler is in.