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