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