OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.15.1
API documentation
HandlerSettings.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Onix Solutions Limited. All rights reserved.
3  *
4  * This software owned by Onix Solutions Limited 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 "Export.h"
23 #include "Enumerations.h"
24 #include "LogSettings.h"
25 #include "LogReplayInputStream.h"
26 
27 #include <iosfwd>
28 #include <set>
29 #include <string>
30 #include <vector>
31 
32 namespace OnixS { namespace ICE { namespace iMpact { namespace MarketData {
33 
34 /// Defines snapshot recovery options.
35 struct ONIXS_ICEMDH_EXPORT SnapshotRecoveryOptions
36 {
37  /**
38  * Snapshot Recovery Timeout In Milliseconds
39  * \li -1 - to wait indefinitely for snapshots (default)
40  * \li 0 - not to use snapshots at all
41  * \li >0 - the number of milliseconds to wait
42  */
44 
45  /**
46  * Maximum Number Of Snapshot Recovery Attempts
47  * \li -1 - unlimited (default)
48  * \li 0 - not to use snapshots at all
49  * \li >0 - the number of attempts
50  */
52 
53  /**
54  * Maximum size of the snapshot message queue
55  *
56  * \note Default value is 200000.
57  */
59 
60  /**
61  * Maximum size of the live message queue
62  *
63  * \note Default value is 200000.
64  */
66 
67  /// Initializes instance with default values.
69 
70  /// Returns string representation.
71  std::string toString() const;
72 };
73 
74 /// Standard output operator.
75 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const SnapshotRecoveryOptions&);
76 
77 /// Ordered list of logs to be replayed.
78 typedef std::vector<std::string> LogList;
79 
80 /// Read-write iterator over ordered list of logs to be replayed.
81 typedef std::vector<std::string>::iterator LogListEntry;
82 
83 /// Set of regular expressions.
84 typedef std::set<std::string> RegexSet;
85 
86 /// Defines set of settings which affect behavior of the Handler.
87 struct ONIXS_ICEMDH_EXPORT HandlerSettings
88 {
89  /**
90  * Content of the license file as a string.
91  *
92  * \note Default value is empty string.
93  * \note The Handler checks this license first.
94  */
95  std::string licenseString;
96 
97  /**
98  * Path to the license directory.
99  *
100  * \note Default value is \e "./" (the current directory).
101  * \note A home directory also used to search a license.
102  */
103  std::string licenseDirectory;
104 
105  /**
106  * Log files are stored in this directory.
107  *
108  * \note Default value is \e "./" (the current directory).
109  */
110  std::string logDirectory;
111 
112  /**
113  * Template of log file name without extension.
114  *
115  * \note Default value is \e "IceImpactMulticastPriceFeedHandlerCpp".
116  */
117  std::string logFileNamePrefix;
118 
119  /**
120  * Log verbosity.
121  *
122  * \note Default value is LogLevels::Info.
123  */
125 
126  /**
127  * Additional options to control which data is to be logged.
128  * Ignored if logging is disabled.
129  *
130  * \note The default value is \c AdvancedLogOptions::Default.
131  */
133 
134  /**
135  * Defines path to connectivity configuration which defines multicast
136  * groups, types of markets which belong to the groups and
137  * connection info for multicast feeds for the groups.
138  */
140 
141  /**
142  * Specifies one or more network interfaces to use while
143  * joining the multicast group; use semi-colon delimited
144  * list if more than one.
145  *
146  * \note On Linux the network interface is specified
147  * by its name, on Windows - by IP address.
148  *
149  * \note If the value is empty or absent then the
150  * default networking interface is used.
151  */
152  std::string networkInterface;
153 
154  /**
155  * Specifies maximal time interval in seconds between two
156  * network packets. If no data is received during specified
157  * time frame, warning is reported.
158  *
159  * \note The default value is \c 36000.
160  */
162 
163  /**
164  * Specifies maximal sequence gap margin between first
165  * and last received network packets in internal queue.
166  *
167  * \note Default value is \c 10000.
168  */
170 
171  /**
172  * Specifies maximal time interval in milliseconds to
173  * wait network packet with next expected sequence number.
174  *
175  * \note Default value is \c 10000.
176  */
178 
179  /// Specifies snapshot recovery options.
181 
182  /**
183  * List of logs to be replated.
184  *
185  * \attention Must be stored in 'oldest to recent' order.
186  */
187  LogList logs;
188 
189  /// User defined input stream for log replay logs will be ignored
191 
192  /**
193  * Log player speed multiplier.
194  *
195  * This is an \f$ m \f$ in the formula \f$ mT+k \f$ to calculate delays between packets,
196  * where \f$ T \f$ is original delay. Values less than \c 1 means reduced speed, greater
197  * than \c 1 means increased speed. Default value is \c 0.0 which means a normal speed.
198  */
200 
201  /**
202  * Log player speed auxiliary delay.
203  *
204  * This is an \f$ k \f$ in the formula \f$ mT+k \f$ to calculate delays between packets,
205  * where \f$ T \f$ is original delay. Default value is \c 0.
206  */
208 
209  /**
210  * Track top of the book only.
211  *
212  * This flag should be set to true when only top of the book updates are needed.
213  *
214  * Default value is \c false.
215  */
217 
218  /**
219  * Receive product definitions only.
220  *
221  * This flag should be set to true when only product definitions are needed.
222  *
223  * Default value is \c false.
224  */
226 
227  /**
228  * Max multicast message block size.
229  *
230  * This option determines the size in bytes of a buffer that is used
231  * as a storage for the incoming mulsticast message block.
232  *
233  * By default, the size set at 1400 bytes.
234  */
236 
237  /**
238  * Path to the product definition cache directory.
239  *
240  * If a value is set and it is a valid path to a directory,
241  * the product definition cache will be created and used on the
242  * daily basis. If the value is not set, the cache will not be
243  * created an product definitions will be downloaded by establishing
244  * a TCP connection to ICE server.
245  *
246  * \note Default value is empty string (cache is disabled).
247  */
249 
250  /**
251  * A set of regular expressions which will be used to check
252  * if Error Response should be treated as error or warning.
253  *
254  * By default, includes the following regular expressions:
255  *
256  * "No .*markets for market type .*"
257  */
259 
260  /**
261  * Use Historical Replay recovery.
262  *
263  * In case of message gap, the Handler will try to fill it with
264  * Historical Replay Request over TCP connection to get missing
265  * messages with corresponding sequence numbers.
266  *
267  * Default value is `false`.
268  */
270 
271  /// Initializes instance with default values for control parameters.
272  HandlerSettings();
273 
274  /// Returns string representation.
275  std::string toString() const;
276 };
277 
278 /// Make it printable to formatted C++ I/O streams.
279 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const HandlerSettings&);
280 
281 }}}} // namespace MarketData, iMpact, ICE, OnixS
Defines set of settings which affect behavior of the Handler.
LogReplayInputStream * inputStream
User defined input stream for log replay logs will be ignored.
SnapshotRecoveryOptions snapshotRecoveryOptions
Specifies snapshot recovery options.
std::ostream & operator<<(std::ostream &, const Error &)
Make it printable to formatted C++ I/O streams.
Declare ICE iMpact enumerations.
std::vector< std::string >::iterator LogListEntry
Read-write iterator over ordered list of logs to be replayed.
std::set< std::string > RegexSet
Set of regular expressions.
unsigned AdvancedLogOptionSet
Additional options to control log information.
Definition: LogSettings.h:86
std::vector< std::string > LogList
Ordered list of logs to be replayed.