OnixS C++ CME MDP Conflated TCP Handler 1.3.6
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
24
27
29ONIXS_CONFLATEDTCP_DATA_PACKING_BEGIN(1)
30
31
32typedef
34<
35 Int64,
37>
39
42{
45 typedef Decimal9 Value;
46
48 typedef
51
52
55 bool operator ==(const Value& other) const
57 {
58 return (
59 NullMantissa() ==
60 other.mantissa());
61 }
62
65 bool operator !=(const Value& other) const
67 {
68 return !(*this == other);
69 }
70
73 operator Value() const
75 {
76 return Value(NullMantissa());
77 }
78
83 {
84 return Value(NullMantissa());
85 }
86
89 static Value value()
91 {
92 return Value(NullMantissa());
93 }
94};
95
96
100typedef
101FixedPointDecimal
102<
103 Int32,
104 IntegralConstant<Int8, -4>
105>
107
110{
114
116 typedef
119
120
123 bool operator ==(const Value& other) const
125 {
126 return (
127 NullMantissa() ==
128 other.mantissa());
129 }
130
133 bool operator !=(const Value& other) const
135 {
136 return !(*this == other);
137 }
138
141 operator Value() const
143 {
144 return Value(NullMantissa());
145 }
146
151 {
152 return Value(NullMantissa());
153 }
154
157 static Value value()
159 {
160 return Value(NullMantissa());
161 }
162};
163
164
169{
170public:
172 enum { Size = 3 };
173
176
179
184 {
185 return blockLength_;
186 }
187
191 {
192 blockLength_ = value;
193 }
194
199 {
200 return numInGroup_;
201 }
202
206 {
207 numInGroup_ = value;
208 }
209
210private:
211 BlockLength blockLength_;
212 NumInGroup numInGroup_;
213};
214
215
220{
221public:
223 enum { Size = 8 };
224
227
230
235 {
236 return blockLength_;
237 }
238
242 {
243 blockLength_ = value;
244 }
245
250 {
251 return numInGroup_;
252 }
253
257 {
258 numInGroup_ = value;
259 }
260
261private:
262 BlockLength blockLength_;
263 ONIXS_CONFLATEDTCP_PADDING(5);
264 NumInGroup numInGroup_;
265};
266
267
270{
271public:
273 enum { Size = 4 };
274
279
284
291 {
292 return blockLength_;
293 }
294
300 {
301 blockLength_ = value;
302 }
303
310 {
311 return numInGroup_;
312 }
313
319 {
320 numInGroup_ = value;
321 }
322
323private:
324 BlockLength blockLength_;
325 NumInGroup numInGroup_;
326};
327
328
331{
332public:
334 enum { Size = 8 };
335
338
341
344
347
352 {
353 return blockLength_;
354 }
355
359 {
360 blockLength_ = value;
361 }
362
367 {
368 return templateId_;
369 }
370
374 {
375 templateId_ = value;
376 }
377
382 {
383 return schemaId_;
384 }
385
389 {
390 schemaId_ = value;
391 }
392
397 {
398 return version_;
399 }
400
402 void setVersion(Version value)
404 {
405 version_ = value;
406 }
407
408private:
409 BlockLength blockLength_;
410 TemplateId templateId_;
411 SchemaId schemaId_;
412 Version version_;
413};
414
415
416
417ONIXS_CONFLATEDTCP_DATA_PACKING_END
418
423{
424public:
426 enum { Size = 5 };
427
429 typedef UInt16 Year;
430
432 typedef
435
437 typedef UInt8 Month;
438
440 typedef
443
445 typedef UInt8 Day;
446
448 typedef
451
453 typedef UInt8 Week;
454
456 typedef
459
466 : year_(NullYear::value()),
467 month_(NullMonth::value()),
468 day_(NullDay::value()),
469 week_(NullWeek::value())
470 {
471 }
472
476 Year year,
477 Month month,
478 Day day,
479 Week week)
481 : year_(year),
482 month_(month),
483 day_(day),
484 week_(week)
485 {
486 }
487
490 struct MemberTraits
491 {
492 enum { Count = 4 };
493
494 typedef Year FirstArgType;
495
496 typedef Month SecondArgType;
497
498 typedef Day ThirdArgType;
499
500 typedef Week FourthArgType;
501 };
502
504 void serialize(void* addr) const
506 {
507 assert(addr);
508
509 std::memcpy(addr, &year_, sizeof(year_));
510 addr = advanceByBytes(addr, sizeof(year_));
511
512 std::memcpy(addr, &month_, sizeof(month_));
513 addr = advanceByBytes(addr, sizeof(month_));
514
515 std::memcpy(addr, &day_, sizeof(day_));
516 addr = advanceByBytes(addr, sizeof(day_));
517
518 std::memcpy(addr, &week_, sizeof(week_));
519 }
520
523 Year year() const
525 {
526 return year_;
527 }
528
530 void setYear(Year value)
532 {
533 year_ = value;
534 }
535
536 void yearNull()
538 {
539 year_ = NullYear();
540 }
541
544 bool month(Month& value) const
546 {
547 value = month_;
548 return NullMonth() != month_;
549 }
550
552 void setMonth(Month value)
554 {
555 month_ = value;
556 }
557
560 {
561 month_ = NullMonth();
562 }
563
566 bool day(Day& value) const
568 {
569 value = day_;
570 return NullDay() != day_;
571 }
572
574 void setDay(Day value)
576 {
577 day_ = value;
578 }
579
580 void dayNull()
582 {
583 day_ = NullDay();
584 }
585
588 bool week(Week& value) const
590 {
591 value = week_;
592 return NullWeek() != week_;
593 }
594
596 void setWeek(Week value)
598 {
599 week_ = value;
600 }
601
602 void weekNull()
604 {
605 week_ = NullWeek();
606 }
607
610 bool
611 operator==(
612 const MaturityMonthYear& other) const
614
617 bool
619 const MaturityMonthYear& other) const
621 {
622 return !(*this == other);
623 }
624
625private:
626 Year year_;
627 Month month_;
628 Day day_;
629 Week week_;
630};
631
632
635{
639
642 bool operator ==(const Value& other) const
644 {
645 return (
647 other.year());
648 }
649
652 bool operator !=(const Value& other) const
654 {
655 return !(*this == other);
656 }
657
660 operator Value() const
662 {
663 return Value();
664 }
665
670 {
671 return Value();
672 }
673
676 static Value value()
678 {
679 return Value();
680 }
681};
682
683inline
684bool
686 const MaturityMonthYear& other) const
688{
689 if((NullMaturityMonthYear() == *this) &&
690 (NullMaturityMonthYear() == other))
691 return true;
692
693 return
694 (this->year_ == other.year_) &&
695 (this->month_ == other.month_) &&
696 (this->day_ == other.day_) &&
697 (this->week_ == other.week_);
698}
699
701typedef
703<
704 Int64,
706>
708
711{
714 typedef PRICE9 Value;
715
717 typedef
720
721
724 bool operator ==(const Value& other) const
726 {
727 return (
728 NullMantissa() ==
729 other.mantissa());
730 }
731
734 bool operator !=(const Value& other) const
736 {
737 return !(*this == other);
738 }
739
742 operator Value() const
744 {
745 return Value(NullMantissa());
746 }
747
752 {
753 return Value(NullMantissa());
754 }
755
758 static Value value()
760 {
761 return Value(NullMantissa());
762 }
763};
764
767inline bool isNull(const PRICE9& value)
769{
770 return NullPRICE9() == value;
771}
772
773
774
#define ONIXS_CONFLATEDTCP_MESSAGING_MDP_NAMESPACE_BEGIN
Definition ABI.h:147
#define ONIXS_CONFLATEDTCP_LTWT_STRUCT
Definition ABI.h:88
#define ONIXS_CONFLATEDTCP_LTWT_CLASS
Definition ABI.h:84
#define ONIXS_CONFLATEDTCP_MESSAGING_MDP_NAMESPACE_END
Definition ABI.h:151
#define ONIXS_CONFLATEDTCP_CONSTEXPR
Definition Compiler.h:179
#define ONIXS_CONFLATEDTCP_NOTHROW
Definition Compiler.h:176
#define ONIXS_CONFLATEDTCP_NODISCARD
Definition Compiler.h:185
8 Byte aligned repeating group dimensions.
Definition Composites.h:220
NumInGroup numInGroup() const noexcept
NumInGroup.
Definition Composites.h:248
void setNumInGroup(NumInGroup value) noexcept
NumInGroup.
Definition Composites.h:255
void setBlockLength(BlockLength value) noexcept
Length.
Definition Composites.h:240
BlockLength blockLength() const noexcept
Length.
Definition Composites.h:233
void setNumInGroup(NumInGroup value) noexcept
Sets the numInGroup field.
Definition Composites.h:317
UInt16 BlockLength
Type alias for the BlockLength.
Definition Composites.h:278
UInt16 NumInGroup
Type alias for the NumInGroup.
Definition Composites.h:283
void setBlockLength(BlockLength value) noexcept
Sets the blockLength field.
Definition Composites.h:298
void setNumInGroup(NumInGroup value) noexcept
Sets the numInGroup field.
Definition Composites.h:204
UInt8 NumInGroup
Type alias for the NumInGroup.
Definition Composites.h:178
UInt16 BlockLength
Type alias for the BlockLength.
Definition Composites.h:175
void setBlockLength(BlockLength value) noexcept
Sets the blockLength field.
Definition Composites.h:189
constexpr MaturityMonthYear() noexcept
Default constructor.
Definition Composites.h:464
IntegralConstant< UInt8, 255 > NullDay
Null value for an optional Day field.
Definition Composites.h:450
IntegralConstant< UInt16, 65535 > NullYear
Null value for an optional Year field.
Definition Composites.h:434
bool operator==(const MaturityMonthYear &other) const noexcept
Compares encoded data.
Definition Composites.h:685
bool operator!=(const MaturityMonthYear &other) const noexcept
Compares encoded data.
Definition Composites.h:618
constexpr MaturityMonthYear(Year year, Month month, Day day, Week week) noexcept
Initializes fields with provided values.
Definition Composites.h:475
void serialize(void *addr) const noexcept
Serializes to a data buffer.
Definition Composites.h:504
IntegralConstant< UInt8, 255 > NullWeek
Null value for an optional Week field.
Definition Composites.h:458
IntegralConstant< UInt8, 255 > NullMonth
Null value for an optional Month field.
Definition Composites.h:442
Template ID and length of message root.
Definition Composites.h:331
void setVersion(Version value) noexcept
Sets the version field.
Definition Composites.h:402
UInt16 SchemaId
Type alias for the SchemaId.
Definition Composites.h:343
UInt16 BlockLength
Type alias for the BlockLength.
Definition Composites.h:337
void setTemplateId(TemplateId value) noexcept
Sets the templateId field.
Definition Composites.h:372
UInt16 TemplateId
Type alias for the TemplateId.
Definition Composites.h:340
void setSchemaId(SchemaId value) noexcept
Sets the schemaId field.
Definition Composites.h:387
void setBlockLength(BlockLength value) noexcept
Sets the blockLength field.
Definition Composites.h:357
bool isNull(const PRICE9 &value) noexcept
Definition Composites.h:767
FixedPointDecimal< Int32, IntegralConstant< Int8, -4 > > DecimalQty
A number representing quantity.
Definition Composites.h:106
FixedPointDecimal< Int64, IntegralConstant< Int8, -9 > > Decimal9
Decimal with constant exponent -9.
Definition Composites.h:38
FixedPointDecimal< Int64, IntegralConstant< Int8, -9 > > PRICE9
Price with constant exponent -9.
Definition Composites.h:707
Null values definition for optional Decimal9 field.
Definition Composites.h:42
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:50
constexpr Value operator()() const noexcept
Definition Composites.h:81
Decimal9 Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:45
Null values definition for optional DecimalQty field.
Definition Composites.h:110
IntegralConstant< Int32, 2147483647 > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:118
DecimalQty Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:113
Null values definition for optional MaturityMonthYear field.
Definition Composites.h:635
MaturityMonthYear Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:638
Null values definition for optional PRICE9 field.
Definition Composites.h:711
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:719
PRICE9 Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:714
constexpr Value operator()() const noexcept
Definition Composites.h:750
static constexpr Value value() noexcept
Definition Composites.h:758