OnixS C++ CME iLink 3 Binary Order Entry Handler  1.9.0
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
34 Message
36  SbeMessage message)
37 {
38  return
39  Message(
40  message.binary(),
41  message.bufferSize(),
43 }
44 
45 /// Casts a given binary message according to template/type
46 /// information and processes the cast messages by a given processor.
47 ///
48 /// Returned value indicates whether message type was successfully
49 /// recognized and pushed to the processor for further processing. Unknown
50 /// messages aren't processed and thus false result is returned.
51 template
52 <
53  class Processor
54 >
55 inline
57 bool
59  SbeMessage binary,
60  const Processor& processor)
61 {
62  switch (binary.templateId())
63  {
64  case Negotiate500::TemplateId:
65  {
66  processor(
67  typify
68  <Negotiate500>
69  (binary));
70 
71  return true;
72  }
73 
74  case NegotiationResponse501::TemplateId:
75  {
76  processor(
77  typify
79  (binary));
80 
81  return true;
82  }
83 
84  case NegotiationReject502::TemplateId:
85  {
86  processor(
87  typify
89  (binary));
90 
91  return true;
92  }
93 
94  case Establish503::TemplateId:
95  {
96  processor(
97  typify
98  <Establish503>
99  (binary));
100 
101  return true;
102  }
103 
104  case EstablishmentAck504::TemplateId:
105  {
106  processor(
107  typify
109  (binary));
110 
111  return true;
112  }
113 
114  case EstablishmentReject505::TemplateId:
115  {
116  processor(
117  typify
119  (binary));
120 
121  return true;
122  }
123 
124  case Sequence506::TemplateId:
125  {
126  processor(
127  typify
128  <Sequence506>
129  (binary));
130 
131  return true;
132  }
133 
134  case Terminate507::TemplateId:
135  {
136  processor(
137  typify
138  <Terminate507>
139  (binary));
140 
141  return true;
142  }
143 
144  case RetransmitRequest508::TemplateId:
145  {
146  processor(
147  typify
149  (binary));
150 
151  return true;
152  }
153 
154  case Retransmission509::TemplateId:
155  {
156  processor(
157  typify
159  (binary));
160 
161  return true;
162  }
163 
164  case RetransmitReject510::TemplateId:
165  {
166  processor(
167  typify
169  (binary));
170 
171  return true;
172  }
173 
174  case NotApplied513::TemplateId:
175  {
176  processor(
177  typify
178  <NotApplied513>
179  (binary));
180 
181  return true;
182  }
183 
184  case NewOrderSingle514::TemplateId:
185  {
186  processor(
187  typify
189  (binary));
190 
191  return true;
192  }
193 
194  case OrderCancelReplaceRequest515::TemplateId:
195  {
196  processor(
197  typify
199  (binary));
200 
201  return true;
202  }
203 
204  case OrderCancelRequest516::TemplateId:
205  {
206  processor(
207  typify
209  (binary));
210 
211  return true;
212  }
213 
214  case MassQuote517::TemplateId:
215  {
216  processor(
217  typify
218  <MassQuote517>
219  (binary));
220 
221  return true;
222  }
223 
224  case PartyDetailsDefinitionRequest518::TemplateId:
225  {
226  processor(
227  typify
229  (binary));
230 
231  return true;
232  }
233 
234  case PartyDetailsDefinitionRequestAck519::TemplateId:
235  {
236  processor(
237  typify
239  (binary));
240 
241  return true;
242  }
243 
244  case BusinessReject521::TemplateId:
245  {
246  processor(
247  typify
249  (binary));
250 
251  return true;
252  }
253 
254  case ExecutionReportNew522::TemplateId:
255  {
256  processor(
257  typify
259  (binary));
260 
261  return true;
262  }
263 
264  case ExecutionReportReject523::TemplateId:
265  {
266  processor(
267  typify
269  (binary));
270 
271  return true;
272  }
273 
274  case ExecutionReportElimination524::TemplateId:
275  {
276  processor(
277  typify
279  (binary));
280 
281  return true;
282  }
283 
284  case ExecutionReportTradeOutright525::TemplateId:
285  {
286  processor(
287  typify
289  (binary));
290 
291  return true;
292  }
293 
294  case ExecutionReportTradeSpread526::TemplateId:
295  {
296  processor(
297  typify
299  (binary));
300 
301  return true;
302  }
303 
304  case ExecutionReportTradeSpreadLeg527::TemplateId:
305  {
306  processor(
307  typify
309  (binary));
310 
311  return true;
312  }
313 
314  case QuoteCancel528::TemplateId:
315  {
316  processor(
317  typify
319  (binary));
320 
321  return true;
322  }
323 
324  case OrderMassActionRequest529::TemplateId:
325  {
326  processor(
327  typify
329  (binary));
330 
331  return true;
332  }
333 
334  case OrderMassStatusRequest530::TemplateId:
335  {
336  processor(
337  typify
339  (binary));
340 
341  return true;
342  }
343 
344  case ExecutionReportModify531::TemplateId:
345  {
346  processor(
347  typify
349  (binary));
350 
351  return true;
352  }
353 
354  case ExecutionReportStatus532::TemplateId:
355  {
356  processor(
357  typify
359  (binary));
360 
361  return true;
362  }
363 
364  case OrderStatusRequest533::TemplateId:
365  {
366  processor(
367  typify
369  (binary));
370 
371  return true;
372  }
373 
374  case ExecutionReportCancel534::TemplateId:
375  {
376  processor(
377  typify
379  (binary));
380 
381  return true;
382  }
383 
384  case OrderCancelReject535::TemplateId:
385  {
386  processor(
387  typify
389  (binary));
390 
391  return true;
392  }
393 
394  case OrderCancelReplaceReject536::TemplateId:
395  {
396  processor(
397  typify
399  (binary));
400 
401  return true;
402  }
403 
404  case PartyDetailsListRequest537::TemplateId:
405  {
406  processor(
407  typify
409  (binary));
410 
411  return true;
412  }
413 
414  case PartyDetailsListReport538::TemplateId:
415  {
416  processor(
417  typify
419  (binary));
420 
421  return true;
422  }
423 
424  case ExecutionAck539::TemplateId:
425  {
426  processor(
427  typify
429  (binary));
430 
431  return true;
432  }
433 
434  case RequestForQuote543::TemplateId:
435  {
436  processor(
437  typify
439  (binary));
440 
441  return true;
442  }
443 
444  case NewOrderCross544::TemplateId:
445  {
446  processor(
447  typify
449  (binary));
450 
451  return true;
452  }
453 
454  case MassQuoteAck545::TemplateId:
455  {
456  processor(
457  typify
459  (binary));
460 
461  return true;
462  }
463 
464  case RequestForQuoteAck546::TemplateId:
465  {
466  processor(
467  typify
469  (binary));
470 
471  return true;
472  }
473 
474  case ExecutionReportTradeAddendumOutright548::TemplateId:
475  {
476  processor(
477  typify
479  (binary));
480 
481  return true;
482  }
483 
484  case ExecutionReportTradeAddendumSpread549::TemplateId:
485  {
486  processor(
487  typify
489  (binary));
490 
491  return true;
492  }
493 
494  case ExecutionReportTradeAddendumSpreadLeg550::TemplateId:
495  {
496  processor(
497  typify
499  (binary));
500 
501  return true;
502  }
503 
504  case SecurityDefinitionRequest560::TemplateId:
505  {
506  processor(
507  typify
509  (binary));
510 
511  return true;
512  }
513 
514  case SecurityDefinitionResponse561::TemplateId:
515  {
516  processor(
517  typify
519  (binary));
520 
521  return true;
522  }
523 
524  case OrderMassActionReport562::TemplateId:
525  {
526  processor(
527  typify
529  (binary));
530 
531  return true;
532  }
533 
534  case QuoteCancelAck563::TemplateId:
535  {
536  processor(
537  typify
539  (binary));
540 
541  return true;
542  }
543 
544  default:
545  return false;
546  }
547 }
548 
MessageTemplateId templateId() const noexcept
Definition: SbeMessage.h:1163
const void * binary() const noexcept
Definition: SbeMessage.h:1197
MessageSize bufferSize() const noexcept
Definition: SbeMessage.h:1221
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_END
Definition: ABI.h:144
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_BEGIN
Definition: ABI.h:140
Message typify(SbeMessage message)
Casts SBE-encoded message to a given type.
Definition: Typification.h:35
#define ONIXS_ILINK3_NODISCARD
Definition: Compiler.h:173
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:58