OnixS C++ MTS Cash SDP Handler  1.6.5
API documentation
HandlerSettings.h
Go to the documentation of this file.
1 #pragma once
2 /*
3 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
4 *
5 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
6 * and international copyright treaties.
7 *
8 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
9 * Services Agreement (the Agreement) and Customer end user license agreements granting
10 * a non-assignable, non-transferable and non-exclusive license to use the software
11 * for it's own data processing purposes under the terms defined in the Agreement.
12 *
13 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
14 * of this source code or associated reference material to any other location for further reproduction
15 * or redistribution, and any amendments to this copyright notice, are expressly 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 #include "OnixS/MTS/Cash/SDP/ABI.h"
22 
23 #include <set>
24 
25 namespace OnixS {
26 namespace Mts {
27 namespace Cash {
28 namespace SDP {
29 
30 /// Connection retries settings.
31 ///
32 struct ONIXS_MTS_CASH_SDP_API ConnectionRetries
33 {
34  /// Default constructor.
35  ///
36  ConnectionRetries () : number (0), intervalSec (0) {}
37 
38  /// Constructor.
39  ///
40  ConnectionRetries (int inNumber, unsigned inIntervalSec) : number (inNumber), intervalSec (inIntervalSec) {}
41 
42  /// Number of attempts to restore the telecommunication link.
43  /// -1 - unlimited
44  /// 0 - never (default)
45  /// >0 - the number of attempts
46  int number;
47 
48  /// The time interval between attempts to restore the telecommunication link (in seconds).
49  ///
50  /// @note The default value is 0 (zero).
51  unsigned int intervalSec;
52 
53  /// Returns the string representation.
54  ///
55  std::string toString() const;
56 };
57 
58 ONIXS_MTS_CASH_SDP_API std::ostream& operator << (std::ostream& stream, const ConnectionRetries& connectionRetries);
59 
60 /// Logical processors that a thread is allowed to run on (first logical CPU has index 0).
61 ///
62 typedef std::set<size_t> CpuIndexes;
63 
64 /// Handler settings.
65 ///
66 struct ONIXS_MTS_CASH_SDP_API HandlerSettings
67 {
68  /// Initialize default instance.
69  ///
71 
72  /// Path to the license directory.
73  ///
74  /// @note The default value is empty string (means current directory).
75  std::string licenseDirectory;
76 
77  /// Log files are stored in this directory.
78  ///
79  /// @note The default value is "logs".
80  std::string logDirectory;
81 
82  /// Template of log file name without extension.
83  ///
84  /// @note The default value is "MtsCashSdpHandlerCpp".
85  std::string logFileNamePrefix;
86 
87  /// Combine LogSettings enum values to configure the logger.
88  ///
89  /// @note The default value is LogSettings::Default.
91 
92  /// Log verbosity.
93  ///
94  /// @note The default value is LogLevel::Info.
96 
97  /// Receive timeout in milliseconds.
98  ///
99  /// @note The default value is 2 seconds (2000 ms).
101 
102  /// Send timeout in milliseconds.
103  ///
104  /// @note The default value is 2 seconds (2000 ms).
106 
107  /// CPU affinity of the receiving thread.
108  ///
110 
111  /// CPU affinity of the sending thread.
112  ///
114 
115  /// Connection retries configuration settings.
116  ///
117  /// @see ConnectionRetries.
119 
120  /// Audit Trail files are stored in this directory.
121  ///
122  /// @note The default value is empty string.
123  std::string auditTrailDirectory;
124 
125  /// Template of Audit Trail file name without extension.
126  ///
127  /// Creates Audit Trail file that contains all messages that Handler sent or received (in the chronological order).
128  ///
129  /// @note The default value is empty string (means no audit trail files required).
130  std::string auditTrailFile;
131 
132  /// CPU affinity of the audit trail thread.
133  ///
135 
136  /// Max size for audit trail file in megabytes, another file will be created if the size is exceeded.
137  ///
138  /// @note The default value is 1024 Mb.
140 
141  /// Returns the string representation.
142  ///
143  std::string toString() const;
144 };
145 
146 ///
147 struct ONIXS_MTS_CASH_SDP_API ConnectionSettings
148 {
149  /// Initialize default instance.
150  ///
152 
153  /// Specifies the value of the timeout at which the handle must close the SSP session.
154  /// The handler must reset this timeout whenever it receives a valid data from the server.
156 
157  /// Specifies the value of the timeout at which the handler must send heartbeat to prevent the server from closing the session
159 
160  /// Size of the communication window.
162 
163  /// Indicates whether compression of the block data is enabled or not
165 
166  /// Returns the string representation.
167  ///
168  std::string toString() const;
169 };
170 
171 ///
172 struct ONIXS_MTS_CASH_SDP_API LogonSettings
173 {
174  /// Initialize default instance.
175  ///
176  LogonSettings();
177 
178  ///TradeImpact service
180 
181  /// Fully qualified trader name (format: �tradername@membername�).
182  std::string userName;
183 
184  /// Password associated with the trader
185  std::string password;
186 
187  /// Returns the string representation.
188  ///
189  std::string toString() const;
190 };
191 
192 ONIXS_MTS_CASH_SDP_API std::ostream& operator << (std::ostream&, const HandlerSettings&);
193 ONIXS_MTS_CASH_SDP_API std::ostream& operator << (std::ostream&, const ConnectionSettings&);
194 ONIXS_MTS_CASH_SDP_API std::ostream& operator << (std::ostream&, const LogonSettings&);
195 
196 }
197 }
198 }
199 }
std::set< size_t > CpuIndexes
ONIXS_MTS_CASH_SDP_API std::ostream & operator<<(std::ostream &stream, TradeImpactService::Enum value)
unsigned short UInt16
Definition: Defines.h:45
std::string userName
Fully qualified trader name (format: �tradername�).
UInt16 clientReceiveAliveIntervalReq
Specifies the value of the timeout at which the handler must send heartbeat to prevent the server fro...
TradeImpactService::Enum service
TradeImpact service.
signed short SInt16
Definition: Defines.h:41
bool compressionEnabled
Indicates whether compression of the block data is enabled or not.
SInt16 comunicWindowSize
Size of the communication window.
ConnectionRetries(int inNumber, unsigned inIntervalSec)
std::string password
Password associated with the trader.