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