OnixS C++ B3 Binary UMDF Market Data Handler  1.4.2
API documentation
Typification.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 
24 
26 
27 /// Casts SBE-encoded message to a given type.
28 template
29  <
30  class Message
31  >
32 inline
33 ONIXS_B3_UMDF_MD_NODISCARD
34 ONIXS_B3_UMDF_MD_PURE
35 Message
37  const SbeMessage& message)
38 {
39  return Message(message);
40 }
41 
42 /// Casts a given binary message according to template/type
43 /// information and processes the cast messages by a given processor.
44 ///
45 /// Returned value indicates whether message type was successfully
46 /// recognized and pushed to the processor for further processing. Unknown
47 /// messages aren't processed and thus false result is returned.
48 template
49 <
50  class Processor
51 >
52 inline
53 ONIXS_B3_UMDF_MD_NODISCARD
54 bool
56  SbeMessage binary,
57  Processor& processor)
58 {
59  switch (binary.templateId())
60  {
61  case SequenceReset_1::TemplateId:
62  {
63  processor(
64  typify
66  (binary));
67 
68  return true;
69  }
70 
71  case Sequence_2::TemplateId:
72  {
73  processor(
74  typify
75  <Sequence_2>
76  (binary));
77 
78  return true;
79  }
80 
81  case EmptyBook_9::TemplateId:
82  {
83  processor(
84  typify
85  <EmptyBook_9>
86  (binary));
87 
88  return true;
89  }
90 
91  case ChannelReset_11::TemplateId:
92  {
93  processor(
94  typify
96  (binary));
97 
98  return true;
99  }
100 
101  case SecurityStatus_3::TemplateId:
102  {
103  processor(
104  typify
106  (binary));
107 
108  return true;
109  }
110 
111  case SecurityGroupPhase_10::TemplateId:
112  {
113  processor(
114  typify
116  (binary));
117 
118  return true;
119  }
120 
121  case SecurityDefinition_12::TemplateId:
122  {
123  processor(
124  typify
126  (binary));
127 
128  return true;
129  }
130 
131  case News_5::TemplateId:
132  {
133  processor(
134  typify
135  <News_5>
136  (binary));
137 
138  return true;
139  }
140 
141  case OpeningPrice_15::TemplateId:
142  {
143  processor(
144  typify
146  (binary));
147 
148  return true;
149  }
150 
151  case TheoreticalOpeningPrice_16::TemplateId:
152  {
153  processor(
154  typify
156  (binary));
157 
158  return true;
159  }
160 
161  case ClosingPrice_17::TemplateId:
162  {
163  processor(
164  typify
166  (binary));
167 
168  return true;
169  }
170 
171  case AuctionImbalance_19::TemplateId:
172  {
173  processor(
174  typify
176  (binary));
177 
178  return true;
179  }
180 
181  case QuantityBand_21::TemplateId:
182  {
183  processor(
184  typify
186  (binary));
187 
188  return true;
189  }
190 
191  case PriceBand_22::TemplateId:
192  {
193  processor(
194  typify
195  <PriceBand_22>
196  (binary));
197 
198  return true;
199  }
200 
201  case HighPrice_24::TemplateId:
202  {
203  processor(
204  typify
205  <HighPrice_24>
206  (binary));
207 
208  return true;
209  }
210 
211  case LowPrice_25::TemplateId:
212  {
213  processor(
214  typify
215  <LowPrice_25>
216  (binary));
217 
218  return true;
219  }
220 
221  case LastTradePrice_27::TemplateId:
222  {
223  processor(
224  typify
226  (binary));
227 
228  return true;
229  }
230 
231  case SettlementPrice_28::TemplateId:
232  {
233  processor(
234  typify
236  (binary));
237 
238  return true;
239  }
240 
241  case OpenInterest_29::TemplateId:
242  {
243  processor(
244  typify
246  (binary));
247 
248  return true;
249  }
250 
251  case SnapshotFullRefresh_Header_30::TemplateId:
252  {
253  processor(
254  typify
256  (binary));
257 
258  return true;
259  }
260 
261  case Order_MBO_50::TemplateId:
262  {
263  processor(
264  typify
265  <Order_MBO_50>
266  (binary));
267 
268  return true;
269  }
270 
271  case DeleteOrder_MBO_51::TemplateId:
272  {
273  processor(
274  typify
276  (binary));
277 
278  return true;
279  }
280 
281  case MassDeleteOrders_MBO_52::TemplateId:
282  {
283  processor(
284  typify
286  (binary));
287 
288  return true;
289  }
290 
291  case Trade_53::TemplateId:
292  {
293  processor(
294  typify
295  <Trade_53>
296  (binary));
297 
298  return true;
299  }
300 
301  case ForwardTrade_54::TemplateId:
302  {
303  processor(
304  typify
306  (binary));
307 
308  return true;
309  }
310 
311  case ExecutionSummary_55::TemplateId:
312  {
313  processor(
314  typify
316  (binary));
317 
318  return true;
319  }
320 
321  case ExecutionStatistics_56::TemplateId:
322  {
323  processor(
324  typify
326  (binary));
327 
328  return true;
329  }
330 
331  case TradeBust_57::TemplateId:
332  {
333  processor(
334  typify
335  <TradeBust_57>
336  (binary));
337 
338  return true;
339  }
340 
341  case SnapshotFullRefresh_Orders_MBO_71::TemplateId:
342  {
343  processor(
344  typify
346  (binary));
347 
348  return true;
349  }
350 
351  default:
352  return false;
353  }
354 }
355 
The theoretical opening price is also sent on this block and is calculated and updated based on the o...
Definition: Messages.h:3150
Used to reset the incremental stream or indicate the loop on instrument definition or snapshot recove...
Definition: Messages.h:34
Conveys market information of B3 market surveillance notifications and news produced by agencies...
Definition: Messages.h:2524
Carries auction imbalance information, indicating the remaining quantity and to which side (buyer or ...
Definition: Messages.h:3712
Carries the summary information about opening trading session events per market data stream...
Definition: Messages.h:2868
Summary information about closing trading sessions per market data stream..
Definition: Messages.h:3425
Total number of contracts in a commodity or options market that are still open..
Definition: Messages.h:5697
ONIXS_B3_UMDF_MD_NODISCARD ONIXS_B3_UMDF_MD_PURE Message typify(const SbeMessage &message)
Casts SBE-encoded message to a given type.
Definition: Typification.h:36
Disseminates the creation or modification of a new order..
Definition: Messages.h:6214
The lowest price traded for the security in the trading session..
Definition: Messages.h:4796
Header for the snapshot of a single instrument.
Definition: Messages.h:5959
The highest price traded for the security in the trading session..
Definition: Messages.h:4541
Market Data Incremental Refresh - Empty Book.
Definition: Messages.h:360
The latest price traded for the security in the trading session..
Definition: Messages.h:5051
Channel Reset (remove all instruments, empty all books and statistics).
Definition: Messages.h:585
#define ONIXS_B3_UMDF_MD_MESSAGING_NAMESPACE_END
Definition: ABI.h:151
Settlement price or the previous day’s adjusted closing price..
Definition: Messages.h:5404
Relays execution summary information on one instrument..
Definition: Messages.h:7719
Relays execution summary statistics information on one instrument..
Definition: Messages.h:8007
ONIXS_B3_UMDF_MD_NODISCARD bool processTypified(SbeMessage binary, Processor &processor)
Casts a given binary message according to template/type information and processes the cast messages b...
Definition: Typification.h:55
Disseminates the deletion of a new order..
Definition: Messages.h:6519
#define ONIXS_B3_UMDF_MD_MESSAGING_NAMESPACE_BEGIN
Definition: ABI.h:146
Partial list of orders for the snapshot of a single instrument..
Definition: Messages.h:8591
Relays trade information on one Forward instrument.
Definition: Messages.h:7367
Relays trade information on one instrument..
Definition: Messages.h:7038
Sent in incremental, snapshot and instrument list feeds in periods of no activity..
Definition: Messages.h:196
Relays trade bust (trade reversal) information on one instrument..
Definition: Messages.h:8303