OnixS C++ CME iLink 3 Binary Order Entry Handler  1.18.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
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
54 bool
56  SbeMessage binary,
57  const Processor& processor)
58 {
59  switch (binary.templateId())
60  {
61  case Negotiate500::TemplateId:
62  {
63  processor(
64  typify
65  <Negotiate500>
66  (binary));
67 
68  return true;
69  }
70 
71  case NegotiationResponse501::TemplateId:
72  {
73  processor(
74  typify
76  (binary));
77 
78  return true;
79  }
80 
81  case NegotiationReject502::TemplateId:
82  {
83  processor(
84  typify
86  (binary));
87 
88  return true;
89  }
90 
91  case Establish503::TemplateId:
92  {
93  processor(
94  typify
95  <Establish503>
96  (binary));
97 
98  return true;
99  }
100 
101  case EstablishmentAck504::TemplateId:
102  {
103  processor(
104  typify
106  (binary));
107 
108  return true;
109  }
110 
111  case EstablishmentReject505::TemplateId:
112  {
113  processor(
114  typify
116  (binary));
117 
118  return true;
119  }
120 
121  case Sequence506::TemplateId:
122  {
123  processor(
124  typify
125  <Sequence506>
126  (binary));
127 
128  return true;
129  }
130 
131  case Terminate507::TemplateId:
132  {
133  processor(
134  typify
135  <Terminate507>
136  (binary));
137 
138  return true;
139  }
140 
141  case RetransmitRequest508::TemplateId:
142  {
143  processor(
144  typify
146  (binary));
147 
148  return true;
149  }
150 
151  case Retransmission509::TemplateId:
152  {
153  processor(
154  typify
156  (binary));
157 
158  return true;
159  }
160 
161  case RetransmitReject510::TemplateId:
162  {
163  processor(
164  typify
166  (binary));
167 
168  return true;
169  }
170 
171  case NotApplied513::TemplateId:
172  {
173  processor(
174  typify
175  <NotApplied513>
176  (binary));
177 
178  return true;
179  }
180 
181  case NewOrderSingle514::TemplateId:
182  {
183  processor(
184  typify
186  (binary));
187 
188  return true;
189  }
190 
191  case OrderCancelReplaceRequest515::TemplateId:
192  {
193  processor(
194  typify
196  (binary));
197 
198  return true;
199  }
200 
201  case OrderCancelRequest516::TemplateId:
202  {
203  processor(
204  typify
206  (binary));
207 
208  return true;
209  }
210 
211  case MassQuote517::TemplateId:
212  {
213  processor(
214  typify
215  <MassQuote517>
216  (binary));
217 
218  return true;
219  }
220 
221  case PartyDetailsDefinitionRequest518::TemplateId:
222  {
223  processor(
224  typify
226  (binary));
227 
228  return true;
229  }
230 
231  case PartyDetailsDefinitionRequestAck519::TemplateId:
232  {
233  processor(
234  typify
236  (binary));
237 
238  return true;
239  }
240 
241  case BusinessReject521::TemplateId:
242  {
243  processor(
244  typify
246  (binary));
247 
248  return true;
249  }
250 
251  case ExecutionReportNew522::TemplateId:
252  {
253  processor(
254  typify
256  (binary));
257 
258  return true;
259  }
260 
261  case ExecutionReportReject523::TemplateId:
262  {
263  processor(
264  typify
266  (binary));
267 
268  return true;
269  }
270 
271  case ExecutionReportElimination524::TemplateId:
272  {
273  processor(
274  typify
276  (binary));
277 
278  return true;
279  }
280 
281  case ExecutionReportTradeOutright525::TemplateId:
282  {
283  processor(
284  typify
286  (binary));
287 
288  return true;
289  }
290 
291  case ExecutionReportTradeSpread526::TemplateId:
292  {
293  processor(
294  typify
296  (binary));
297 
298  return true;
299  }
300 
301  case ExecutionReportTradeSpreadLeg527::TemplateId:
302  {
303  processor(
304  typify
306  (binary));
307 
308  return true;
309  }
310 
311  case QuoteCancel528::TemplateId:
312  {
313  processor(
314  typify
316  (binary));
317 
318  return true;
319  }
320 
321  case OrderMassActionRequest529::TemplateId:
322  {
323  processor(
324  typify
326  (binary));
327 
328  return true;
329  }
330 
331  case OrderMassStatusRequest530::TemplateId:
332  {
333  processor(
334  typify
336  (binary));
337 
338  return true;
339  }
340 
341  case ExecutionReportModify531::TemplateId:
342  {
343  processor(
344  typify
346  (binary));
347 
348  return true;
349  }
350 
351  case ExecutionReportStatus532::TemplateId:
352  {
353  processor(
354  typify
356  (binary));
357 
358  return true;
359  }
360 
361  case OrderStatusRequest533::TemplateId:
362  {
363  processor(
364  typify
366  (binary));
367 
368  return true;
369  }
370 
371  case ExecutionReportCancel534::TemplateId:
372  {
373  processor(
374  typify
376  (binary));
377 
378  return true;
379  }
380 
381  case OrderCancelReject535::TemplateId:
382  {
383  processor(
384  typify
386  (binary));
387 
388  return true;
389  }
390 
391  case OrderCancelReplaceReject536::TemplateId:
392  {
393  processor(
394  typify
396  (binary));
397 
398  return true;
399  }
400 
401  case PartyDetailsListRequest537::TemplateId:
402  {
403  processor(
404  typify
406  (binary));
407 
408  return true;
409  }
410 
411  case PartyDetailsListReport538::TemplateId:
412  {
413  processor(
414  typify
416  (binary));
417 
418  return true;
419  }
420 
421  case ExecutionAck539::TemplateId:
422  {
423  processor(
424  typify
426  (binary));
427 
428  return true;
429  }
430 
431  case RequestForQuote543::TemplateId:
432  {
433  processor(
434  typify
436  (binary));
437 
438  return true;
439  }
440 
441  case NewOrderCross544::TemplateId:
442  {
443  processor(
444  typify
446  (binary));
447 
448  return true;
449  }
450 
451  case MassQuoteAck545::TemplateId:
452  {
453  processor(
454  typify
456  (binary));
457 
458  return true;
459  }
460 
461  case RequestForQuoteAck546::TemplateId:
462  {
463  processor(
464  typify
466  (binary));
467 
468  return true;
469  }
470 
471  case ExecutionReportTradeAddendumOutright548::TemplateId:
472  {
473  processor(
474  typify
476  (binary));
477 
478  return true;
479  }
480 
481  case ExecutionReportTradeAddendumSpread549::TemplateId:
482  {
483  processor(
484  typify
486  (binary));
487 
488  return true;
489  }
490 
491  case ExecutionReportTradeAddendumSpreadLeg550::TemplateId:
492  {
493  processor(
494  typify
496  (binary));
497 
498  return true;
499  }
500 
501  case SecurityDefinitionRequest560::TemplateId:
502  {
503  processor(
504  typify
506  (binary));
507 
508  return true;
509  }
510 
511  case SecurityDefinitionResponse561::TemplateId:
512  {
513  processor(
514  typify
516  (binary));
517 
518  return true;
519  }
520 
521  case OrderMassActionReport562::TemplateId:
522  {
523  processor(
524  typify
526  (binary));
527 
528  return true;
529  }
530 
531  case QuoteCancelAck563::TemplateId:
532  {
533  processor(
534  typify
536  (binary));
537 
538  return true;
539  }
540 
541  case ExecutionReportPendingCancel564::TemplateId:
542  {
543  processor(
544  typify
546  (binary));
547 
548  return true;
549  }
550 
551  case ExecutionReportPendingReplace565::TemplateId:
552  {
553  processor(
554  typify
556  (binary));
557 
558  return true;
559  }
560 
561  default:
562  return false;
563  }
564 }
565 
Message typify(const SbeMessage &message)
Casts SBE-encoded message to a given type.
Definition: Typification.h:36
#define ONIXS_ILINK3_PURE
Definition: Compiler.h:189
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_END
Definition: ABI.h:144
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_BEGIN
Definition: ABI.h:140
MessageTemplateId templateId() const noexcept
Definition: SbeMessage.h:1190
#define ONIXS_ILINK3_NODISCARD
Definition: Compiler.h:185
bool processTypified(SbeMessage binary, const Processor &processor)
Casts a given binary message according to template/type information and processes the cast messages b...
Definition: Typification.h:55