OnixS C++ CME Streamlined Market Data Handler  1.0.0.4
API documentation
Composites.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 
26 
28 ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_BEGIN(1)
29 
30 /// Fixed point decimal with int32 mantissa and constant -4 exponent.
31 typedef
32 FixedPointDecimal
33 <
34  Int32,
35  IntegralConstant<Int8, -4>
36 >
38 
39 
40 /// Null values definition for optional Decimal32 field.
42 {
43  /// Null value for optional Mantissa field.
44  typedef
47 
48  /// Compares encoded data to NULL.
49  bool
51  const Decimal32& other) const
52  {
53  return (
54  NullMantissa() ==
55  other.mantissa()
56  );
57  }
58 
59  /// Compares encoded data to NULL.
60  bool
62  const Decimal32& other) const
63  {
64  return !(*this == other);
65  }
66 };
67 
68 /// Floating-point decimal.
70 
71 
72 /// Null values definition for optional Decimal64 field.
74 {
75  /// Null value for optional Mantissa field.
76  typedef
79 
80  /// Compares encoded data to NULL.
81  bool
83  const Decimal64& other) const
84  {
85  return (
86  NullMantissa() ==
87  other.mantissa()
88  );
89  }
90 
91  /// Compares encoded data to NULL.
92  bool
94  const Decimal64& other) const
95  {
96  return !(*this == other);
97  }
98 };
99 
100 /// Year, Month and Date.
101 ///
102 /// FIX type: MonthYear.
104 {
105 public:
106  /// Size of composite.
107  enum { Size = 5 };
108 
109  /// YYYY.
110  typedef UInt16 Year;
111 
112  /// Null value for optional Year field.
113  typedef
116 
117  /// MM.
118  typedef UInt8 Month;
119 
120  /// Null value for optional Month field.
121  typedef
124 
125  /// DD.
126  typedef UInt8 Day;
127 
128  /// Null value for optional Day field.
129  typedef
132 
133  /// WW.
134  typedef UInt8 Week;
135 
136  /// Null value for optional Week field.
137  typedef
140 
141  /// YYYY.
142  Year year() const
143  {
144  return year_;
145  }
146 
147  /// MM.
148  bool
150  Month& value) const
151  {
152  if (NullMonth() == month_) return false;
153  value = month_;
154  return true;
155  }
156 
157  /// DD.
158  bool
160  Day& value) const
161  {
162  if (NullDay() == day_) return false;
163  value = day_;
164  return true;
165  }
166 
167  /// WW.
168  bool
170  Week& value) const
171  {
172  if (NullWeek() == week_) return false;
173  value = week_;
174  return true;
175  }
176 
177 private:
178  Year year_;
179  Month month_;
180  Day day_;
181  Week week_;
182 };
183 
184 
185 /// Null values definition for optional MaturityMonthYear field.
187 {
188  /// Compares encoded data to NULL.
189  bool
191  const MaturityMonthYear& other) const
192  {
193  return (
195  other.year()
196  );
197  }
198 
199  /// Compares encoded data to NULL.
200  bool
202  const MaturityMonthYear& other) const
203  {
204  return !(*this == other);
205  }
206 };
207 
208 /// Price NULL.
209 typedef
211 <
212  Int64,
214 >
216 
217 
218 /// Null values definition for optional PRICENULL field.
220 {
221  /// Null value for optional Mantissa field.
222  typedef
225 
226  /// Compares encoded data to NULL.
227  bool
229  const PRICENULL& other) const
230  {
231  return (
232  NullMantissa() ==
233  other.mantissa()
234  );
235  }
236 
237  /// Compares encoded data to NULL.
238  bool
240  const PRICENULL& other) const
241  {
242  return !(*this == other);
243  }
244 };
245 
246 /// Repeating group dimensions.
247 ///
248 /// FIX type: NumInGroup.
250 {
251 public:
252  /// Size of composite.
253  enum { Size = 3 };
254 
255  /// blockLength type.
257 
258  /// numInGroup type.
259  typedef UInt8 NumInGroup;
260 
261  /// blockLength field.
262  BlockLength blockLength() const
263  {
264  return blockLength_;
265  }
266 
267  /// numInGroup field.
268  NumInGroup numInGroup() const
269  {
270  return numInGroup_;
271  }
272 
273 private:
274  BlockLength blockLength_;
275  NumInGroup numInGroup_;
276 };
277 
278 
279 /// Repeating group dimensions.
281 {
282 public:
283  /// Size of composite.
284  enum { Size = 4 };
285 
286  /// blockLength type.
287  ///
288  /// FIX type: Length.
290 
291  /// numInGroup type.
292  ///
293  /// FIX type: NumInGroup.
295 
296  /// blockLength field.
297  ///
298  /// FIX type: Length.
299  BlockLength blockLength() const
300  {
301  return blockLength_;
302  }
303 
304  /// numInGroup field.
305  ///
306  /// FIX type: NumInGroup.
307  NumInGroup numInGroup() const
308  {
309  return numInGroup_;
310  }
311 
312 private:
313  BlockLength blockLength_;
314  NumInGroup numInGroup_;
315 };
316 
317 
318 /// Template ID and length of message root.
320 {
321 public:
322  /// Size of composite.
323  enum { Size = 8 };
324 
325  /// blockLength type.
327 
328  /// templateId type.
330 
331  /// schemaId type.
332  typedef UInt16 SchemaId;
333 
334  /// version type.
335  typedef UInt16 Version;
336 
337  /// blockLength field.
338  BlockLength blockLength() const
339  {
340  return blockLength_;
341  }
342 
343  /// templateId field.
344  TemplateId templateId() const
345  {
346  return templateId_;
347  }
348 
349  /// schemaId field.
350  SchemaId schemaId() const
351  {
352  return schemaId_;
353  }
354 
355  /// version field.
356  Version version() const
357  {
358  return version_;
359  }
360 
361 private:
362  BlockLength blockLength_;
363  TemplateId templateId_;
364  SchemaId schemaId_;
365  Version version_;
366 };
367 
368 
369 ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_END
IntegralConstant< UInt8, 255 > NullMonth
Null value for optional Month field.
Definition: Composites.h:123
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Definition: Decimal.h:253
IntegralConstant< UInt16, 65535 > NullYear
Null value for optional Year field.
Definition: Composites.h:115
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Definition: Decimal.h:239
UInt16 BlockLength
blockLength type.
Definition: Composites.h:326
Null values definition for optional Decimal64 field.
Definition: Composites.h:73
UInt16 UInt16
uInt16.
Definition: Fields.h:179
IntegralConstant< Int32, 2147483647 > NullMantissa
Null value for optional Mantissa field.
Definition: Composites.h:46
SchemaId schemaId() const
schemaId field.
Definition: Composites.h:350
UInt16 BlockLength
blockLength type.
Definition: Composites.h:256
BlockLength blockLength() const
blockLength field.
Definition: Composites.h:262
Decimal Decimal64
Floating-point decimal.
Definition: Composites.h:69
UInt8 NumInGroup
numInGroup type.
Definition: Composites.h:259
Template ID and length of message root.
Definition: Composites.h:319
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
Definition: Bootstrap.h:172
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
Definition: Bootstrap.h:110
NumInGroup numInGroup() const
numInGroup field.
Definition: Composites.h:268
Null values definition for optional MaturityMonthYear field.
Definition: Composites.h:186
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for optional Mantissa field.
Definition: Composites.h:224
IntegralConstant< UInt8, 255 > NullWeek
Null value for optional Week field.
Definition: Composites.h:139
bool month(Month &value) const
MM.
Definition: Composites.h:149
TemplateId templateId() const
templateId field.
Definition: Composites.h:344
IntegralConstant< UInt8, 255 > NullDay
Null value for optional Day field.
Definition: Composites.h:131
Mantissa mantissa() const
Returns mantissa of given decimal.
Definition: Decimal.h:211
BlockLength blockLength() const
blockLength field.
Definition: Composites.h:338
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for optional Mantissa field.
Definition: Composites.h:78
FixedPointDecimal< Int64, IntegralConstant< Int8,-7 >> PRICENULL
Price NULL.
Definition: Composites.h:215
Version version() const
version field.
Definition: Composites.h:356
DecimalMantissa mantissa() const
Definition: Decimal.h:133
Null values definition for optional Decimal32 field.
Definition: Composites.h:41
#define ONIXS_CMESTREAMLINEDMDH_LTWT_STRUCT
Definition: Bootstrap.h:114
Null values definition for optional PRICENULL field.
Definition: Composites.h:219
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
Definition: Bootstrap.h:168