OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
HandlerSettings.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
33
35
37
40{
41public:
43 typedef std::vector<std::string> LicenseStores;
44
47 : SettingGroup(controller)
48 {
49 }
50
54 : SettingGroup()
55 , stores_(other.stores_)
56 , licenseString_(other.licenseString_)
57 {
58 }
59
63 LicenseSettings& addLicenseStore(const std::string& value)
64 {
65 LicenseStores stores = stores_;
66 stores.push_back(value);
67
68 controlAssignment("License Store", stores_, stores);
69 return *this;
70 }
71
75 LicenseSettings& licenseStore(const std::string& value)
76 {
77 LicenseStores stores;
78 stores.push_back(value);
79
80 controlAssignment("License Store", stores_, stores);
81 return *this;
82 }
83
87 LicenseSettings& licenseString(const std::string& value)
88 {
89 controlAssignment("License String", licenseString_, value);
90 return *this;
91 }
92
95 {
96 return stores_;
97 }
98
100 const std::string& licenseString() const
101 {
102 return licenseString_;
103 }
104
109 {
110 controlChange("Handler Settings", &LicenseSettings::assignNoControl, *this, other);
111
112 return *this;
113 }
114
115private:
116 void assignNoControl(const LicenseSettings& other)
117 {
118 stores_ = other.stores_;
119 licenseString_ = other.licenseString_;
120 }
121
122 LicenseStores stores_;
123 std::string licenseString_;
124
126};
127
130{
131public:
134 : SettingGroup(controller)
135 , channel_(0)
136 , feeds_(controller)
137 , session_(controller)
138 , tradeProcessing_(TradeProcessing::SummaryLevel)
139 , bookManagement_(controller)
140 , recoveryQueueMaxSize_(1000000)
141 , instrumentCache_()
142 , logging_(controller)
143 , listeners_(controller)
144 , licenseSettings_(controller)
145 , dataCenter_(DataCenter::Primary)
146
147 {
148 }
149
153 : SettingGroup()
154 , channel_(other.channel_)
155 , feeds_(other.feeds_)
156 , session_(other.session_)
157 , tradeProcessing_(other.tradeProcessing_)
158 , bookManagement_(other.bookManagement_)
159 , recoveryQueueMaxSize_(other.recoveryQueueMaxSize_)
160 , instrumentCache_(other.instrumentCache_)
161 , logging_(other.logging_)
162 , listeners_(other.listeners_)
163 , licenseSettings_(other.licenseSettings_)
164 , configurationFile_(other.configurationFile_)
165 , configurationString_(other.configurationString_)
166 , dataCenter_(other.dataCenter_)
167 {
168 }
169
172
175 {
176 return channel_;
177 }
178
183 {
184 controlAssignment("Channel Id", channel_, value);
185
186 return *this;
187 }
188
189
191 const std::string& connectivityConfigurationFile() const
192 {
193 return configurationFile_;
194 }
195
198 const std::string& connectivityConfigurationString() const
199 {
200 return configurationString_;
201 }
202
207 {
208 return dataCenter_;
209 }
210
236 const std::string& configurationFile, DataCenter::Enum dataCenter = DataCenter::Primary)
237 {
239 "Connectivity Configuration File",
240 &HandlerSettings::assignConnectivityConfiguration,
241 *this,
242 configurationFile,
244 );
245
246 return *this;
247 }
248
259 const std::string& configuration, DataCenter::Enum dataCenter = DataCenter::Primary)
260 {
262 "Connectivity Configuration String",
263 &HandlerSettings::assignConnectivityConfigurationString,
264 *this,
265 configuration,
267 );
268
269 return *this;
270 }
271
273 const FeedSettings& feeds() const
274 {
275 return feeds_;
276 }
277
280 {
281 return feeds_;
282 }
283
286 {
287 return session_;
288 }
289
292 {
293 return session_;
294 }
295
298 {
299 return listeners_;
300 }
301
304 {
305 return listeners_;
306 }
307
310 {
311 return tradeProcessing_;
312 }
313
318 {
319 controlAssignment("Trade Processing Strategy", tradeProcessing_, strategy);
320
321 return *this;
322 }
323
326 {
327 return bookManagement_;
328 }
329
332 {
333 return bookManagement_;
334 }
335
348 {
349 return recoveryQueueMaxSize_;
350 }
351
357 {
358 controlAssignment("Recovery Queue Max Size", recoveryQueueMaxSize_, queueMaxSize);
359
360 return *this;
361 }
362
378 const std::string& instrumentCache() const
379 {
380 return instrumentCache_;
381 }
382
397 HandlerSettings& instrumentCache(const std::string& filename)
398 {
399 controlAssignment("Instrument Cache Path", instrumentCache_, filename);
400
401 return *this;
402 }
403
406 {
407 return logging_;
408 }
409
412 {
413 return logging_;
414 }
415
418 {
419 return licenseSettings_;
420 }
421
424 {
425 return licenseSettings_;
426 }
427
428#if !defined(ONIXS_CMEMDH_NO_DEPRECATED)
429
435 HandlerDebugLoggingSettings& debugLogging()
436 {
437 return logging_.debug();
438 }
439
445 const HandlerDebugLoggingSettings& debugLogging() const
446 {
447 return logging_.debug();
448 }
449
450#endif // ONIXS_CMEMDH_NO_DEPRECATED
451
456 {
457 controlChange("Handler Settings", &HandlerSettings::assignNoControl, *this, other);
458
459 return *this;
460 }
461
462private:
463 ChannelId channel_;
464
465 FeedSettings feeds_;
466
467 SessionSettings session_;
468
469 TradeProcessing::Enum tradeProcessing_;
470 BookManagement bookManagement_;
471
472 Messaging::UInt32 recoveryQueueMaxSize_;
473 std::string instrumentCache_;
474
475 LoggingSettings logging_;
476
477 HandlerListeners listeners_;
478
479 LicenseSettings licenseSettings_;
480
481 std::string configurationFile_;
482
483 std::string configurationString_;
484
485 DataCenter::Enum dataCenter_;
486
487 void assignNoControl(const HandlerSettings& other)
488 {
489 channel_ = other.channel_;
490
491 feeds_.assignNoControl(other.feeds_);
492
493 session_.assignNoControl(other.session_);
494
495 tradeProcessing_ = other.tradeProcessing_;
496
497 bookManagement_.assignNoControl(other.bookManagement_);
498
499 recoveryQueueMaxSize_ = other.recoveryQueueMaxSize_;
500
501 instrumentCache_ = other.instrumentCache_;
502
503 logging_.assignNoControl(other.logging_);
504
505 listeners_.assignNoControl(other.listeners_);
506
507 licenseSettings_.assignNoControl(other.licenseSettings_);
508
509 configurationFile_ = other.configurationFile_;
510
511 configurationString_ = other.configurationString_;
512
513 dataCenter_ = other.dataCenter_;
514 }
515
517 void assignConnectivityConfiguration(const std::string& configurationFile, DataCenter::Enum dataCenter)
518 {
519 configurationFile_ = configurationFile;
520
521 configurationString_.clear();
522
523 dataCenter_ = dataCenter;
524 }
525
527 void assignConnectivityConfigurationString(const std::string& configuration, DataCenter::Enum dataCenter)
528 {
529 configurationString_ = configuration;
530
531 configurationFile_.clear();
532
533 dataCenter_ = dataCenter;
534 }
535};
536
539void toStr(std::string&, const HandlerSettings&);
540
542inline std::string toStr(const HandlerSettings& settings)
543{
544 std::string str;
545
546 toStr(str, settings);
547
548 return str;
549}
550
554
#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_NAMESPACE_END
Definition Bootstrap.h:73
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:163
Aggregates all book management settings used by the Handler.
Associates application-owned listeners with a Handler.
Handler's configuration settings.
HandlerSettings & connectivityConfigurationString(const std::string &configuration, DataCenter::Enum dataCenter=DataCenter::Primary)
Defines inline connectivity configuration XML from which to load feed connection settings.
LoggingSettings & logging()
Settings affecting logging.
const FeedSettings & feeds() const
Reference to parameters related with feeds.
TradeProcessing::Enum tradeProcessing() const
Indicates how trades are processed.
LicenseSettings & licenseSettings()
Settings affecting licensing.
Messaging::UInt32 recoveryQueueMaxSize() const
HandlerSettings & operator=(const HandlerSettings &other)
const std::string & connectivityConfigurationString() const
Returns the inline connectivity configuration XML.
const LoggingSettings & logging() const
Settings affecting logging.
HandlerSettings(SettingChangeController *controller=nullptr)
Initializes parameters with default values.
const LicenseSettings & licenseSettings() const
Settings affecting licensing.
HandlerSettings & connectivityConfigurationFile(const std::string &configurationFile, DataCenter::Enum dataCenter=DataCenter::Primary)
const std::string & instrumentCache() const
const SessionSettings & session() const
Settings affecting processing session.
HandlerSettings(const HandlerSettings &other)
~HandlerSettings()
Cleans everything up.
SessionSettings & session()
Settings affecting processing session.
const HandlerListeners & listeners() const
Listeners associated with the Handler.
FeedSettings & feeds()
Reference to parameters related with feeds.
BookManagement & bookManagement()
Reference to parameters affecting book management.
const std::string & connectivityConfigurationFile() const
Path to the connectivity configuration file.
HandlerSettings & recoveryQueueMaxSize(Messaging::UInt32 queueMaxSize)
HandlerSettings & channel(ChannelId value)
HandlerListeners & listeners()
Listeners associated with the Handler.
ChannelId channel() const
Identifies CME market data channel.
const BookManagement & bookManagement() const
Reference to parameters affecting book management.
HandlerSettings & tradeProcessing(TradeProcessing::Enum strategy)
DataCenter::Enum dataCenter() const
Identifies the data center selected for connectivity configuration.
HandlerSettings & instrumentCache(const std::string &filename)
License configuration settings.
LicenseSettings & operator=(const LicenseSettings &other)
LicenseSettings(SettingChangeController *controller=nullptr)
Initializes listeners with default values.
const std::string & licenseString() const
Returns the license string.
LicenseSettings(const LicenseSettings &other)
LicenseSettings & licenseString(const std::string &value)
LicenseSettings & licenseStore(const std::string &value)
const LicenseStores & licenseStores() const
Returns the folders that contain license file(s).
LicenseSettings & addLicenseStore(const std::string &value)
std::vector< std::string > LicenseStores
Folders that contain license file(s).
void assignNoControl(const SessionSettings &other)
SettingGroup(SettingChangeController *controller=nullptr)
Creates a setting group that uses the specified controller.
void controlChange(const Messaging::Char *description, void(Changeable::*change)(), Changeable &changeable) const
Invokes a zero-argument member function as a guarded change.
void controlAssignment(const Messaging::Char *description, Assignee &assignee, Value value) const
Assigns a value while coordinating the change with the controller.
std::uint32_t UInt32
uInt32.
Definition Integral.h:35
Messaging::UInt32 ChannelId
Identifies a CME MDP 3.0 market data channel.
Definition Domain.h:28
void toStr(std::string &str, BookState::Enum bookState)
Appends a string representation of a book state.
std::string makeInstrumentCacheFilename(ChannelId)
Makes filename for instrument cache for the given channel.
Coordinates changes to settings that belong to a setting group.
Defines the supported levels of trade processing.
Enum
Available trade processing levels.