OnixS BME SENAF Handler C++ library  2.2.1
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
5  * copyright law and international copyright treaties.
6  *
7  * Access to and use of the software is governed by the terms of the applicable
8  * ONIXS Software Services Agreement (the Agreement) and Customer end user
9  * license agreements granting a non-assignable, non-transferable and
10  * non-exclusive license to use the software for it's own data processing
11  * purposes under the terms defined in the Agreement.
12  *
13  * Except as otherwise granted within the terms of the Agreement, copying or
14  * reproduction of any part of this source code or associated reference material
15  * to any other location for further reproduction or redistribution, and any
16  * amendments to this copyright notice, are expressly prohibited.
17  *
18  * Any reproduction or redistribution for sale or hiring of the Software not in
19  * accordance with the terms of the Agreement is a violation of copyright law.
20  */
21 
22 #pragma once
23 
25 #include <OnixS/Senaf/MarketData/Export.h>
37 
38 #include <string>
39 
40 namespace OnixS { namespace Senaf { namespace MarketData {
41 
42 /// Senaf market data processor
43 class ONIXS_BME_SENAF_EXPORT Handler
44 {
45 public:
46  /// Performs instance initialization.
47  ///
48  /// \param handlerSettings defines values for various settings
49  /// which affect handler behavior like enabling logging
50  /// during execution of the handler.
51  Handler(const HandlerSettings& handlerSettings);
52 
53  /// Finalizes the Handler.
54  virtual ~Handler();
55 
56  /// Date when license for the Handler will expire.
57  std::string licenseExpirationDate() const;
58 
59  /// Get version of Handler.
60  static const std::string& version();
61 
62  /// Log a debug message.
63  void logDebug(const std::string& message);
64 
65  /// Log an error message.
66  void logError(const std::string& message);
67 
68  /// Log an information message.
69  void logMessage(const std::string& message);
70 
71  /// Log a warning message.
72  void logWarning(const std::string& message);
73 
74  /// Registers the error listener.
75  ///
76  /// Only single instance of listener can be associated with
77  /// the Handler. Registering new listener removes previous one.
78  ///
79  /// Listeners are to be associated before starting market data
80  /// processing.
81  ///
82  /// \throw exception in case of Handler is in active state.
83  void registerErrorListener(ErrorListener* listener);
84 
85  /// Registers the warning listener.
86  ///
87  /// Only single instance of listener can be associated with
88  /// the Handler. Registering new listener removes previous one.
89  ///
90  /// Listeners are to be associated before starting market data
91  /// processing.
92  ///
93  /// \throw exception in case of Handler is in active state.
94  void registerWarningListener(WarningListener* listener);
95 
96  /// Registers the Handler state change listener.
97  ///
98  /// Only single instance of listener can be associated with
99  /// the Handler. Registering new listener removes previous one.
100  ///
101  /// Listeners are to be associated before starting market data
102  /// processing.
103  ///
104  /// \throw exception in case of Handler is in active state.
105  void registerHandlerStateChangeListener(HandlerStateChangeListener* listener);
106 
107  /// Registers the log replay listener.
108  ///
109  /// Only single instance of listener can be associated with
110  /// the Handler. Registering new listener removes previous one.
111  ///
112  /// Listeners are to be associated before starting market data
113  /// processing.
114  ///
115  /// \throw exception in case of Handler is in active state.
116  void registerLogReplayListener(LogReplayListener* listener);
117 
118  /// Registers the Reference listener.
119  ///
120  /// Only single instance of listener can be associated with
121  /// the Handler. Registering new listener removes previous one.
122  ///
123  /// Listeners are to be associated before starting market data
124  /// processing.
125  ///
126  /// \throw exception in case of Handler is in active state.
127  void registerReferenceListener(ReferenceListener* listener);
128 
129  /// Registers the Security DB listener.
130  ///
131  /// Only single instance of listener can be associated with
132  /// the Handler. Registering new listener removes previous one.
133  ///
134  /// Listeners are to be associated before starting market data
135  /// processing.
136  ///
137  /// \throw exception in case of Handler is in active state.
138  void registerSecurityDbListener(SecurityDbListener* listener);
139 
140  /// Registers the Market Publication Messages listener.
141  ///
142  /// Only single instance of listener can be associated with
143  /// the Handler. Registering new listener removes previous one.
144  ///
145  /// Listeners are to be associated before starting market data
146  /// processing.
147  ///
148  /// \throw exception in case of Handler is in active state.
149  void registerMarketPublicationListener(MarketPublicationListener* listener);
150 
151  /// Registers the Market Control Messages listener.
152  ///
153  /// Only single instance of listener can be associated with
154  /// the Handler. Registering new listener removes previous one.
155  ///
156  /// Listeners are to be associated before starting market data
157  /// processing.
158  ///
159  /// \throw exception in case of Handler is in active state.
160  void registerMarketControlListener(MarketControlListener* listener);
161 
162  /// Registers the order book update listener.
163  ///
164  /// Only single instance of listener can be associated with
165  /// the Handler. Registering new listener removes previous one.
166  ///
167  /// Listeners are to be associated before starting market data
168  /// processing.
169  ///
170  /// \throw exception in case of Handler is in active state.
171  void registerOrderBookUpdateListener(OrderBookUpdateListener* listener);
172 
173  /// Registers the Private Management Messages listener.
174  ///
175  /// Only single instance of listener can be associated with
176  /// the Handler. Registering new listener removes previous one.
177  ///
178  /// Listeners are to be associated before starting market data
179  /// processing.
180  ///
181  /// \throw exception in case of Handler is in active state.
182  void registerPrivateManagementListener(PrivateManagementListener* listener);
183 
184  /// Subscribe on market
185  void subscribe(const MarketSubscription& subscription);
186 
187  /// Starts handler
188  ///
189  /// \throw exception in case of unable to establish TCP connection.
190  void start();
191 
192  /// Stops handler
193  void stop();
194 
195  /// Get handler state.
196  HandlerStates::Enum state() const;
197 
198 private:
199  Handler(const Handler&) /*= delete */; // no implementation
200  Handler& operator=(const Handler&) /*= delete */; // no implementation
201 
202 private:
203  class Implementation;
204  Implementation* impl_;
205 };
206 
207 }}} // namespace OnixS::Senaf::MarketData
Enum
Available Handler&#39;s states.
Definition: HandlerState.h:32
Senaf market data processor.
Definition: Handler.h:43
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:31
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...