OnixS C++ CME MDP Streamlined Market Data Handler  1.2.0
API Documentation
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 
28 
30 
32 
34 
35 /// Handler's configuration settings.
37 {
38  ChannelId channel_;
39 
40  FeedSettings feeds_;
41 
42  UInt32 recoveryQueueMaxSize_;
43 
44  UInt32 maxTcpRecoveryDepth_;
45 
46  HandlerDebugLoggingSettings debugLogging_;
47 
48  MemoryPoolSettings memoryPool_;
49 
50 public:
51  /// Initializes parameters with default values.
53  : channel_(0)
54  , recoveryQueueMaxSize_(1000000)
55  , maxTcpRecoveryDepth_(1000)
56  {
57  }
58 
59  /// Cleans everything up.
61  {
62  }
63 
64  /// Identifies CME market data channel.
66  {
67  return channel_;
68  }
69 
70  /// Identifies CME market data channel.
71  void channel(ChannelId value)
72  {
73  channel_ = value;
74  }
75 
76  /// Reference to parameters related with feeds.
77  const
78  FeedSettings&
79  feeds() const
80  {
81  return feeds_;
82  }
83 
84  /// Reference to parameters related with feeds.
85  FeedSettings&
87  {
88  return feeds_;
89  }
90 
91  /// Maximum number of packets transmitted via
92  /// incremental feed to be hold in internal queue
93  /// while market state is recovered from snapshots.
94  ///
95  /// When Handler recovers order books from snapshots,
96  /// the given parameter limits the size of the internal
97  /// queue used by the Handler to keep packets coming from
98  /// incremental feeds. Upon reaching limit, newer packets
99  /// substitute older ones.
100  ///
101  /// @note The default value is 1000000.
102  UInt32
104  {
105  return recoveryQueueMaxSize_;
106  }
107 
108  /// Maximum number of packets to be hold in the internal
109  /// queue used by the Handler while processing incoming data.
110  void
112  UInt32 queueMaxSize)
113  {
114  recoveryQueueMaxSize_ = queueMaxSize;
115  }
116 
117  /// Parameters affecting logging at debug level.
120  {
121  return debugLogging_;
122  }
123 
124  /// Parameters affecting logging at debug level.
125  const
127  debugLogging() const
128  {
129  return debugLogging_;
130  }
131 
132  /// Parameters affecting behavior of memory pool
133  /// used by Handler while processing market data.
136  {
137  return memoryPool_;
138  }
139 
140  /// Parameters affecting behavior of memory pool
141  /// used by Handler while processing market data.
142  const
144  memoryPool() const
145  {
146  return memoryPool_;
147  }
148 
149  /// Cme recovery server keeps only the current day's messages
150  /// This param allows to request only the latest packets
151  /// Default value is 1000
152  void
154  UInt32 maxTcpRecoveryDepth)
155  {
156  maxTcpRecoveryDepth_ =
157  maxTcpRecoveryDepth;
158  }
159 
160  UInt32
162  {
163  return maxTcpRecoveryDepth_;
164  }
165 
166 };
167 
168 /// Serializes BBA tracking parameters into string.
170 void
171 toStr(
172  std::string&,
173  const HandlerSettings&);
174 
175 /// Serializes BBA tracking parameters into string.
176 inline
177 std::string
179  const HandlerSettings& settings)
180 {
181  std::string str;
182 
183  toStr(str, settings);
184 
185  return str;
186 }
187 
188 /// Makes filename for instrument cache for the given channel.
190 std::string
192 
ChannelId channel() const
Identifies CME market data channel.
Parameters affecting what&#39;s logged at a debug level.
const FeedSettings & feeds() const
Reference to parameters related with feeds.
const HandlerDebugLoggingSettings & debugLogging() const
Parameters affecting logging at debug level.
Handler&#39;s configuration settings.
std::string makeInstrumentCacheFilename(ChannelId)
Makes filename for instrument cache for the given channel.
void channel(ChannelId value)
Identifies CME market data channel.
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
Definition: Bootstrap.h:173
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
Definition: Bootstrap.h:111
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED
Definition: Compiler.h:160
const MemoryPoolSettings & memoryPool() const
Parameters affecting behavior of memory pool used by Handler while processing market data...
void maxTcpRecoveryDepth(UInt32 maxTcpRecoveryDepth)
Cme recovery server keeps only the current day&#39;s messages This param allows to request only the lates...
HandlerDebugLoggingSettings & debugLogging()
Parameters affecting logging at debug level.
std::string toStr(const HandlerSettings &settings)
Serializes BBA tracking parameters into string.
void recoveryQueueMaxSize(UInt32 queueMaxSize)
Maximum number of packets to be hold in the internal queue used by the Handler while processing incom...
FeedSettings & feeds()
Reference to parameters related with feeds.
UInt32 recoveryQueueMaxSize() const
Maximum number of packets transmitted via incremental feed to be hold in internal queue while market ...
HandlerSettings()
Initializes parameters with default values.
MemoryPoolSettings & memoryPool()
Parameters affecting behavior of memory pool used by Handler while processing market data...
UInt32 ChannelId
Identifies CME channel.
Definition: Domain.h:28
UInt32 UInt32
uInt32.
Definition: Fields.h:183
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
Definition: Bootstrap.h:169