OnixS C++ CME MDP Premium Market Data Handler 5.10.2
Users' manual and API documentation
Loading...
Searching...
No Matches
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
29
30
31typedef
32FixedPointDecimal
33<
34 Int64,
35 IntegralConstant<Int8, -9>
36>
38
41{
44 typedef Decimal9 Value;
45
47 typedef
50
51
54 bool operator ==(const Value& other) const noexcept
55 {
56 return (
57 NullMantissa() ==
58 other.mantissa());
59 }
60
63 bool operator !=(const Value& other) const noexcept
64 {
65 return !(*this == other);
66 }
67
69 constexpr
70 operator Value() const noexcept
71 {
72 return Value(NullMantissa());
73 }
74
76 constexpr
77 Value operator()() const noexcept
78 {
79 return Value(NullMantissa());
80 }
81
83 constexpr
84 static Value value() noexcept
85 {
86 return Value(NullMantissa());
87 }
88};
89
90
94typedef
95FixedPointDecimal
96<
97 Int32,
98 IntegralConstant<Int8, -4>
99>
101
104{
108
110 typedef
113
114
117 bool operator ==(const Value& other) const noexcept
118 {
119 return (
120 NullMantissa() ==
121 other.mantissa());
122 }
123
126 bool operator !=(const Value& other) const noexcept
127 {
128 return !(*this == other);
129 }
130
132 constexpr
133 operator Value() const noexcept
134 {
135 return Value(NullMantissa());
136 }
137
139 constexpr
140 Value operator()() const noexcept
141 {
142 return Value(NullMantissa());
143 }
144
146 constexpr
147 static Value value() noexcept
148 {
149 return Value(NullMantissa());
150 }
151};
152
153
158{
159public:
161 enum { Size = 3 };
162
165
168
171 BlockLength blockLength() const noexcept
172 {
173 return blockLength_;
174 }
175
177 void setBlockLength(BlockLength value) noexcept
178 {
179 blockLength_ = value;
180 }
181
184 NumInGroup numInGroup() const noexcept
185 {
186 return numInGroup_;
187 }
188
190 void setNumInGroup(NumInGroup value) noexcept
191 {
192 numInGroup_ = value;
193 }
194
195private:
196 BlockLength blockLength_;
197 NumInGroup numInGroup_;
198};
199
200
205{
206public:
208 enum { Size = 8 };
209
212
215
218 BlockLength blockLength() const noexcept
219 {
220 return blockLength_;
221 }
222
224 void setBlockLength(BlockLength value) noexcept
225 {
226 blockLength_ = value;
227 }
228
231 NumInGroup numInGroup() const noexcept
232 {
233 return numInGroup_;
234 }
235
237 void setNumInGroup(NumInGroup value) noexcept
238 {
239 numInGroup_ = value;
240 }
241
242private:
243 BlockLength blockLength_;
244 ONIXS_CMEMDH_PADDING(5);
245 NumInGroup numInGroup_;
246};
247
248
251{
252public:
254 enum { Size = 4 };
255
260
265
270 BlockLength blockLength() const noexcept
271 {
272 return blockLength_;
273 }
274
278 void setBlockLength(BlockLength value) noexcept
279 {
280 blockLength_ = value;
281 }
282
287 NumInGroup numInGroup() const noexcept
288 {
289 return numInGroup_;
290 }
291
295 void setNumInGroup(NumInGroup value) noexcept
296 {
297 numInGroup_ = value;
298 }
299
300private:
301 BlockLength blockLength_;
302 NumInGroup numInGroup_;
303};
304
305
308{
309public:
311 enum { Size = 8 };
312
315
318
321
324
327 BlockLength blockLength() const noexcept
328 {
329 return blockLength_;
330 }
331
333 void setBlockLength(BlockLength value) noexcept
334 {
335 blockLength_ = value;
336 }
337
340 TemplateId templateId() const noexcept
341 {
342 return templateId_;
343 }
344
346 void setTemplateId(TemplateId value) noexcept
347 {
348 templateId_ = value;
349 }
350
353 SchemaId schemaId() const noexcept
354 {
355 return schemaId_;
356 }
357
359 void setSchemaId(SchemaId value) noexcept
360 {
361 schemaId_ = value;
362 }
363
366 Version version() const noexcept
367 {
368 return version_;
369 }
370
372 void setVersion(Version value) noexcept
373 {
374 version_ = value;
375 }
376
377private:
378 BlockLength blockLength_;
379 TemplateId templateId_;
380 SchemaId schemaId_;
381 Version version_;
382};
383
384
385
387
392{
393public:
395 enum { Size = 5 };
396
398 typedef UInt16 Year;
399
401 typedef
404
406 typedef UInt8 Month;
407
409 typedef
412
414 typedef UInt8 Day;
415
417 typedef
420
422 typedef UInt8 Week;
423
425 typedef
428
432 constexpr
434 : year_(NullYear::value()),
435 month_(NullMonth::value()),
436 day_(NullDay::value()),
437 week_(NullWeek::value())
438 {
439 }
440
442 constexpr
444 Year year,
445 Month month,
446 Day day,
447 Week week) noexcept
448 : year_(year),
449 month_(month),
450 day_(day),
451 week_(week)
452 {
453 }
454
457 struct MemberTraits
458 {
459 enum { Count = 4 };
460
461 typedef Year FirstArgType;
462
463 typedef Month SecondArgType;
464
465 typedef Day ThirdArgType;
466
467 typedef Week FourthArgType;
468 };
469
471 void serialize(void* addr) const noexcept
472 {
473 assert(addr);
474
475 std::memcpy(addr, &year_, sizeof(year_));
476 addr = advanceByBytes(addr, sizeof(year_));
477
478 std::memcpy(addr, &month_, sizeof(month_));
479 addr = advanceByBytes(addr, sizeof(month_));
480
481 std::memcpy(addr, &day_, sizeof(day_));
482 addr = advanceByBytes(addr, sizeof(day_));
483
484 std::memcpy(addr, &week_, sizeof(week_));
485 }
486
489 Year year() const noexcept
490 {
491 return year_;
492 }
493
495 void setYear(Year value) noexcept
496 {
497 year_ = value;
498 }
499
500 void yearNull() noexcept
501 {
502 year_ = NullYear();
503 }
504
507 bool month(Month& value) const noexcept
508 {
509 value = month_;
510 return NullMonth() != month_;
511 }
512
514 void setMonth(Month value) noexcept
515 {
516 month_ = value;
517 }
518
519 void monthNull() noexcept
520 {
521 month_ = NullMonth();
522 }
523
526 bool day(Day& value) const noexcept
527 {
528 value = day_;
529 return NullDay() != day_;
530 }
531
533 void setDay(Day value) noexcept
534 {
535 day_ = value;
536 }
537
538 void dayNull() noexcept
539 {
540 day_ = NullDay();
541 }
542
545 bool week(Week& value) const noexcept
546 {
547 value = week_;
548 return NullWeek() != week_;
549 }
550
552 void setWeek(Week value) noexcept
553 {
554 week_ = value;
555 }
556
557 void weekNull() noexcept
558 {
559 week_ = NullWeek();
560 }
561
562private:
563 Year year_;
564 Month month_;
565 Day day_;
566 Week week_;
567};
568
569
572{
576
579 bool operator ==(const Value& other) const noexcept
580 {
581 return (
583 other.year());
584 }
585
588 bool operator !=(const Value& other) const noexcept
589 {
590 return !(*this == other);
591 }
592
594 constexpr
595 operator Value() const noexcept
596 {
597 return Value();
598 }
599
601 constexpr
602 Value operator()() const noexcept
603 {
604 return Value();
605 }
606
608 constexpr
609 static Value value() noexcept
610 {
611 return Value();
612 }
613};
614
615
617typedef
618FixedPointDecimal
619<
620 Int64,
621 IntegralConstant<Int8, -9>
622>
624
627{
630 typedef PRICE9 Value;
631
633 typedef
636
637
640 bool operator ==(const Value& other) const noexcept
641 {
642 return (
643 NullMantissa() ==
644 other.mantissa());
645 }
646
649 bool operator !=(const Value& other) const noexcept
650 {
651 return !(*this == other);
652 }
653
655 constexpr
656 operator Value() const noexcept
657 {
658 return Value(NullMantissa());
659 }
660
662 constexpr
663 Value operator()() const noexcept
664 {
665 return Value(NullMantissa());
666 }
667
669 constexpr
670 static Value value() noexcept
671 {
672 return Value(NullMantissa());
673 }
674};
675
678inline bool isNull(const PRICE9& value) noexcept
679{
680 return NullPRICE9() == value;
681}
682
683
684
686
#define ONIXS_CMEMDH_MESSAGING_NAMESPACE_BEGIN
Definition Bootstrap.h:57
#define ONIXS_CMEMDH_MESSAGING_NAMESPACE_END
Definition Bootstrap.h:58
#define ONIXS_CMEMDH_DATA_PACKING_END
Definition Compiler.h:176
#define ONIXS_CMEMDH_DATA_PACKING_BEGIN(alignment)
Definition Compiler.h:175
#define ONIXS_CMEMDH_NODISCARD
Definition Compiler.h:150
NumInGroup numInGroup() const noexcept
NumInGroup.
Definition Composites.h:231
void setNumInGroup(NumInGroup value) noexcept
NumInGroup.
Definition Composites.h:237
void setBlockLength(BlockLength value) noexcept
Length.
Definition Composites.h:224
BlockLength blockLength() const noexcept
Length.
Definition Composites.h:218
NumInGroup numInGroup() const noexcept
Definition Composites.h:287
void setNumInGroup(NumInGroup value) noexcept
Definition Composites.h:295
void setBlockLength(BlockLength value) noexcept
Definition Composites.h:278
BlockLength blockLength() const noexcept
Definition Composites.h:270
NumInGroup numInGroup() const noexcept
Definition Composites.h:184
void setNumInGroup(NumInGroup value) noexcept
Sets the numInGroup field.
Definition Composites.h:190
UInt8 NumInGroup
Type alias for the NumInGroup.
Definition Composites.h:167
UInt16 BlockLength
Type alias for the BlockLength.
Definition Composites.h:164
void setBlockLength(BlockLength value) noexcept
Sets the blockLength field.
Definition Composites.h:177
BlockLength blockLength() const noexcept
Definition Composites.h:171
bool week(Week &value) const noexcept
WW.
Definition Composites.h:545
void setMonth(Month value) noexcept
MM.
Definition Composites.h:514
void setYear(Year value) noexcept
YYYY.
Definition Composites.h:495
IntegralConstant< UInt8, 255 > NullDay
Null value for an optional Day field.
Definition Composites.h:419
IntegralConstant< UInt16, 65535 > NullYear
Null value for an optional Year field.
Definition Composites.h:403
void setWeek(Week value) noexcept
WW.
Definition Composites.h:552
bool month(Month &value) const noexcept
MM.
Definition Composites.h:507
constexpr MaturityMonthYear(Year year, Month month, Day day, Week week) noexcept
Initializes fields with provided values.
Definition Composites.h:443
bool day(Day &value) const noexcept
DD.
Definition Composites.h:526
void serialize(void *addr) const noexcept
Serializes to a data buffer.
Definition Composites.h:471
IntegralConstant< UInt8, 255 > NullWeek
Null value for an optional Week field.
Definition Composites.h:427
IntegralConstant< UInt8, 255 > NullMonth
Null value for an optional Month field.
Definition Composites.h:411
Template ID and length of message root.
Definition Composites.h:308
SchemaId schemaId() const noexcept
Definition Composites.h:353
void setVersion(Version value) noexcept
Sets the version field.
Definition Composites.h:372
UInt16 SchemaId
Type alias for the SchemaId.
Definition Composites.h:320
UInt16 BlockLength
Type alias for the BlockLength.
Definition Composites.h:314
void setTemplateId(TemplateId value) noexcept
Sets the templateId field.
Definition Composites.h:346
UInt16 TemplateId
Type alias for the TemplateId.
Definition Composites.h:317
void setSchemaId(SchemaId value) noexcept
Sets the schemaId field.
Definition Composites.h:359
void setBlockLength(BlockLength value) noexcept
Sets the blockLength field.
Definition Composites.h:333
BlockLength blockLength() const noexcept
Definition Composites.h:327
UInt16 Version
Type alias for the Version.
Definition Composites.h:323
TemplateId templateId() const noexcept
Definition Composites.h:340
FixedPointDecimal< Int32, IntegralConstant< Int8, -4 > > DecimalQty
Definition Composites.h:100
FixedPointDecimal< Int64, IntegralConstant< Int8, -9 > > Decimal9
Decimal with constant exponent -9.
Definition Composites.h:37
std::uint16_t UInt16
uInt16.
Definition Integral.h:33
MessageHeader MessageHeaderBuilder
Definition Composites.h:685
MessageHeader::SchemaId SchemaId
FixedPointDecimal< Int64, IntegralConstant< Int8, -9 > > PRICE9
Price with constant exponent -9.
Definition Composites.h:623
std::uint8_t UInt8
uInt8.
Definition Integral.h:31
The months in year.
Definition Time.h:378
Null values definition for optional Decimal9 field.
Definition Composites.h:41
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:49
constexpr Value operator()() const noexcept
Definition Composites.h:77
static constexpr Value value() noexcept
Definition Composites.h:84
Null values definition for optional DecimalQty field.
Definition Composites.h:104
IntegralConstant< Int32, 2147483647 > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:112
constexpr Value operator()() const noexcept
Definition Composites.h:140
static constexpr Value value() noexcept
Definition Composites.h:147
Null values definition for optional MaturityMonthYear field.
Definition Composites.h:572
constexpr Value operator()() const noexcept
Definition Composites.h:602
static constexpr Value value() noexcept
Definition Composites.h:609
Null values definition for optional PRICE9 field.
Definition Composites.h:627
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:635
constexpr Value operator()() const noexcept
Definition Composites.h:663
static constexpr Value value() noexcept
Definition Composites.h:670