OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.10.0
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  * Path to the license directory.
91  *
92  * \note Default value is \e "./" (the current directory).
93  * \note A home directory also used to search a license.
94  */
95  std::string licenseDirectory;
96 
97  /**
98  * Log files are stored in this directory.
99  *
100  * \note Default value is \e "./" (the current directory).
101  */
102  std::string logDirectory;
103 
104  /**
105  * Template of log file name without extension.
106  *
107  * \note Default value is \e "IceImpactMulticastPriceFeedHandlerCpp".
108  */
109  std::string logFileNamePrefix;
110 
111  /**
112  * Log verbosity.
113  *
114  * \note Default value is LogLevels::Info.
115  */
117 
118  /**
119  * Additional options to control which data is to be logged.
120  * Ignored if logging is disabled.
121  *
122  * \note The default value is \c AdvancedLogOptions::Default.
123  */
125 
126  /**
127  * Defines path to connectivity configuration which defines multicast
128  * groups, types of markets which belong to the groups and
129  * connection info for multicast feeds for the groups.
130  */
132 
133  /**
134  * Specifies one or more network interfaces to use while
135  * joining the multicast group; use semi-colon delimited
136  * list if more than one.
137  *
138  * \note On Linux the network interface is specified
139  * by its name, on Windows - by IP address.
140  *
141  * \note If the value is empty or absent then the
142  * default networking interface is used.
143  */
144  std::string networkInterface;
145 
146  /**
147  * Specifies maximal time interval in seconds between two
148  * network packets. If no data is received during specified
149  * time frame, warning is reported.
150  *
151  * \note The default value is \c 36000.
152  */
154 
155  /**
156  * Specifies maximal sequence gap margin between first
157  * and last received network packets in internal queue.
158  *
159  * \note Default value is \c 10000.
160  */
162 
163  /**
164  * Specifies maximal time interval in milliseconds to
165  * wait network packet with next expected sequence number.
166  *
167  * \note Default value is \c 10000.
168  */
170 
171  /// Specifies snapshot recovery options.
173 
174  /**
175  * List of logs to be replated.
176  *
177  * \attention Must be stored in 'oldest to recent' order.
178  */
179  LogList logs;
180 
181  /// User defined input stream for log replay logs will be ignored
183 
184  /**
185  * Log player speed multiplier.
186  *
187  * This is an \f$ m \f$ in the formula \f$ mT+k \f$ to calculate delays between packets,
188  * where \f$ T \f$ is original delay. Values less than \c 1 means reduced speed, greater
189  * than \c 1 means increased speed. Default value is \c 0.0 which means a normal speed.
190  */
192 
193  /**
194  * Log player speed auxiliary delay.
195  *
196  * This is an \f$ k \f$ in the formula \f$ mT+k \f$ to calculate delays between packets,
197  * where \f$ T \f$ is original delay. Default value is \c 0.
198  */
200 
201  /**
202  * Track top of the book only.
203  *
204  * This flag should be set to true when only top of the book updates are needed.
205  *
206  * Default value is \c false.
207  */
209 
210  /**
211  * Receive product definitions only.
212  *
213  * This flag should be set to true when only product definitions are needed.
214  *
215  * Default value is \c false.
216  */
218 
219  /**
220  * Max multicast message block size.
221  *
222  * This option determines the size in bytes of a buffer that is used
223  * as a storage for the incoming mulsticast message block.
224  *
225  * By default, the size set at 1400 bytes.
226  */
228 
229  /**
230  * Path to the product definition cache directory.
231  *
232  * If a value is set and it is a valid path to a directory,
233  * the product definition cache will be created and used on the
234  * daily basis. If the value is not set, the cache will not be
235  * created an product definitions will be downloaded by establishing
236  * a TCP connection to ICE server.
237  *
238  * \note Default value is empty string (cache is disabled).
239  */
241 
242  /**
243  * A set of regular expressions which will be used to check
244  * if Error Response should be treated as error or warning.
245  *
246  * By default, includes the following regular expressions:
247  *
248  * "No .*markets for market type .*"
249  */
251 
252  /// Initializes instance with default values for control parameters.
253  HandlerSettings();
254 
255  /// Returns string representation.
256  std::string toString() const;
257 };
258 
259 /// Make it printable to formatted C++ I/O streams.
260 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const HandlerSettings&);
261 
262 }}}} // 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.