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