OnixS Eurex ETI Handler C++ library  9.19.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/Eurex/Trading/Export.h"
24 
25 #include <set>
26 
27 namespace OnixS {
28 namespace Eurex {
29 namespace Trading {
30 
31 /// Connection retries settings.
32 struct ONIXS_EUREX_ETI_EXPORT ConnectionRetries
33 {
34  /// Default constructor.
35  ConnectionRetries () : number (0), interval (0) {}
36 
37  /// Copy constructor.
38  ConnectionRetries (const ConnectionRetries& other) : number (other.number), interval (other.interval) {}
39 
40  /// Constructor.
41  ConnectionRetries (int inNumber, unsigned inInterval) : number (inNumber), interval (inInterval) {}
42 
43  /// Number of attempts to restore the telecommunication link.
44  /// -1 - unlimited
45  /// 0 - never (default)
46  /// >0 - the number of attempts
47  int number;
48 
49  /// The time interval between the attempts to restore the telecommunication link (in seconds).
50  ///
51  /// \note The default value is 0 (zero).
52  unsigned int interval;
53 
54  /// Returns the string representation.
55  std::string toString() const;
56 };
57 
58 ONIXS_EUREX_ETI_EXPORT std::ostream& operator<< (std::ostream&, const ConnectionRetries&);
59 
60 /// Logical processors that a thread is allowed to run on (first logical CPU has index 0).
61 typedef std::set<size_t> CpuIndexes;
62 
63 /// Audit trail mode.
64 struct ONIXS_EUREX_ETI_EXPORT AuditTrailMode
65 {
66  /// \copydoc AuditTrailMode
67  enum Enum
68  {
69  /// Human-readable text representation.
71 
72  /// Compact form for further processing using
73  /// \link OnixS::Eurex::Trading::AuditTrail::Reader Reader\endlink.
75  };
76 };
77 
78 /// Returns string representation.
79 ONIXS_EUREX_ETI_EXPORT std::string enumToString (AuditTrailMode::Enum);
80 
81 /// Handler settings.
82 struct ONIXS_EUREX_ETI_EXPORT HandlerSettings
83 {
84  /// Constructor.
86 
87  /// Copy constructor.
88  HandlerSettings(const HandlerSettings&);
89 
90  /**
91  * Content of the license file as a string.
92  *
93  * \note Default value is empty string.
94  * \note The Handler checks this license first.
95  */
96  std::string licenseString;
97 
98  /// Path to the license directory.
99  ///
100  /// \note The default value is empty string (means current directory).
101  std::string licenseDirectory;
102 
103  /// Log files are stored in this directory.
104  ///
105  /// \note The default value is "logs".
106  std::string logDirectory;
107 
108  /// Template of log file name without extension.
109  ///
110  /// \note The default value is "EurexEtiTradingHandlerCpp".
111  std::string logFileNamePrefix;
112 
113  /// Combine LogSettings enum values to configure the logger.
114  ///
115  /// \note The default value is LogSettings::Default.
117 
118  /// Log verbosity.
119  ///
120  /// \note The default value is LogLevel::Info.
122 
123  /// Receiving timeout in milliseconds.
124  ///
125  /// \note The default value is 2 seconds (2000 ms).
127 
128  /// Sending timeout in milliseconds.
129  ///
130  /// \note The default value is 2 seconds (2000 ms).
132 
133  /// CPU affinity of the receiving thread.
135 
136  /// CPU affinity of the receiving thread.
138 
139  /// CPU affinity of the audit-trail thread.
141 
142  /// Connection retries configuration settings.
143  ///
144  /// \see ConnectionRetries.
146 
147  /// Audit Trail files are stored in this directory.
148  ///
149  /// \note The default value is empty string.
150  std::string auditTrailDirectory;
151 
152  /// \deprecated Please use \link OnixS::Eurex::Trading::HandlerSettings::auditTrailFileNamePrefix auditTrailFileNamePrefix\endlink
153  /// instead of this deprecated field.
154  std::string auditTrailFile;
155 
156  /// Template of Audit Trail file name without extension.
157  ///
158  /// Creates Audit Trail file that contains all messages that Handler sent or received (in the chronological order).
159  ///
160  /// \note The default value is empty string (means no audit trail files required).
162 
163  /// Audit Trail mode.
164  ///
165  /// \note By default it's Text.
167 
168  /// Throttle message margin. Transaction limit will be reduced by this value.
169  ///
170  /// For example, if Eurex notify that transaction limit is 20 messages and
171  /// this Handler's setting isn't changed (by default value is 3), then
172  /// transaction limit for Handler is 20 - 3 = 17 messages.
173  ///
174  /// \note By default it's 3.
176 
177  /// This flag is used to control the Handler's
178  /// behavior when a connection is not able to
179  /// receive data from a network.
180  ///
181  /// Absence of data could be caused by network or
182  /// exchange issues. If server stopped sending
183  /// data due to internal issues but underlying
184  /// TCP connection is not broken, it could make
185  /// sense to switch to manual control and use
186  /// this option.
187  ///
188  /// By default, the Handler will call error
189  /// callback and restart the connection.
190  /// If this flag is set to \c true, only
191  /// warning callback will be called and
192  /// the Handler continue to work.
193  ///
194  /// \note By default it's \c false.
196 
197  /// This flag is used to control the Handler's
198  /// behavior whether to scramble passwords in
199  /// the log and audit files.
200  ///
201  /// \note By default it's \c false.
203 
204  /// Reasonable transmission time.
205  /// This option controls the percentage from the heartbeat interval.
206  ///
207  /// \note By default it's 20.
209 
210  /// Is SSL enabled for the connection to exchange?
211  ///
212  /// \note By default it's \c false.
214 
215  /// Returns the string representation.
216  std::string toString() const;
217 };
218 
219 ONIXS_EUREX_ETI_EXPORT std::ostream& operator << (std::ostream&, const HandlerSettings&);
220 
221 }
222 }
223 }
Human-readable text representation.
CpuIndexes receivingThreadAffinity
CPU affinity of the receiving thread.
ConnectionRetries(int inNumber, unsigned inInterval)
Constructor.
CpuIndexes auditTrailThreadAffinity
CPU affinity of the audit-trail thread.
Connection retries settings.
std::set< size_t > CpuIndexes
Logical processors that a thread is allowed to run on (first logical CPU has index 0)...
std::ostream & operator<<(std::ostream &, const ConnectionStateChange &)
Make it printable to formatted C++ I/O streams.
ConnectionRetries(const ConnectionRetries &other)
Copy constructor.
std::string enumToString(ConnectionState::Enum)
Returns string representation of ConnectionState value.
CpuIndexes sendingThreadAffinity
CPU affinity of the receiving thread.