OnixS C++ CME MDP Streamlined Market Data Handler  1.2.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 given type.
28 template
29 <
30  class Message
31 >
32 inline
33 Message
35  const
36  BinaryMessage& message)
37 {
38  return
39  Message(
40  message.binary(),
41  message.binarySize());
42 }
43 
44 /// Casts given binary message according to template/type
45 /// information and processes casted messages by given processor.
46 ///
47 /// Returned value indicates whether message type was successfully
48 /// recognized and pushed to processor for further processing. Unknown
49 /// messages aren't processed and thus false result is returned.
50 template
51 <
52  class Processor
53 >
54 bool
56  const BinaryMessage& binary,
57  Processor& processor)
58 {
59  switch (binary.templateId())
60  {
61  case AdminHeartbeat312::TemplateId:
62  {
63  processor(
64  typify
66  (binary));
67 
68  return true;
69  }
70 
71  case AdminLogin315::TemplateId:
72  {
73  processor(
74  typify
76  (binary));
77 
78  return true;
79  }
80 
81  case AdminLogout316::TemplateId:
82  {
83  processor(
84  typify
86  (binary));
87 
88  return true;
89  }
90 
91  case IncrementalRefreshErisReferenceDataAndDailyStatistics333::TemplateId:
92  {
93  processor(
94  typify
96  (binary));
97 
98  return true;
99  }
100 
101  case NewsIndices339::TemplateId:
102  {
103  processor(
104  typify
106  (binary));
107 
108  return true;
109  }
110 
111  case IncrementalRefreshTradeBlocks340::TemplateId:
112  {
113  processor(
114  typify
116  (binary));
117 
118  return true;
119  }
120 
121  case QuoteRequest345::TemplateId:
122  {
123  processor(
124  typify
126  (binary));
127 
128  return true;
129  }
130 
131  case InstrumentDefinitionIndices347::TemplateId:
132  {
133  processor(
134  typify
136  (binary));
137 
138  return true;
139  }
140 
141  case IncrementalRefreshIndices348::TemplateId:
142  {
143  processor(
144  typify
146  (binary));
147 
148  return true;
149  }
150 
151  case IncrementalRefreshTradeBlocks349::TemplateId:
152  {
153  processor(
154  typify
156  (binary));
157 
158  return true;
159  }
160 
161  case IncrementalRefreshEris351::TemplateId:
162  {
163  processor(
164  typify
166  (binary));
167 
168  return true;
169  }
170 
171  case IncrementalRefreshEris353::TemplateId:
172  {
173  processor(
174  typify
176  (binary));
177 
178  return true;
179  }
180 
181  case IncrementalRefreshOTC356::TemplateId:
182  {
183  processor(
184  typify
186  (binary));
187 
188  return true;
189  }
190 
191  case InstrumentDefinitionEris363::TemplateId:
192  {
193  processor(
194  typify
196  (binary));
197 
198  return true;
199  }
200 
201  case IncrementalRefreshTradeBlocks365::TemplateId:
202  {
203  processor(
204  typify
206  (binary));
207 
208  return true;
209  }
210 
211  case IncrementalRefreshOTC366::TemplateId:
212  {
213  processor(
214  typify
216  (binary));
217 
218  return true;
219  }
220 
221  default:
222  return false;
223  }
224 }
225 
Encapsulates services for manipulating SBE-encoded messages.
MDIncrementalRefreshErisReferenceDataAndDailyStatistics.
Definition: Messages.h:191
MessageTemplateId templateId() const
Template identifier of message being referenced.
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
Definition: Bootstrap.h:173
bool processTypified(const BinaryMessage &binary, Processor &processor)
Casts given binary message according to template/type information and processes casted messages by gi...
Definition: Typification.h:55
const void * binary() const
SBE-encoded message content.
MessageSize binarySize() const
Size of SBE-encoded message.
Message typify(const BinaryMessage &message)
Casts SBE-encoded message to given type.
Definition: Typification.h:34
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
Definition: Bootstrap.h:169