OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.0.3
API documentation
HandlerSettings.cpp
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 
21 
22 #include "Formatting.h"
23 #include "Formatting.Helpers.h"
24 
25 using namespace std;
27 using namespace OnixS::Util;
28 
29 
30 namespace OnixS {
31 namespace Eurex {
32 namespace MarketData {
33 
34 std::ostream& operator << (std::ostream& stream, const ServiceDescriptor& descriptor)
35 {
36  TextBuilder tb;
37  tb << descriptor;
38  return stream << tb.toString();
39 }
40 
41 std::ostream& operator << (std::ostream& stream, const FeedDescriptor& descriptor)
42 {
43  TextBuilder tb;
44  tb << descriptor;
45  return stream << tb.toString();
46 }
47 
48 std::ostream& operator << (std::ostream& stream, const InterfaceDescriptor& descriptor)
49 {
50  TextBuilder tb;
51  tb << descriptor;
52  return stream << tb.toString();
53 }
54 
55 ThreadAffinity::ThreadAffinity()
56 : indices_(new CpuIndexes())
57 {
58 }
59 
61  : indices_(new CpuIndexes())
62 {
63  *indices_ = *other.indices_;
64 }
65 
67 {
68  delete indices_;
69 }
70 
72 {
73  return indices_->empty();
74 }
75 
76 void ThreadAffinity::copyTo(CpuIndexes& indices) const
77 {
78  indices.insert(indices_->begin(), indices_->end());
79 }
80 
82 {
83  return indices_->insert(index).second;
84 }
85 
87 {
88  return indices_->erase(index);
89 }
90 
92 {
93  indices_->clear();
94 }
95 
97 {
98  *indices_ = *other.indices_;
99 
100  return *this;
101 }
102 
103 /// Returns the string representation.
104 std::string ThreadAffinity::toString() const
105 {
106  TextBuilder buidler;
107  buidler << JoinWrapper<CpuIndexes>(*indices_, ",");
108  return buidler.toString();
109 }
110 
111 std::ostream & operator << (std::ostream & stream, const RdiHandlerSettings & settings)
112 {
113  stream
114  << "Settings ["
115 
116  << endl << "incrementalFeed=" << settings.interfaceDescriptor.incrementalFeed
117  << "," << endl << "snapshotFeed=" << settings.interfaceDescriptor.snapshotFeed
118 
119  << "," << endl << "licenseDirectory=" << settings.licenseDirectory
120  << "," << endl << "maxPacketWaitingTime (ms)=" << settings.maxPacketWaitingTime
121  << "," << endl << "fastTemplates=" << settings.fastTemplatesFile
122  << "," << endl << "startRecoveryOnPacketGap=" << (settings.startRecoveryOnPacketGap ? "yes" : "no")
123  << "," << endl << "networkInterface=" << settings.networkInterface
124  << "," << endl << "networkInterfaceA=" << settings.networkInterfaceA
125  << "," << endl << "networkInterfaceB=" << settings.networkInterfaceB
126  << "," << endl << "logSettings=" << settings.logSettings
127  << "," << endl << "logLevel=" << settings.logLevel
128  << "," << endl << "logDirectory=" << settings.logDirectory
129  << "," << endl << "logFileNameTemplate=" << settings.logFileNamePrefix
130  << "," << endl << "useFeedA=" << settings.useFeedA
131  << "," << endl << "useFeedB=" << settings.useFeedB
132  << "," << endl << "maxPacketSize=" << settings.maxPacketSize
133  << "," << endl << "heartbeatInterval (sec)=" << settings.heartbeatInterval
134  << "," << endl << "outOfOrderPacketMaxInterval (sec)=" << settings.outOfOrderPacketMaxInterval
135  << "," << endl << "messagePoolSize (bytes)=" << settings.messagePoolSize
136  << "," << endl << "useFullSnapshotCycle=" << settings.useFullSnapshotCycle
137  << "]";
138 
139  return stream;
140 }
141 
142 std::ostream & operator << (std::ostream & stream, const EmdiHandlerSettings & settings)
143 {
144  stream
145  << "Settings ["
146 
147  << endl << "incrementalFeed=" << settings.interfaceDescriptor.incrementalFeed
148  << "," << endl << "snapshotFeed=" << settings.interfaceDescriptor.snapshotFeed
149 
150  << "," << endl << "licenseDirectory=" << settings.licenseDirectory
151  << "," << endl << "maxPacketWaitingTime (ms)=" << settings.maxPacketWaitingTime
152  << "," << endl << "fastTemplates=" << settings.fastTemplatesFile
153  << "," << endl << "startRecoveryOnPacketGap=" << (settings.startRecoveryOnPacketGap ? "yes" : "no")
154  << "," << endl << "networkInterface=" << settings.networkInterface
155  << "," << endl << "networkInterfaceA=" << settings.networkInterfaceA
156  << "," << endl << "networkInterfaceB=" << settings.networkInterfaceB
157  << "," << endl << "logSettings=" << settings.logSettings
158  << "," << endl << "logLevel=" << settings.logLevel
159  << "," << endl << "logDirectory=" << settings.logDirectory
160  << "," << endl << "logFileNameTemplate=" << settings.logFileNamePrefix
161  << "," << endl << "useFeedA=" << settings.useFeedA
162  << "," << endl << "useFeedB=" << settings.useFeedB
163  << "," << endl << "maxPacketSize=" << settings.maxPacketSize
164  << "," << endl << "heartbeatInterval (sec)=" << settings.heartbeatInterval
165  << "," << endl << "outOfOrderPacketMaxInterval (sec)=" << settings.outOfOrderPacketMaxInterval
166  << "," << endl << "messagePoolSize (bytes)=" << settings.messagePoolSize
167  << "," << endl << "buildInternalOrderBooks=" << settings.buildInternalOrderBooks
168  << "]";
169 
170  return stream;
171 }
172 
173 std::ostream & operator << (std::ostream & stream, const EmdsHandlerSettings & settings)
174 {
175  stream
176  << "Settings ["
177 
178  << endl << "offBookTradeFeed=" << settings.offBookTradeFeedDescriptor
179  << "," << endl << "settlementFeed=" << settings.settlementFeedDescriptor
180  << "," << endl << "openInterestFeed=" << settings.openInterestFeedDescriptor
181  << "," << endl << "exchangeTradeFeed=" << settings.exchangeTradeFeedDescriptor
182 
183  << "," << endl << "licenseDirectory=" << settings.licenseDirectory
184  << "," << endl << "maxPacketWaitingTime (ms)=" << settings.maxPacketWaitingTime
185  << "," << endl << "fastTemplates=" << settings.fastTemplatesFile
186  << "," << endl << "networkInterface=" << settings.networkInterface
187  << "," << endl << "networkInterfaceA=" << settings.networkInterfaceA
188  << "," << endl << "networkInterfaceB=" << settings.networkInterfaceB
189  << "," << endl << "logSettings=" << settings.logSettings
190  << "," << endl << "logLevel=" << settings.logLevel
191  << "," << endl << "logDirectory=" << settings.logDirectory
192  << "," << endl << "logFileNameTemplate=" << settings.logFileNamePrefix
193  << "," << endl << "useFeedA=" << settings.useFeedA
194  << "," << endl << "useFeedB=" << settings.useFeedB
195  << "," << endl << "maxPacketSize=" << settings.maxPacketSize
196  << "," << endl << "heartbeatInterval (sec)=" << settings.heartbeatInterval
197  << "," << endl << "outOfOrderPacketMaxInterval (sec)=" << settings.outOfOrderPacketMaxInterval
198  << "," << endl << "messagePoolSize (bytes)=" << settings.messagePoolSize
199  << "]";
200 
201  return stream;
202 }
203 
204 namespace EOBI {
205 
206 std::ostream& operator << (std::ostream& stream, const EobiHandlerSettings& settings)
207 {
208  stream
209  << "Settings ["
210 
211  << endl << "incrementalFeed=" << settings.interfaceDescriptor.incrementalFeed
212  << "," << endl << "snapshotFeed=" << settings.interfaceDescriptor.snapshotFeed
213 
214  << "," << endl << "licenseDirectory=" << settings.licenseDirectory
215  << "," << endl << "maxPacketWaitingTime (ms)=" << settings.maxPacketWaitingTime
216  << "," << endl << "startRecoveryOnPacketGap=" << (settings.startRecoveryOnPacketGap ? "yes" : "no")
217  << "," << endl << "networkInterface=" << settings.networkInterface
218  << "," << endl << "networkInterfaceA=" << settings.networkInterfaceA
219  << "," << endl << "networkInterfaceB=" << settings.networkInterfaceB
220  << "," << endl << "logSettings=" << settings.logSettings
221  << "," << endl << "logLevel=" << settings.logLevel
222  << "," << endl << "logDirectory=" << settings.logDirectory
223  << "," << endl << "logFileNameTemplate=" << settings.logFileNamePrefix
224  << "," << endl << "useFeedA=" << settings.useFeedA
225  << "," << endl << "useFeedB=" << settings.useFeedB
226  << "," << endl << "maxPacketSize=" << settings.maxPacketSize
227  << "," << endl << "heartbeatInterval (sec)=" << settings.heartbeatInterval
228  << "," << endl << "outOfOrderPacketMaxInterval (sec)=" << settings.outOfOrderPacketMaxInterval
229  << "," << endl << "messagePoolSize (bytes)=" << settings.messagePoolSize
230  << "," << endl << "buildInternalOrderBooks=" << settings.buildInternalOrderBooks
231  << "," << endl << "maxBooksObjectAmount=" << settings.maxBooksObjectAmount
232  << "," << endl << "bookDepth=" << settings.bookDepth
233  << "]";
234 
235  return stream;
236 }
237 
238 }
239 
240 }}}
241 
Represents set of CPU indices.
Definition: FeedEngine.h:38
FeedDescriptor settlementFeedDescriptor
Sets Settlement prices feed technical configuration.
InterfaceDescriptor interfaceDescriptor
Sets data interface technical configuration.
FeedDescriptor openInterestFeedDescriptor
Sets Open Interest prices feed technical configuration.
InterfaceDescriptor interfaceDescriptor
Sets data interface technical configuration.
EMDI handler configuration settings.
STL namespace.
bool empty() const
Indicates whether is empty.
~ThreadAffinity()
Utilizes all the resources.
Util::TextBuilder TextBuilder
Definition: Formatting.h:42
Definition: Group.h:25
unsigned bookDepth
Sets max book depth for order books. Default value is 10.
ThreadAffinity & operator=(const ThreadAffinity &)
Re-initializes instance as copy of other set.
EMDI handler configuration settings.
bool insert(CpuIndex index)
Adds CPU index into set.
std::string logFileNamePrefix
Template of log file name without extension.
LogSettings::Enum logSettings
Combine LogSettings enum values to configure the logger.
FeedDescriptor exchangeTradeFeedDescriptor
Sets On-exchange trade prices feed technical configuration.
RDI handler configuration settings.
EOBI handler configuration settings.
std::string licenseDirectory
Path to the license directory.
std::string logDirectory
Log files are stored in this directory.
bool buildInternalOrderBooks
Build internal books.
Service endpoint description.
ONIXS_EUREX_EMDI_API std::ostream & operator<<(std::ostream &stream, const FeedEngineSettings &settings)
unsigned maxBooksObjectAmount
Defines size of preallocated memory for Order Book. Default value is 100.
std::string toString() const
Returns the string representation.
FeedDescriptor offBookTradeFeedDescriptor
Sets off-book trade prices feed technical configuration.
void copyTo(CpuIndexes &) const
Copies set into another set.
int CpuIndex
Zero-based index of CPU.
Definition: FeedEngine.h:35
InterfaceDescriptor interfaceDescriptor
Sets data interface technical configuration.
bool erase(CpuIndex index)
Removes CPU index from the set.