OnixS C++ CME MDP Premium Market Data Handler 5.9.0
Users' manual and API documentation
Loading...
Searching...
No Matches
SocketFeedEngine.h
Go to the documentation of this file.
1// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2//
3// This software owned by Onix Solutions Limited [OnixS] and is
4// protected by copyright law and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable
7// OnixS Software Services Agreement (the Agreement) and Customer end user license
8// agreements granting a non-assignable, non-transferable and non-exclusive license
9// to use the software for it's own data processing purposes under the terms defined
10// in the Agreement.
11//
12// Except as otherwise granted within the terms of the Agreement, copying or
13// reproduction of any part of this source code or associated reference material
14// to any other location for further reproduction or redistribution, and any
15// amendments to this copyright notice, are expressly prohibited.
16//
17// Any reproduction or redistribution for sale or hiring of the Software not in
18// accordance with the terms of the Agreement is a violation of copyright law.
19//
20
21#pragma once
22
23#include <OnixS/CME/MDH/Watch.h>
26
28
33{
34public:
38 : packetMaxSize_(1420)
39 , watch_(&UtcWatch::service())
40 , socketBufferSize_(8 * 1024 * 1024)
41 , dataWaitTime_(10)
42 {
43 }
44
47
52 {
53 return packetMaxSize_;
54 }
55
58 {
59 packetMaxSize_ = value;
60 }
61
69 {
70 return *watch_;
71 }
72
77 {
78 watch_ = &watch;
79 }
80
85 {
86 return socketBufferSize_;
87 }
88
91 {
92 socketBufferSize_ = value;
93 }
94
105 {
106 return dataWaitTime_;
107 }
108
111 {
112 dataWaitTime_ = value;
113 }
114
115private:
116 PacketSize packetMaxSize_;
117 WatchService* watch_;
118
119 UInt32 socketBufferSize_;
120 UInt32 dataWaitTime_;
121};
122
125void toStr(std::string&, const SocketFeedEngineSettings&);
126
128inline std::string toStr(const SocketFeedEngineSettings& settings)
129{
130 std::string str;
131
132 toStr(str, settings);
133
134 return str;
135}
136
141{
142public:
145
148
151
154 void info(std::string&) ONIXS_CMEMDH_OVERRIDE;
155
158
162
169
170private:
171 // The workhorse for the multi-threaded
172 // feed engine based on the standard socket
173 // API and a pool of threads.
174 class Workhorse;
175
176 Workhorse* workhorse_;
177};
178
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:67
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:46
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:68
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:171
#define ONIXS_CMEMDH_OVERRIDE
Definition Compiler.h:176
NetFeedEngine()
Construction through the descendants.
Definition FeedEngine.h:133
Base attributes of market data feed.
Definition Feed.h:55
void packetMaxSize(PacketSize value)
Max size for network packet transmitted by MDP.
void socketBufferSize(UInt32 value)
Sets socketBufferSize.
void dataWaitTime(UInt32 value)
Sets dataWaitTime.
void info(std::string &) override
~SocketFeedEngine() override
Destructs the given instance.
SocketFeedEngine()
Initializes the engine with the default settings.
NetFeedLink & allocate(const NetFeed &) override
Allocates a link for the given feed.
NetFeedEngineProcessResult process() override
WatchService & watch() override
SocketFeedEngine(const SocketFeedEngineSettings &)
Initializes the engine according to the given configuration.
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
UInt32 UInt32
uInt32.
Definition Fields.h:202
UInt16 PacketSize
Integral type for measuring packets.
Abstract watch service.
Definition Watch.h:30