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