OnixS C++ CME MDP Streamlined Market Data Handler  1.2.0
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  /// Aliases the type whose null value
44  /// traits are exposed by the given class.
45  typedef Decimal32 Value;
46 
47  /// Null value for optional Mantissa field.
48  typedef
51 
52  /// Compares encoded data to NULL.
53  bool
55  const Value& other) const
56  {
57  return (
58  NullMantissa() ==
59  other.mantissa()
60  );
61  }
62 
63  /// Compares encoded data to NULL.
64  bool
66  const Value& other) const
67  {
68  return !(*this == other);
69  }
70 };
71 
72 /// Optional floating point decimal with int32 mantissa and int8 exponent.
73 typedef
75 <
76  Int32,
77  Int8
78 >
80 
81 
82 /// Null values definition for optional Decimal32NULL field.
84 {
85  /// Aliases the type whose null value
86  /// traits are exposed by the given class.
88 
89  /// Null value for optional Mantissa field.
90  typedef
93 
94  /// Compares encoded data to NULL.
95  bool
97  const Value& other) const
98  {
99  return (
100  NullMantissa() ==
101  other.mantissa()
102  );
103  }
104 
105  /// Compares encoded data to NULL.
106  bool
108  const Value& other) const
109  {
110  return !(*this == other);
111  }
112 };
113 
114 /// Floating-point decimal.
115 typedef
117 <
118  Int64,
119  Int8
120 >
122 
123 
124 /// Null values definition for optional Decimal64 field.
126 {
127  /// Aliases the type whose null value
128  /// traits are exposed by the given class.
129  typedef Decimal64 Value;
130 
131  /// Null value for optional Mantissa field.
132  typedef
135 
136  /// Compares encoded data to NULL.
137  bool
139  const Value& other) const
140  {
141  return (
142  NullMantissa() ==
143  other.mantissa()
144  );
145  }
146 
147  /// Compares encoded data to NULL.
148  bool
150  const Value& other) const
151  {
152  return !(*this == other);
153  }
154 };
155 
156 /// Year, Month and Date.
157 ///
158 /// FIX type: MonthYear.
160 {
161 public:
162  /// Size of composite.
163  enum { Size = 5 };
164 
165  /// YYYY.
166  typedef UInt16 Year;
167 
168  /// Null value for optional Year field.
169  typedef
172 
173  /// MM.
174  typedef UInt8 Month;
175 
176  /// Null value for optional Month field.
177  typedef
180 
181  /// DD.
182  typedef UInt8 Day;
183 
184  /// Null value for optional Day field.
185  typedef
188 
189  /// WW.
190  typedef UInt8 Week;
191 
192  /// Null value for optional Week field.
193  typedef
196 
197  /// Default constructor.
198  ///
199  /// Initializes fields with appropriate null values.
201  : year_(NullYear::value()),
202  month_(NullMonth::value()),
203  day_(NullDay::value()),
204  week_(NullWeek::value())
205  {
206  }
207 
208  /// YYYY.
209  Year year() const
210  {
211  return year_;
212  }
213 
214  /// MM.
215  bool
217  Month& value) const
218  {
219  if (NullMonth() == month_) return false;
220  value = month_;
221  return true;
222  }
223 
224  /// DD.
225  bool
227  Day& value) const
228  {
229  if (NullDay() == day_) return false;
230  value = day_;
231  return true;
232  }
233 
234  /// WW.
235  bool
237  Week& value) const
238  {
239  if (NullWeek() == week_) return false;
240  value = week_;
241  return true;
242  }
243 
244 private:
245  Year year_;
246  Month month_;
247  Day day_;
248  Week week_;
249 };
250 
251 
252 /// Null values definition for optional MaturityMonthYear field.
254 {
255  /// Aliases the type whose null value
256  /// traits are exposed by the given class.
258 
259  /// Compares encoded data to NULL.
260  bool
262  const Value& other) const
263  {
264  return (
266  other.year()
267  );
268  }
269 
270  /// Compares encoded data to NULL.
271  bool
273  const Value& other) const
274  {
275  return !(*this == other);
276  }
277 };
278 
279 /// Price NULL.
280 typedef
282 <
283  Int64,
285 >
287 
288 
289 /// Null values definition for optional PRICENULL field.
291 {
292  /// Aliases the type whose null value
293  /// traits are exposed by the given class.
294  typedef PRICENULL Value;
295 
296  /// Null value for optional Mantissa field.
297  typedef
300 
301  /// Compares encoded data to NULL.
302  bool
304  const Value& other) const
305  {
306  return (
307  NullMantissa() ==
308  other.mantissa()
309  );
310  }
311 
312  /// Compares encoded data to NULL.
313  bool
315  const Value& other) const
316  {
317  return !(*this == other);
318  }
319 };
320 
321 /// Optional Price with constant exponent -9.
322 typedef
324 <
325  Int64,
327 >
329 
330 
331 /// Null values definition for optional PRICENULL9 field.
333 {
334  /// Aliases the type whose null value
335  /// traits are exposed by the given class.
336  typedef PRICENULL9 Value;
337 
338  /// Null value for optional Mantissa field.
339  typedef
342 
343  /// Compares encoded data to NULL.
344  bool
346  const Value& other) const
347  {
348  return (
349  NullMantissa() ==
350  other.mantissa()
351  );
352  }
353 
354  /// Compares encoded data to NULL.
355  bool
357  const Value& other) const
358  {
359  return !(*this == other);
360  }
361 };
362 
363 /// Repeating group dimensions.
364 ///
365 /// FIX type: NumInGroup.
367 {
368 public:
369  /// Size of composite.
370  enum { Size = 3 };
371 
372  /// blockLength type.
374 
375  /// numInGroup type.
376  typedef UInt8 NumInGroup;
377 
378  /// Default constructor.
379  ///
380  /// Initializes fields with zero values.
382  : blockLength_(0),
383  numInGroup_(0)
384  {
385  }
386 
387  /// blockLength field.
388  BlockLength blockLength() const
389  {
390  return blockLength_;
391  }
392 
393  /// numInGroup field.
394  NumInGroup numInGroup() const
395  {
396  return numInGroup_;
397  }
398 
399 private:
400  BlockLength blockLength_;
401  NumInGroup numInGroup_;
402 };
403 
404 
405 /// Repeating group dimensions.
407 {
408 public:
409  /// Size of composite.
410  enum { Size = 4 };
411 
412  /// blockLength type.
413  ///
414  /// FIX type: Length.
416 
417  /// numInGroup type.
418  ///
419  /// FIX type: NumInGroup.
421 
422  /// Default constructor.
423  ///
424  /// Initializes fields with zero values.
426  : blockLength_(0),
427  numInGroup_(0)
428  {
429  }
430 
431  /// blockLength field.
432  ///
433  /// FIX type: Length.
434  BlockLength blockLength() const
435  {
436  return blockLength_;
437  }
438 
439  /// numInGroup field.
440  ///
441  /// FIX type: NumInGroup.
442  NumInGroup numInGroup() const
443  {
444  return numInGroup_;
445  }
446 
447 private:
448  BlockLength blockLength_;
449  NumInGroup numInGroup_;
450 };
451 
452 
453 /// Template ID and length of message root.
455 {
456 public:
457  /// Size of composite.
458  enum { Size = 8 };
459 
460  /// blockLength type.
462 
463  /// templateId type.
465 
466  /// schemaId type.
467  typedef UInt16 SchemaId;
468 
469  /// version type.
470  typedef UInt16 Version;
471 
472  /// Default constructor.
473  ///
474  /// Initializes fields with zero values.
476  : blockLength_(0),
477  templateId_(0),
478  schemaId_(0),
479  version_(0)
480  {
481  }
482 
483  /// blockLength field.
484  BlockLength blockLength() const
485  {
486  return blockLength_;
487  }
488 
489  /// templateId field.
490  TemplateId templateId() const
491  {
492  return templateId_;
493  }
494 
495  /// schemaId field.
496  SchemaId schemaId() const
497  {
498  return schemaId_;
499  }
500 
501  /// version field.
502  Version version() const
503  {
504  return version_;
505  }
506 
507 private:
508  BlockLength blockLength_;
509  TemplateId templateId_;
510  SchemaId schemaId_;
511  Version version_;
512 };
513 
514 
515 ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_END
IntegralConstant< UInt8, 255 > NullMonth
Null value for optional Month field.
Definition: Composites.h:179
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Definition: Decimal.h:134
IntegralConstant< UInt16, 65535 > NullYear
Null value for optional Year field.
Definition: Composites.h:171
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for optional Mantissa field.
Definition: Composites.h:341
Decimal64 Value
Aliases the type whose null value traits are exposed by the given class.
Definition: Composites.h:129
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Definition: Decimal.h:116
UInt16 BlockLength
blockLength type.
Definition: Composites.h:461
PRICENULL9 Value
Aliases the type whose null value traits are exposed by the given class.
Definition: Composites.h:336
Null values definition for optional Decimal64 field.
Definition: Composites.h:125
UInt16 UInt16
uInt16.
Definition: Fields.h:179
IntegralConstant< Int32, 2147483647 > NullMantissa
Null value for optional Mantissa field.
Definition: Composites.h:50
Decimal32 Value
Aliases the type whose null value traits are exposed by the given class.
Definition: Composites.h:45
SchemaId schemaId() const
schemaId field.
Definition: Composites.h:496
UInt16 BlockLength
blockLength type.
Definition: Composites.h:373
NumInGroup numInGroup() const
numInGroup field.
Definition: Composites.h:442
BlockLength blockLength() const
blockLength field.
Definition: Composites.h:388
Repeating group dimensions.
Definition: Composites.h:366
UInt8 NumInGroup
numInGroup type.
Definition: Composites.h:376
Template ID and length of message root.
Definition: Composites.h:454
Represents real number with constant exponent.
Definition: Decimal.h:41
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
Definition: Bootstrap.h:173
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
Definition: Bootstrap.h:111
Null values definition for optional PRICENULL9 field.
Definition: Composites.h:332
Decimal32NULL Value
Aliases the type whose null value traits are exposed by the given class.
Definition: Composites.h:87
NumInGroup numInGroup() const
numInGroup field.
Definition: Composites.h:394
Null values definition for optional MaturityMonthYear field.
Definition: Composites.h:253
PRICENULL Value
Aliases the type whose null value traits are exposed by the given class.
Definition: Composites.h:294
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for optional Mantissa field.
Definition: Composites.h:299
FixedPointDecimal< Int64, IntegralConstant< Int8,-9 >> PRICENULL9
Optional Price with constant exponent -9.
Definition: Composites.h:328
IntegralConstant< UInt8, 255 > NullWeek
Null value for optional Week field.
Definition: Composites.h:195
bool month(Month &value) const
MM.
Definition: Composites.h:216
TemplateId templateId() const
templateId field.
Definition: Composites.h:490
IntegralConstant< UInt8, 255 > NullDay
Null value for optional Day field.
Definition: Composites.h:187
Mantissa mantissa() const
Returns mantissa of given decimal.
Definition: Decimal.h:87
BlockLength blockLength() const
blockLength field.
Definition: Composites.h:484
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for optional Mantissa field.
Definition: Composites.h:134
FixedPointDecimal< Int64, IntegralConstant< Int8,-7 >> PRICENULL
Price NULL.
Definition: Composites.h:286
BlockLength blockLength() const
blockLength field.
Definition: Composites.h:434
Version version() const
version field.
Definition: Composites.h:502
Null values definition for optional Decimal32NULL field.
Definition: Composites.h:83
Null values definition for optional Decimal32 field.
Definition: Composites.h:41
FixedPointDecimal< Int64, Int8 > Decimal64
Floating-point decimal.
Definition: Composites.h:121
IntegralConstant< Int32, 2147483647 > NullMantissa
Null value for optional Mantissa field.
Definition: Composites.h:92
MaturityMonthYear Value
Aliases the type whose null value traits are exposed by the given class.
Definition: Composites.h:257
#define ONIXS_CMESTREAMLINEDMDH_LTWT_STRUCT
Definition: Bootstrap.h:115
FixedPointDecimal< Int32, Int8 > Decimal32NULL
Optional floating point decimal with int32 mantissa and int8 exponent.
Definition: Composites.h:79
Null values definition for optional PRICENULL field.
Definition: Composites.h:290
GroupSize()
Default constructor.
Definition: Composites.h:381
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
Definition: Bootstrap.h:169