OnixS C++ HKEX OMD-C Handler 1.0.0
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 HKEX
34 {
35 namespace MarketData
36 {
37 namespace Omdc
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_HKEX_OMDC_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_HKEX_OMDC_API std::ostream& operator << (std::ostream& stream, const FeedDescriptor& descriptor);
103
104 struct HandlerSettings;
105
106 ONIXS_HKEX_OMDC_API std::ostream& operator << (std::ostream& stream, const HandlerSettings& settings);
107
110 {
113 : licenseString("")
114 , licenseDirectory("")
115 , logDirectory("logs")
116 , logFileNamePrefix("HkexOmdc")
117 , logSettings(LogSettings::Default)
118 , logLevel(LogLevel::Info)
122 , lostPacketWaitTime(100000)
123 , useFeedA(true)
124 , useFeedB(true)
125 , channelId(0)
127 , maxPacketSize(1500)
130 {}
131
133 std::string licenseString;
134
136 std::string licenseDirectory;
137
139 std::string logDirectory;
140
142 std::string logFileNamePrefix ;
143
146
151
156
164 std::string networkInterface;
165
173 std::string networkInterfaceA;
174
182 std::string networkInterfaceB;
183
192
218
243
248
253
255
260 UInt16 channelId;
261
264
267
270
272 unsigned short maxPacketSize;
273
276
279
281 std::string toString() const
282 {
283 std::ostringstream out;
284 out << *this;
285 return out.str();
286 }
287 };
288
289 }
290 }
291 }
292}
293
294
295
ONIXS_HKEX_OMDC_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.
UInt16 channelId
Realtime multicast channel Id.
unsigned short maxPacketSize
Max size for network packet transmitted by OMDC.
std::string networkInterfaceB
Specifies one or more network interfaces to use while joining the multicast group B; use semi-colon d...
std::string networkInterfaceA
Specifies one or more network interfaces to use while joining the multicast group A; use semi-colon d...
unsigned int retransmissionMaxPacketsNumber
Lost packets threshold when the Handler prefers replay, should not exceed 10000.
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 networkInterface
Specifies one or more network interfaces to use while joining the multicast group; use semi-colon del...
std::string logFileNamePrefix
Template of log file name without extension.
unsigned int maxBooksObjectAmount
Defines size of pre-allocated memory for Order Book. Default value is 100.
UInt32 outOfOrderPacketMaxInterval
Defines value of threshold used by Handler to differ out-of-order packets from gaps.
UInt32 heartbeatInterval
Specifies maximal time interval between two network packets.
std::string licenseDirectory
Path to the license directory.
UInt32 lostPacketWaitTime
Indicates for how long Handler should wait for the packet before it's considered as totally lost.
LogFilePermission::Enum logFilePermissions
Log file permissions.
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.