OnixS C++ LSE GTP Market Data Handler 1.0.6
API documentation
Loading...
Searching...
No Matches
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
25
26#include <sstream>
27#include <string>
28#include <set>
29#include <vector>
30
31namespace OnixS
32{
33 namespace LSE
34 {
35 namespace MarketData
36 {
37 namespace GTP
38 {
41 {
44 : port (0)
45 {}
46
48 ServiceDescriptor (const std::string& a, unsigned int port)
49 : address (a)
50 , port (port)
51 {}
52
54 std::string address;
55
57 unsigned port;
58
60 bool operator == (const ServiceDescriptor& other) const
61 {
62 return address == other.address && port == other.port;
63 }
64
66 bool operator != (const ServiceDescriptor& other) const
67 {
68 return !operator==(other);
69 }
70
72 bool valid() const
73 {
74 return !address.empty() && port > 0;
75 }
76 };
77
78 ONIXS_LSE_GTP_API std::ostream& operator << (std::ostream& stream, const ServiceDescriptor& descriptor);
79
82 {
85
88
90 bool operator == (const FeedDescriptor& other) const
91 {
92 return serviceA == other.serviceA && serviceB == other.serviceB;
93 }
94
96 bool operator != (const FeedDescriptor& other) const
97 {
98 return !operator==(other);
99 }
100 };
101
102 ONIXS_LSE_GTP_API std::ostream& operator << (std::ostream& stream, const FeedDescriptor& descriptor);
103
106 {
109
112 const std::string& addr, unsigned int port, const std::string& ssn)
113 : ServiceDescriptor(addr, port)
114 , session(ssn)
115 {}
116
118 bool valid() const
119 {
120 return
121 ServiceDescriptor::valid() && !session.empty();
122 }
123
125 bool operator == (const TcpServiceDescriptor& other) const
126 {
127 return
129 }
130
132 bool operator != (const TcpServiceDescriptor& other) const
133 {
134 return !operator==(other);
135 }
136
138 std::string session;
139 };
140
142 ONIXS_LSE_GTP_API std::ostream& operator << (std::ostream& stream, const TcpServiceDescriptor& descriptor);
143
144
154
156 ONIXS_LSE_GTP_API std::ostream& operator << (std::ostream& stream, const TcpFeedDescriptor& descriptor);
157
158 struct HandlerSettings;
159
160 ONIXS_LSE_GTP_API std::ostream& operator << (std::ostream& stream, const HandlerSettings& settings);
161
164 {
167 : licenseString()
169 , logDirectory("logs")
170 , logFileNamePrefix("LseGtp")
171 , logSettings(LogSettings::Default)
172 , logLevel(LogLevel::Info)
176 , lostPacketWaitTime(100000)
177 , useFeedA(true)
178 , useFeedB(true)
179 , maxPacketSize(1500)
182 , receivingTimeout(10)
183 , sendingTimeout(10)
186 {}
187
189 std::string licenseString;
190
192 std::string licenseDirectory;
193
195 std::string logDirectory;
196
198 std::string logFileNamePrefix ;
199
202
207
212
220 std::string networkInterface;
221
229 std::string networkInterfaceA;
230
238 std::string networkInterfaceB;
239
248
274
299
304
309
312
315
318
327
329 unsigned short maxPacketSize;
330
333
336
338 unsigned int receivingTimeout;
339
341 unsigned int sendingTimeout;
342
345
348
351
353 std::string toString() const
354 {
355 std::ostringstream out;
356 out << *this;
357 return out.str();
358 }
359 };
360
361 }
362 }
363 }
364}
ONIXS_LSE_GTP_API std::ostream & operator<<(std::ostream &stream, const ServiceDescriptor &descriptor)
bool operator==(const FeedDescriptor &other) const
Compares with another instance.
bool operator!=(const FeedDescriptor &other) const
Compares with another instance.
unsigned short maxPacketSize
Max size for network packet transmitted by GTP.
std::string logDirectory
Log files are stored in this directory.
std::string toString() const
Returns the string representation.
LogSettings::Enum logSettings
Combine LogSettings enum values to configure the logger.
std::string logFileNamePrefix
Template of log file name without extension.
bool fullRecoveryOnStart
Request a full recovery on start.
unsigned int replayMaxPacketsNumber
Lost packets threshold when the Handler prefers replay, must not exceed 65000.
TcpFeedDescriptor recoveryTcpService
Recovery TCP service credentials.
unsigned int sendingTimeout
Heartbeat interval for sending packets to replay and recovery services (sec), default value is 10 sec...
FeedDescriptor realtimeMulticastFeed
Realtime feed.
unsigned int receivingTimeout
Minimum timeout value to wait for a response from replay and recovery services (sec),...
unsigned int minReconnectingTimeout
Minimum timeout value between attempts to connect replay and recovery services (sec),...
unsigned int maxConnectingAttempts
Max number of attempts to connect replay and recovery services, default value is 3.
TcpFeedDescriptor replayTcpService
Replay TCP service credentials.
unsigned int sequenceResetThreshold
Threshold to detect sequence reset.
std::string licenseDirectory
Path to the license directory.
bool operator!=(const ServiceDescriptor &other) const
Compares with another instance.
bool valid() const
Returns true if the descriptor points to valid ip address.
ServiceDescriptor(const std::string &a, unsigned int port)
bool operator==(const ServiceDescriptor &other) const
Compares with another instance.
Describse GTP services such as replay or recovery.
bool valid() const
Returns true if the descriptor is valid.
TcpServiceDescriptor(const std::string &addr, unsigned int port, const std::string &ssn)
std::string session
Session supplied by LSEG.
bool operator==(const TcpServiceDescriptor &other) const
Compares with another instance.
bool operator!=(const TcpServiceDescriptor &other) const
Compares with another instance.