OnixS C++ CME MDP Conflated TCP Handler  1.3.6
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 
25 
27 
28 /// Casts given binary message according to template/type
29 /// information and processes casted messages by given processor.
30 ///
31 /// Returned value indicates whether message type was successfully
32 /// recognized and pushed to processor for further processing. Unknown
33 /// messages aren't processed and thus false result is returned.
34 template
35 <
36  class Processor
37 >
38 bool
40  const SbeMessage& binary,
41  Processor& processor)
42 {
43  switch (binary.templateId())
44  {
45  case InstrumentDefinitionFixedIncome57::TemplateId:
46  {
47  processor(
48  typify
50  (binary));
51 
52  return true;
53  }
54 
55  case InstrumentDefinitionRepo58::TemplateId:
56  {
57  processor(
58  typify
60  (binary));
61 
62  return true;
63  }
64 
65  case SnapshotRefreshTopOrders59::TemplateId:
66  {
67  processor(
68  typify
70  (binary));
71 
72  return true;
73  }
74 
75  case SecurityStatusWorkup60::TemplateId:
76  {
77  processor(
78  typify
80  (binary));
81 
82  return true;
83  }
84 
85  case SnapshotFullRefreshTCP61::TemplateId:
86  {
87  processor(
88  typify
90  (binary));
91 
92  return true;
93  }
94 
95  case CollateralMarketValue62::TemplateId:
96  {
97  processor(
98  typify
100  (binary));
101 
102  return true;
103  }
104 
105  case InstrumentDefinitionFX63::TemplateId:
106  {
107  processor(
108  typify
110  (binary));
111 
112  return true;
113  }
114 
115  case IncrementalRefreshBookLongQty64::TemplateId:
116  {
117  processor(
118  typify
120  (binary));
121 
122  return true;
123  }
124 
125  case IncrementalRefreshTradeSummaryLongQty65::TemplateId:
126  {
127  processor(
128  typify
130  (binary));
131 
132  return true;
133  }
134 
135  case IncrementalRefreshVolumeLongQty66::TemplateId:
136  {
137  processor(
138  typify
140  (binary));
141 
142  return true;
143  }
144 
145  case IncrementalRefreshSessionStatisticsLongQty67::TemplateId:
146  {
147  processor(
148  typify
150  (binary));
151 
152  return true;
153  }
154 
155  case SnapshotFullRefreshTCPLongQty68::TemplateId:
156  {
157  processor(
158  typify
160  (binary));
161 
162  return true;
163  }
164 
165  case SnapshotFullRefreshLongQty69::TemplateId:
166  {
167  processor(
168  typify
170  (binary));
171 
172  return true;
173  }
174 
175  case AdminHeartbeat302::TemplateId:
176  {
177  processor(
178  typify
180  (binary));
181 
182  return true;
183  }
184 
185  case IncrementalRefreshSpectrum303::TemplateId:
186  {
187  processor(
188  typify
190  (binary));
191 
192  return true;
193  }
194 
195  case IncrementalRefreshTicker304::TemplateId:
196  {
197  processor(
198  typify
200  (binary));
201 
202  return true;
203  }
204 
205  case SnapshotRefreshSpectrum305::TemplateId:
206  {
207  processor(
208  typify
210  (binary));
211 
212  return true;
213  }
214 
215  case SnapshotRefreshTicker306::TemplateId:
216  {
217  processor(
218  typify
220  (binary));
221 
222  return true;
223  }
224 
225  case GlobalDayRoll307::TemplateId:
226  {
227  processor(
228  typify
230  (binary));
231 
232  return true;
233  }
234 
235  case ChannelReset4::TemplateId:
236  {
237  processor(
238  typify
239  <ChannelReset4>
240  (binary));
241 
242  return true;
243  }
244 
245  case AdminHeartbeat12::TemplateId:
246  {
247  processor(
248  typify
250  (binary));
251 
252  return true;
253  }
254 
255  case AdminLogin15::TemplateId:
256  {
257  processor(
258  typify
259  <AdminLogin15>
260  (binary));
261 
262  return true;
263  }
264 
265  case AdminLogout16::TemplateId:
266  {
267  processor(
268  typify
269  <AdminLogout16>
270  (binary));
271 
272  return true;
273  }
274 
275  case InstrumentDefinitionFuture54::TemplateId:
276  {
277  processor(
278  typify
280  (binary));
281 
282  return true;
283  }
284 
285  case InstrumentDefinitionSpread56::TemplateId:
286  {
287  processor(
288  typify
290  (binary));
291 
292  return true;
293  }
294 
295  case SecurityStatus30::TemplateId:
296  {
297  processor(
298  typify
300  (binary));
301 
302  return true;
303  }
304 
305  case IncrementalRefreshBook46::TemplateId:
306  {
307  processor(
308  typify
310  (binary));
311 
312  return true;
313  }
314 
315  case IncrementalRefreshDailyStatistics49::TemplateId:
316  {
317  processor(
318  typify
320  (binary));
321 
322  return true;
323  }
324 
325  case IncrementalRefreshLimitsBanding50::TemplateId:
326  {
327  processor(
328  typify
330  (binary));
331 
332  return true;
333  }
334 
335  case IncrementalRefreshSessionStatistics51::TemplateId:
336  {
337  processor(
338  typify
340  (binary));
341 
342  return true;
343  }
344 
345  case IncrementalRefreshVolume37::TemplateId:
346  {
347  processor(
348  typify
350  (binary));
351 
352  return true;
353  }
354 
355  case SnapshotFullRefresh52::TemplateId:
356  {
357  processor(
358  typify
360  (binary));
361 
362  return true;
363  }
364 
365  case QuoteRequest39::TemplateId:
366  {
367  processor(
368  typify
370  (binary));
371 
372  return true;
373  }
374 
375  case InstrumentDefinitionOption55::TemplateId:
376  {
377  processor(
378  typify
380  (binary));
381 
382  return true;
383  }
384 
385  case IncrementalRefreshTradeSummary48::TemplateId:
386  {
387  processor(
388  typify
390  (binary));
391 
392  return true;
393  }
394 
395  case IncrementalRefreshOrderBook47::TemplateId:
396  {
397  processor(
398  typify
400  (binary));
401 
402  return true;
403  }
404 
405  case SnapshotFullRefreshOrderBook53::TemplateId:
406  {
407  processor(
408  typify
410  (binary));
411 
412  return true;
413  }
414 
415  default:
416  return false;
417  }
418 }
419 
Message typify(const SbeMessage &message)
Casts SBE-encoded message to a given type.
Definition: Typification.h:36
#define ONIXS_CONFLATEDTCP_MESSAGING_MDP_NAMESPACE_BEGIN
Definition: ABI.h:147
#define ONIXS_CONFLATEDTCP_MESSAGING_MDP_NAMESPACE_END
Definition: ABI.h:151
bool processTypified(const SbeMessage &binary, Processor &processor)
Casts given binary message according to template/type information and processes casted messages by gi...
Definition: Typification.h:39
MessageTemplateId templateId() const noexcept
Definition: SbeMessage.h:1173