OnixS Eurex ETI Handler C++ library  9.11.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-redable 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  /// Path to the license directory.
91  ///
92  /// \note The default value is empty string (means current directory).
93  std::string licenseDirectory;
94 
95  /// Log files are stored in this directory.
96  ///
97  /// \note The default value is "logs".
98  std::string logDirectory;
99 
100  /// Template of log file name without extension.
101  ///
102  /// \note The default value is "EurexEtiTradingHandlerCpp".
103  std::string logFileNamePrefix;
104 
105  /// Combine LogSettings enum values to configure the logger.
106  ///
107  /// \note The default value is LogSettings::Default.
109 
110  /// Log verbosity.
111  ///
112  /// \note The default value is LogLevel::Info.
114 
115  /// Receiving timeout in milliseconds.
116  ///
117  /// \note The default value is 2 seconds (2000 ms).
119 
120  /// Sending timeout in milliseconds.
121  ///
122  /// \note The default value is 2 seconds (2000 ms).
124 
125  /// CPU affinity of the receiving thread.
127 
128  /// CPU affinity of the receiving thread.
130 
131  /// CPU affinity of the audit-trail thread.
133 
134  /// Connection retries configuration settings.
135  ///
136  /// \see ConnectionRetries.
138 
139  /// Audit Trail files are stored in this directory.
140  ///
141  /// \note The default value is empty string.
142  std::string auditTrailDirectory;
143 
144  /// \deprecated Please use \link OnixS::Eurex::Trading::HandlerSettings::auditTrailFileNamePrefix auditTrailFileNamePrefix\endlink
145  /// instead of this deprecated field.
146  std::string auditTrailFile;
147 
148  /// Template of Audit Trail file name without extension.
149  ///
150  /// Creates Audit Trail file that contains all messages that Handler sent or received (in the chronological order).
151  ///
152  /// \note The default value is empty string (means no audit trail files required).
154 
155  /// Audit Trail mode.
156  ///
157  /// \note By default it's Text.
159 
160  /// Throttle message margin. Transaction limit will be reduced by this value.
161  ///
162  /// For example, if Eurex notify that transaction limit is 20 messages and
163  /// this Handler's setting isn't changed (by default value is 3), then
164  /// transaction limit for Handler is 20 - 3 = 17 messages.
165  ///
166  /// \note By default it's 3.
168 
169  /// This flag is used to control the Handler's
170  /// behavior when a connection is not able to
171  /// receive data from a network.
172  ///
173  /// Absence of data could be caused by network or
174  /// exchange issues. If server stopped sending
175  /// data due to internal issues but underlying
176  /// TCP connection is not broken, it could make
177  /// sense to switch to manual control and use
178  /// this option.
179  ///
180  /// By default, the Handler will call error
181  /// callback and restart the connection.
182  /// If this flag is set to \c true, only
183  /// warning callback will be called and
184  /// the Handler continue to work.
185  ///
186  /// \note By default it's \c false.
188 
189  /// This flag is used to control the Handler's
190  /// behavior whether to scramble passwords in
191  /// the log and audit files.
192  ///
193  /// \note By default it's \c false.
195 
196  /// Reasonable transmission time.
197  /// This option controls the percentage from the heartbeat interval.
198  ///
199  /// \note By default it's 20.
201 
202  /// Returns the string representation.
203  std::string toString() const;
204 };
205 
206 ONIXS_EUREX_ETI_EXPORT std::ostream& operator << (std::ostream&, const HandlerSettings&);
207 
208 }
209 }
210 }
std::ostream & operator<<(std::ostream &, const ConnectionRetries &)
Human-redable 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::string enumToString(ApplId::Enum)
Returns string representation.
std::set< size_t > CpuIndexes
Logical processors that a thread is allowed to run on (first logical CPU has index 0)...
ConnectionRetries(const ConnectionRetries &other)
Copy constructor.
CpuIndexes sendingThreadAffinity
CPU affinity of the receiving thread.