OnixS C++ B3 Binary UMDF Market Data Handler 1.11.1
Users' manual and 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
26
27#include <sstream>
28#include <string>
29#include <set>
30#include <vector>
31#include <limits>
32
34
35class FeedEngine;
36
38struct Feed
39{
40 Feed() = default;
41
43 Feed(const std::string& addr, unsigned int port, const std::string& nif = "", FeedEngine* fe = nullptr)
44 : address(addr)
45 , port(port)
46 , networkInterface(nif)
47 , feedEngine(fe)
48 {}
49
51 std::string address;
52
54 unsigned port = 0;
55
59 std::string networkInterface;
60
64
66 bool valid() const
67 {
68 return !address.empty() && port > 0;
69 }
70};
71
72ONIXS_B3_UMDF_MD_API std::ostream& operator<<(std::ostream& stream, const Feed& descriptor);
73
76{
79
82};
83
84ONIXS_B3_UMDF_MD_API std::ostream& operator<<(std::ostream& stream, const FeedGroup& descriptor);
85
87
88ONIXS_B3_UMDF_MD_API std::ostream& operator<<(std::ostream& stream, const HandlerSettings& settings);
89
91
92#if defined (_MSC_VER)
93#pragma warning (push)
94#pragma warning (disable: 4251)
95#endif
96
98struct ONIXS_B3_UMDF_MD_API HandlerSettings
99{
102
104 std::string licenseString;
105
107 std::string licenseDirectory;
108
111
119 std::string networkInterface;
120
128 std::string networkInterfaceA;
129
137 std::string networkInterfaceB;
138
145
169
192
195
198
201
203 bool buildOrderBooks = false;
204
208
210 static constexpr size_t FullOrderBookDepth = std::numeric_limits<UInt32>::max();
211
214
220
223
225 size_t incrementalQueueSize = 50000;
226
228 std::string toString() const
229 {
230 std::ostringstream out;
231 out << *this;
232 return out.str();
233 }
234
236 HandlerSettings& loadFeeds(int channelId, const std::string& channelConfigFile);
237
239 static void gatherChannelIds(std::vector<int>& channelIds, const std::string& channelConfigFile);
240};
241
242#if defined (_MSC_VER)
243#pragma warning (pop)
244#endif
245
#define ONIXS_B3_UMDF_MD_NAMESPACE_END
Definition ABI.h:168
#define ONIXS_B3_UMDF_MD_NAMESPACE_BEGIN
Definition ABI.h:163
#define ONIXS_B3_UMDF_MD_API_DECL(typeKind, typeName)
Definition ABI.h:31
The Feed Engine machinery.
Definition FeedEngine.h:128
A shared memory pool for building order books.
Definition OrderBook.h:90
std::ostream & operator<<(std::ostream &stream, const LoggerSettings &settings)
Messaging::UInt32 UInt32
Definition Integral.h:37
FeedEngine * feedEngine
Feed engine to use on feed.
bool valid() const
Returns true if the descriptor points to valid ip address.
std::string networkInterface
Specifies one or more network interfaces to use while joining the multicast group; use semi-colon del...
Feed(const std::string &addr, unsigned int port, const std::string &nif="", FeedEngine *fe=nullptr)
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...
std::string toString() const
Returns the string representation.
static void gatherChannelIds(std::vector< int > &channelIds, const std::string &channelConfigFile)
Gathers channel ids from the given channel configuration file.
std::string networkInterface
Specifies one or more network interfaces to use while joining the multicast group; use semi-colon del...
bool discardQueuedIncrementalPacketsIncludedInSnapshots
Discard queued incremental packets included in snapshots.
OrderBookPool * orderBookPool
A shared pool for building books.
bool startIncrementalFeedsAfterInstrumentRecovery
Start incremental feeds after instrument recovery.
FeedGroup snapshotFeeds
Snapshot recovery multicast feeds.
LoggerSettings loggerSettings
Logger settings.
static constexpr size_t FullOrderBookDepth
Max depth of the order book.
UInt32 outOfOrderPacketMaxInterval
Defines value of threshold used by Handler to differ out-of-order packets from gaps.
FeedGroup instrumentFeeds
Instrument definition multicast feeds.
UInt32 heartbeatInterval
Specifies maximal time interval between two network packets.
size_t incrementalQueueSize
Max incremental queue size.
FeedGroup incrementalFeeds
Incremental multicast feeds.
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.
size_t orderBookDepth
Exposed depth of the order books.
HandlerSettings & loadFeeds(int channelId, const std::string &channelConfigFile)
Loads channel feed settings from the given channel configuration file.