OnixS BME SENAF Handler C++ library  2.2.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 
22 #include <OnixS/Senaf/MarketData/Export.h>
35 
36 #include <string>
37 
38 namespace OnixS { namespace Senaf { namespace MarketData {
39 
40 /// Senaf market data processor
41 class ONIXS_BME_SENAF_EXPORT Handler
42 {
43 public:
44  /// Performs instance initialization.
45  ///
46  /// \param handlerSettings defines values for various settings
47  /// which affect handler behavior like enabling logging
48  /// during execution of the handler.
49  Handler(const HandlerSettings& handlerSettings);
50 
51  /// Finalizes the Handler.
52  virtual ~Handler();
53 
54  /// Date when license for the Handler will expire.
55  std::string licenseExpirationDate() const;
56 
57  /// Get version of Handler.
58  static const std::string& version();
59 
60  /// Log a debug message.
61  void logDebug(const std::string& message);
62 
63  /// Log an error message.
64  void logError(const std::string& message);
65 
66  /// Log an information message.
67  void logMessage(const std::string& message);
68 
69  /// Log a warning message.
70  void logWarning(const std::string& message);
71 
72  /// Registers the error listener.
73  ///
74  /// Only single instance of listener can be associated with
75  /// the Handler. Registering new listener removes previous one.
76  ///
77  /// Listeners are to be associated before starting market data
78  /// processing.
79  ///
80  /// \throw exception in case of Handler is in active state.
81  void registerErrorListener(ErrorListener* listener);
82 
83  /// Registers the warning listener.
84  ///
85  /// Only single instance of listener can be associated with
86  /// the Handler. Registering new listener removes previous one.
87  ///
88  /// Listeners are to be associated before starting market data
89  /// processing.
90  ///
91  /// \throw exception in case of Handler is in active state.
92  void registerWarningListener(WarningListener* listener);
93 
94  /// Registers the Handler state change listener.
95  ///
96  /// Only single instance of listener can be associated with
97  /// the Handler. Registering new listener removes previous one.
98  ///
99  /// Listeners are to be associated before starting market data
100  /// processing.
101  ///
102  /// \throw exception in case of Handler is in active state.
103  void registerHandlerStateChangeListener(HandlerStateChangeListener* listener);
104 
105  /// Registers the log replay listener.
106  ///
107  /// Only single instance of listener can be associated with
108  /// the Handler. Registering new listener removes previous one.
109  ///
110  /// Listeners are to be associated before starting market data
111  /// processing.
112  ///
113  /// \throw exception in case of Handler is in active state.
114  void registerLogReplayListener(LogReplayListener* listener);
115 
116  /// Registers the Reference listener.
117  ///
118  /// Only single instance of listener can be associated with
119  /// the Handler. Registering new listener removes previous one.
120  ///
121  /// Listeners are to be associated before starting market data
122  /// processing.
123  ///
124  /// \throw exception in case of Handler is in active state.
125  void registerReferenceListener(ReferenceListener* listener);
126 
127  /// Registers the Security DB listener.
128  ///
129  /// Only single instance of listener can be associated with
130  /// the Handler. Registering new listener removes previous one.
131  ///
132  /// Listeners are to be associated before starting market data
133  /// processing.
134  ///
135  /// \throw exception in case of Handler is in active state.
136  void registerSecurityDbListener(SecurityDbListener* listener);
137 
138  /// Registers the Market Publication Messages listener.
139  ///
140  /// Only single instance of listener can be associated with
141  /// the Handler. Registering new listener removes previous one.
142  ///
143  /// Listeners are to be associated before starting market data
144  /// processing.
145  ///
146  /// \throw exception in case of Handler is in active state.
147  void registerMarketPublicationListener(MarketPublicationListener* listener);
148 
149  /// Registers the Market Control Messages listener.
150  ///
151  /// Only single instance of listener can be associated with
152  /// the Handler. Registering new listener removes previous one.
153  ///
154  /// Listeners are to be associated before starting market data
155  /// processing.
156  ///
157  /// \throw exception in case of Handler is in active state.
158  void registerMarketControlListener(MarketControlListener* listener);
159 
160  /// Registers the order book update listener.
161  ///
162  /// Only single instance of listener can be associated with
163  /// the Handler. Registering new listener removes previous one.
164  ///
165  /// Listeners are to be associated before starting market data
166  /// processing.
167  ///
168  /// \throw exception in case of Handler is in active state.
169  void registerOrderBookUpdateListener(OrderBookUpdateListener* listener);
170 
171  /// Registers the Private Management Messages listener.
172  ///
173  /// Only single instance of listener can be associated with
174  /// the Handler. Registering new listener removes previous one.
175  ///
176  /// Listeners are to be associated before starting market data
177  /// processing.
178  ///
179  /// \throw exception in case of Handler is in active state.
180  void registerPrivateManagementListener(PrivateManagementListener* listener);
181 
182  /// Subscribe on market
183  void subscribe(const MarketSubscription& subscription);
184 
185  /// Starts handler
186  ///
187  /// \throw exception in case of unable to establish TCP connection.
188  void start();
189 
190  /// Stops handler
191  void stop();
192 
193  /// Get handler state.
194  HandlerStates::Enum state() const;
195 
196 private:
197  Handler(const Handler&) /*= delete */; // no implementation
198  Handler& operator=(const Handler&) /*= delete */; // no implementation
199 
200 private:
201  class Implementation;
202  Implementation* impl_;
203 };
204 
205 }}} // namespace MarketData, Senaf, OnixS
Enum
Available Handler&#39;s states.
Definition: HandlerState.h:30
Senaf market data processor.
Definition: Handler.h:41
Defines set of settings which affect behavior of the Handler.
Defines the interface through which the Handler notifies subscribers about reference events...
Defines the interface through which the Handler notifies subscribers about log replay events...
Defines the interface through which the Handler notifies subscribers about Market Publication Message...
Defines the interface through which the Handler notifies subscribers about errors occurred while proc...
Definition: ErrorListener.h:29
Defines the interface through which the Handler notifies subscribers about security DB events...
Defines the interface through which the Handler notifies subscribers about Market Control Messages...