OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
FeedEngine.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 <string>
24
26
28
33
58
62{
63public:
67
70 : eventsDispatched_(0)
71 , ioWaited_(0)
72 , reserved_(0)
73 {
74 }
75
78 bool eventsDispatched() const
79 {
80 return 0 != eventsDispatched_;
81 }
82
85 void eventsDispatched(bool state)
86 {
87 eventsDispatched_ = state ? 1 : 0;
88 }
89
92 bool ioWaited() const
93 {
94 return 0 != ioWaited_;
95 }
96
99 void ioWaited(bool state)
100 {
101 ioWaited_ = state ? 1 : 0;
102 }
103
106 {
107 return reserved_;
108 }
109
111 void reserved(Flags flags)
112 {
113 reserved_ = flags;
114 }
115
116private:
117 Flags eventsDispatched_ : 1;
118 Flags ioWaited_ : 1;
119 Flags reserved_ : 30;
120};
121
128{
129public:
131 virtual ~NetFeedEngine() = default;
132
135 const std::string& engineId() const noexcept;
136
139 std::string about();
140
143 virtual void info(std::string&) = 0;
144
149 virtual NetFeedLink& allocate(const NetFeed&) = 0;
150
154 virtual WatchService& watch() = 0;
155
164
165protected:
171
174 Logger& logger() const noexcept;
175
176private:
177 NetFeedEngine(const NetFeedEngine&) = delete;
178 NetFeedEngine& operator=(const NetFeedEngine&) = delete;
179
180 const std::string id_;
181 Logger* const logger_;
182};
183
184inline Logger& NetFeedEngine::logger() const noexcept
185{
186 return *logger_;
187}
188
189inline const std::string& NetFeedEngine::engineId() const noexcept
190{
191 return id_;
192}
193
199inline bool process(NetFeedEngine& engine)
200{
201 return engine.process().eventsDispatched();
202}
203
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:69
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:61
#define ONIXS_CMEMDH_LTWT_CLASS_DECL(name)
Definition Bootstrap.h:63
#define ONIXS_CMEMDH_EXPORTED_CLASS_DECL(typeName)
Definition Bootstrap.h:50
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:73
#define ONIXS_CMEMDH_EXPORTED_STRUCT_DECL(typeName)
Definition Bootstrap.h:51
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:163
Defines the interface for creating and submitting log entries.
Definition Logger.h:198
Flags reserved() const
Reserved (unused) flags.
Definition FeedEngine.h:105
NetFeedEngineProcessResult()
Initializes zero-state instance.
Definition FeedEngine.h:69
void reserved(Flags flags)
Reserved (unused) flags.
Definition FeedEngine.h:111
Defines settings shared by network feed-engine implementations.
Definition FeedEngine.h:36
Logger * logger() const
Returns the custom logger selected for the feed engine.
Logger & loggerOrDefault() const
Returns the effective logger selected for the feed engine.
NetFeedEngineSettings & logger(Logger *logger)
Selects the logger to be used by the feed engine.
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
virtual ~NetFeedEngine()=default
Finalizes the instance.
virtual void info(std::string &)=0
virtual NetFeedLink & allocate(const NetFeed &)=0
std::string about()
Returns information about the actual feed-engine implementation.
virtual NetFeedEngineProcessResult process()=0
Logger & logger() const noexcept
Returns the logger selected when this engine was constructed.
Definition FeedEngine.h:184
virtual WatchService & watch()=0
NetFeedEngine(const NetFeedEngineSettings &settings=NetFeedEngineSettings{})
Constructs an engine and generates its identifier.
Base attributes of market data feed.
Definition Feed.h:55
std::uint32_t UInt32
uInt32.
Definition Integral.h:35
bool process(NetFeedEngine &engine)
Definition FeedEngine.h:199
STL namespace.
Abstract watch service.
Definition Watch.h:35