OnixS CME Drop Copy Handler C++ library  5.6.0
API documentation
HandlerSettings.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/CME/DropCopy/Export.h"
25 
26 namespace OnixS { namespace CME { namespace DropCopy {
27 
28 /// Defines log alternates.
29 struct ONIXS_CME_DROP_COPY_EXPORT LogModes
30 {
31  /// Log alternates.
32  enum Enum
33  {
34  /// No data will be logged.
36 
37  /// Only important information like
38  /// warnings and errors will be logged.
40 
41  /// Handler will log miscellaneous aspects
42  /// related with its execution like changes
43  /// in state, network data obtained, etc. All
44  /// critical important information like warnings
45  /// and errors will be logged as well.
47 
48  /// In addition to the data logged in 'Regular'
49  /// mode, Handler will output additional information
50  /// like step-by-step changes into books, step-by-step
51  /// processing of received network packets.
52  Debug
53  };
54 
55  /// Returns string presentation of given mode.
56  static std::string toString (Enum mode);
57 };
58 
59 /// Log mode.
61 
62 /// Additional options to control log information.
63 typedef unsigned AdvancedLogOptionSet;
64 
65 /// Additional options to control log information.
66 struct ONIXS_CME_DROP_COPY_EXPORT AdvancedLogOptions
67 {
68  enum Enum
69  {
70  /// Nothing except standard
71  /// information must be logged.
72  LogNothing = 0x0,
73 
74  /// Log FIX messages in addition to the
75  /// packets received from the network.
76  LogFixMessages = 0x1,
77 
78  /// Logs all additional data/events.
79  LogEverything = LogFixMessages
80  };
81 
82  /// Returns string representation of an option.
83  static std::string toString (AdvancedLogOptionSet options);
84 };
85 
86 /// Handler's configuration settings.
87 struct ONIXS_CME_DROP_COPY_EXPORT HandlerSettings : InitializationSettings
88 {
89  ///
90  /// Specifies whether the Handler should log its events
91  /// and which of events should be put into the log.
92  ///
93  /// \note The default value is LogModes::Regular.
94  LogMode logMode;
95 
96  ///
97  /// Log files are stored in this directory.
98  ///
99  /// Ignored if logging is disabled.
100  ///
101  /// \note The default value is "./".
102  std::string logDirectory;
103 
104  ///
105  /// Log files will use this value as filename prefix.
106  ///
107  /// Ignored if logging is disabled.
108  ///
109  /// \note The default value is "CmeDropCopyHandlerCpp".
110  std::string logFileNamePrefix;
111 
112  ///
113  /// Log files will use this value as file extension.
114  ///
115  /// Ignored if logging is disabled.
116  ///
117  /// \note The default value is "log".
118  std::string logExt;
119 
120  ///
121  /// Additional options to control which data is to be logged.
122  /// Ignored if logging is disabled.
123  ///
124  /// \note The default value is AdvancedLogOptions::LogEverything.
125  AdvancedLogOptionSet advancedLogOptions;
126 
127  /// Heartbeat interval in seconds.
128  ///
129  /// Default value is 30 seconds.
131 
132  ///
133  /// FIX session SenderCompID.
134  ///
135  /// This tag consists of 2 subcomponents and a constant: Session ID, Firm ID, and Fault Tolerance Indicator (FTI).
136  /// Session ID is the left-most 3 characters. The next 3 characters represent Firm ID. The last character is always set to FTI.
137  ///
138  std::string senderCompId;
139 
140  ///
141  /// FIX session TargetCompID.
142  ///
143  /// Identifies entity receiving the message (CME).
144  ///
145  /// The default value is "CME".
146  ///
147  std::string targetCompId;
148 
149  ///
150  /// FIX session custom key.
151  ///
152  /// Custom key that can be used to distinguish sessions
153  /// with the same values of the SenderCompID, TargetCompID
154  /// and the FIX Protocol version.
155  ///
156  /// THe default value is empty string.
157  ///
158  std::string customKey;
159 
160  ///
161  /// Fix session SenderSubID.
162  ///
163  /// Operator ID. Must be unique per Firm ID.
164  ///
165  std::string senderSubId;
166 
167  ///
168  /// Fix session TargetSubID.
169  ///
170  /// Identifies platform receiving the message (Globex)
171  ///
172  /// The default value is "G".
173  ///
174  std::string targetSubId;
175 
176  ///
177  /// Fix session SenderLocationId.
178  ///
179  /// ISO identifier of message originator's location (i.e. geographic location and/or desk).
180  ///
181  /// The default value is "EN,GB".
182  std::string senderLocationId;
183 
184  /// Option to keep sequence numbers after the exchange of Logout (MsgType=5) messages.
185  ///
186  /// The default value is true.
188 
189  /// Local network interface for CME Session.
190  std::string networkInterface;
191 
192  /// If true will set the session outgoing sequence number to the
193  /// NextExpectedMsgSeqNum (tag 789) field value from the CME Logout message.
194  /// The session incoming sequence number will not be changed.
195  ///
196  /// The default value is false.
198 
199  /// Initializes parameters with default values.
200  HandlerSettings();
201 
202  /// Returns string representation.
203  std::string toString() const;
204 };
205 
206 }}}
unsigned AdvancedLogOptionSet
Additional options to control log information.
Collection of attributes for one-time initialization.
Defines log alternates.
Additional options to control log information.
Handler's configuration settings.
std::string networkInterface
Local network interface for CME Session.
LogModes::Enum LogMode
Log mode.