OnixS C++ CME MDP Premium Market Data Handler 5.11.1
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 Messaging::UInt32 socketBufferSize_;
120 Messaging::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:
144
147
150
153 void info(std::string&) override;
154
156 NetFeedLink& allocate(const NetFeed&) override;
157
160 WatchService& watch() override;
161
168
169private:
170 const std::string& id() const noexcept {return NetFeedEngine::engineId();}
171
172 class Workhorse;
173 Workhorse* workhorse_;
174};
175
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:69
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:61
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:73
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:163
NetFeedEngineSettings()
Initializes the settings with the default logger.
const std::string & engineId() const noexcept
Returns the identifier generated for this engine.
Definition FeedEngine.h:189
std::string about()
Returns information about the actual feed-engine implementation.
NetFeedEngine(const NetFeedEngineSettings &settings=NetFeedEngineSettings{})
Constructs an engine and generates its identifier.
Base attributes of market data feed.
Definition Feed.h:55
void socketBufferSize(Messaging::UInt32 value)
Sets socketBufferSize.
void packetMaxSize(PacketSize value)
Max size for network packet transmitted by MDP.
void dataWaitTime(Messaging::UInt32 value)
Sets dataWaitTime.
void info(std::string &) override
~SocketFeedEngine() override
Destructs the given instance.
NetFeedLink & allocate(const NetFeed &) override
Allocates a link for the given feed.
NetFeedEngineProcessResult process() override
SocketFeedEngine(const SocketFeedEngineSettings &=SocketFeedEngineSettings())
Initializes the engine according to the given configuration.
WatchService & watch() override
std::uint32_t UInt32
uInt32.
Definition Integral.h:35
Messaging::UInt16 PacketSize
Represents a packet size in bytes.
void toStr(std::string &str, BookState::Enum bookState)
Appends a string representation of a book state.
Abstract watch service.
Definition Watch.h:35