OnixS C++ B3 Binary UMDF Market Data Handler 1.10.0
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
24
28
29#ifdef DELETE
30#undef DELETE
31#endif
32
34ONIXS_B3_UMDF_MD_DATA_PACKING_BEGIN(1)
35
36
38{
39public:
41 enum { Size = 8 };
42
45
48
51
53 typedef UInt16 Version;
54
56 ONIXS_B3_UMDF_MD_NODISCARD
57 BlockLength blockLength() const
59 {
60 return blockLength_;
61 }
62
64 ONIXS_B3_UMDF_MD_NODISCARD
65 TemplateId templateId() const
67 {
68 return templateId_;
69 }
70
72 ONIXS_B3_UMDF_MD_NODISCARD
73 SchemaId schemaId() const
75 {
76 return schemaId_;
77 }
78
80 ONIXS_B3_UMDF_MD_NODISCARD
81 Version version() const
83 {
84 return version_;
85 }
86
87private:
88 BlockLength blockLength_;
89 TemplateId templateId_;
90 SchemaId schemaId_;
91 Version version_;
92};
93
94
97{
98public:
100 enum { Size = 3 };
101
104
109
111 ONIXS_B3_UMDF_MD_NODISCARD
112 std::string
113 toString() const;
114
116 ONIXS_B3_UMDF_MD_NODISCARD
117 BlockLength blockLength() const
119 {
120 return blockLength_;
121 }
122
126 ONIXS_B3_UMDF_MD_NODISCARD
127 NumInGroup numInGroup() const
129 {
130 return numInGroup_;
131 }
132
133private:
134 BlockLength blockLength_;
135 NumInGroup numInGroup_;
136};
137
138
142typedef
143FixedPointDecimal
144<
145 Int64,
146 IntegralConstant<Int8, -4>
147>
149
153typedef
155<
156 Int64,
158 IntegralConstant<Int64, -9223372036854775807LL-1>
159>
161
164{
168
170 typedef
171 IntegralConstant<Int64, -9223372036854775807LL-1>
173
174
176 ONIXS_B3_UMDF_MD_NODISCARD
177 bool operator ==(const Value& other) const
178 noexcept
179 {
180 return (
181 NullMantissa() ==
182 other.mantissa());
183 }
184
186 ONIXS_B3_UMDF_MD_NODISCARD
187 bool operator !=(const Value& other) const
188 noexcept
189 {
190 return !(*this == other);
191 }
192
194 constexpr
195 operator Value() const
196 noexcept
197 {
198 return Value(NullMantissa());
199 }
200
202 constexpr
203 Value operator()() const
204 noexcept
205 {
206 return Value(NullMantissa());
207 }
208
210 constexpr
211 static Value value()
212 noexcept
213 {
214 return Value(NullMantissa());
215 }
216};
217
219ONIXS_B3_UMDF_MD_NODISCARD
220inline bool
221isNull(
222 const PriceOptional& value)
223 noexcept
224{
225 return value.isNull();
226}
227
231typedef
232FixedPointDecimal
233<
234 Int64,
235 IntegralConstant<Int8, -4>
236>
238
241{
245
247 typedef
250
251
253 ONIXS_B3_UMDF_MD_NODISCARD
254 bool operator ==(const Value& other) const
255 noexcept
256 {
257 return (
258 NullMantissa() ==
259 other.mantissa());
260 }
261
263 ONIXS_B3_UMDF_MD_NODISCARD
264 bool operator !=(const Value& other) const
265 noexcept
266 {
267 return !(*this == other);
268 }
269
271 constexpr
272 operator Value() const
273 noexcept
274 {
275 return Value(NullMantissa());
276 }
277
279 constexpr
280 Value operator()() const
281 noexcept
282 {
283 return Value(NullMantissa());
284 }
285
287 constexpr
288 static Value value()
289 noexcept
290 {
291 return Value(NullMantissa());
292 }
293};
294
295
299typedef
300FixedPointDecimal
301<
302 Int64,
303 IntegralConstant<Int8, -7>
304>
306
309{
313
315 typedef
316 IntegralConstant<Int64, -9223372036854775807LL-1>
318
319
321 ONIXS_B3_UMDF_MD_NODISCARD
322 bool operator ==(const Value& other) const
323 noexcept
324 {
325 return (
326 NullMantissa() ==
327 other.mantissa());
328 }
329
331 ONIXS_B3_UMDF_MD_NODISCARD
332 bool operator !=(const Value& other) const
333 noexcept
334 {
335 return !(*this == other);
336 }
337
339 constexpr
340 operator Value() const
341 noexcept
342 {
343 return Value(NullMantissa());
344 }
345
347 constexpr
348 Value operator()() const
349 noexcept
350 {
351 return Value(NullMantissa());
352 }
353
355 constexpr
356 static Value value()
357 noexcept
358 {
359 return Value(NullMantissa());
360 }
361};
362
363
365typedef
366FixedPointDecimal
367<
368 Int64,
369 IntegralConstant<Int8, -8>
370>
372
375{
378 typedef Fixed8 Value;
379
381 typedef
382 IntegralConstant<Int64, -9223372036854775807LL-1>
384
385
387 ONIXS_B3_UMDF_MD_NODISCARD
388 bool operator ==(const Value& other) const
389 noexcept
390 {
391 return (
392 NullMantissa() ==
393 other.mantissa());
394 }
395
397 ONIXS_B3_UMDF_MD_NODISCARD
398 bool operator !=(const Value& other) const
399 noexcept
400 {
401 return !(*this == other);
402 }
403
405 constexpr
406 operator Value() const
407 noexcept
408 {
409 return Value(NullMantissa());
410 }
411
413 constexpr
414 Value operator()() const
415 noexcept
416 {
417 return Value(NullMantissa());
418 }
419
421 constexpr
422 static Value value()
423 noexcept
424 {
425 return Value(NullMantissa());
426 }
427};
428
429
433typedef
434FixedPointDecimal
435<
436 Int64,
437 IntegralConstant<Int8, -8>
438>
440
444typedef
446<
447 Int64,
449>
451
454{
458
460 typedef
461 IntegralConstant<Int64, -9223372036854775807LL-1>
463
464
466 ONIXS_B3_UMDF_MD_NODISCARD
467 bool operator ==(const Value& other) const
468 noexcept
469 {
470 return (
471 NullMantissa() ==
472 other.mantissa());
473 }
474
476 ONIXS_B3_UMDF_MD_NODISCARD
477 bool operator !=(const Value& other) const
478 noexcept
479 {
480 return !(*this == other);
481 }
482
484 constexpr
485 operator Value() const
486 noexcept
487 {
488 return Value(NullMantissa());
489 }
490
492 constexpr
493 Value operator()() const
494 noexcept
495 {
496 return Value(NullMantissa());
497 }
498
500 constexpr
501 static Value value()
502 noexcept
503 {
504 return Value(NullMantissa());
505 }
506};
507
508
512{
513public:
515 enum { Size = 1 };
516
518 typedef UInt8 Length;
519
521 typedef Char VarData;
522
524 ONIXS_B3_UMDF_MD_NODISCARD
525 Length length() const
527 {
528 return length_;
529 }
530
532 ONIXS_B3_UMDF_MD_NODISCARD
533 StrRef varData() const
535 {
536 return StrRef(reinterpret_cast<const Char*>(this) + Size, length());
537 }
538
540 ONIXS_B3_UMDF_MD_NODISCARD
541 std::string
542 toString() const;
543
544
546 ONIXS_B3_UMDF_MD_NODISCARD
547 Length binarySize() const
549 {
550 return Size + length();
551 }
552
553private:
554 Length length_;
555};
556
557
561{
562public:
564 enum { Size = 2 };
565
567 typedef UInt16 Length;
568
570 typedef UInt8 VarData;
571
573 ONIXS_B3_UMDF_MD_NODISCARD
574 Length length() const
576 {
577 return length_;
578 }
579
581 ONIXS_B3_UMDF_MD_NODISCARD
582 StrRef varData() const
584 {
585 return StrRef(reinterpret_cast<const Char*>(this) + Size, length());
586 }
587
589 ONIXS_B3_UMDF_MD_NODISCARD
590 std::string
591 toString() const;
592
593
595 ONIXS_B3_UMDF_MD_NODISCARD
596 Length binarySize() const
598 {
599 return Size + length();
600 }
601
602private:
603 Length length_;
604};
605
606
608
609ONIXS_B3_UMDF_MD_DATA_PACKING_END
610
615{
616public:
618 enum { Size = 8 };
619
621 typedef UInt64 Time;
622
624 typedef
627
629 typedef
632
636 constexpr
639 : time_(NullTime::value())
640 {
641 }
642
644 explicit
645 constexpr
648 : time_(time)
649 {
650 }
651
653 ONIXS_B3_UMDF_MD_NODISCARD
654 std::string
655 toString() const;
656
659 struct MemberTraits
660 {
661 enum { Count = 1 };
662
663 typedef Time FirstArgType;
664 };
665
667 ONIXS_B3_UMDF_MD_NODISCARD
668 Time time() const
670 {
671 return time_;
672 }
673
675 ONIXS_B3_UMDF_MD_NODISCARD
676 TimeUnit::Enum unit() const
678 {
680 }
681
682private:
683 Time time_;
684};
685
686
689{
693
695 ONIXS_B3_UMDF_MD_NODISCARD
696 bool operator ==(const Value& other) const
697 noexcept
698 {
699 return (
701 other.time());
702 }
703
705 ONIXS_B3_UMDF_MD_NODISCARD
706 bool operator !=(const Value& other) const
707 noexcept
708 {
709 return !(*this == other);
710 }
711
713 constexpr
714 operator Value() const
715 noexcept
716 {
717 return Value();
718 }
719
721 constexpr
722 Value operator()() const
723 noexcept
724 {
725 return Value();
726 }
727
729 constexpr
730 static Value value()
731 noexcept
732 {
733 return Value();
734 }
735};
736
737
742{
743public:
745 enum { Size = 8 };
746
748 typedef Int64 Time;
749
751 typedef
752 IntegralConstant<Int64, -9223372036854775807LL-1>
754
756 typedef
759
763 constexpr
766 : time_(NullTime::value())
767 {
768 }
769
771 explicit
772 constexpr
775 : time_(time)
776 {
777 }
778
780 ONIXS_B3_UMDF_MD_NODISCARD
781 std::string
782 toString() const;
783
786 struct MemberTraits
787 {
788 enum { Count = 1 };
789
790 typedef Time FirstArgType;
791 };
792
794 ONIXS_B3_UMDF_MD_NODISCARD
795 Time time() const
797 {
798 return time_;
799 }
800
802 ONIXS_B3_UMDF_MD_NODISCARD
803 TimeUnit::Enum unit() const
805 {
806 return TimeUnit::SECOND;
807 }
808
809private:
810 Time time_;
811};
812
813
816{
820
822 ONIXS_B3_UMDF_MD_NODISCARD
823 bool operator ==(const Value& other) const
824 noexcept
825 {
826 return (
828 other.time());
829 }
830
832 ONIXS_B3_UMDF_MD_NODISCARD
833 bool operator !=(const Value& other) const
834 noexcept
835 {
836 return !(*this == other);
837 }
838
840 constexpr
841 operator Value() const
842 noexcept
843 {
844 return Value();
845 }
846
848 constexpr
849 Value operator()() const
850 noexcept
851 {
852 return Value();
853 }
854
856 constexpr
857 static Value value()
858 noexcept
859 {
860 return Value();
861 }
862};
863
864
869{
870public:
872 enum { Size = 5 };
873
875 typedef UInt16 Year;
876
878 typedef
881
883 typedef UInt8 Month;
884
886 typedef
889
891 typedef UInt8 Day;
892
894 typedef
897
899 typedef UInt8 Week;
900
902 typedef
905
909 constexpr
912 : year_(NullYear::value()),
913 month_(NullMonth::value()),
914 day_(NullDay::value()),
915 week_(NullWeek::value())
916 {
917 }
918
920 constexpr
922 Year year,
923 Month month,
924 Day day,
925 Week week)
927 : year_(year),
928 month_(month),
929 day_(day),
930 week_(week)
931 {
932 }
933
935 ONIXS_B3_UMDF_MD_NODISCARD
936 std::string
937 toString() const;
938
941 struct MemberTraits
942 {
943 enum { Count = 4 };
944
945 typedef Year FirstArgType;
946
947 typedef Month SecondArgType;
948
949 typedef Day ThirdArgType;
950
951 typedef Week FourthArgType;
952 };
953
955 ONIXS_B3_UMDF_MD_NODISCARD
956 Year year() const
958 {
959 return year_;
960 }
961
963 ONIXS_B3_UMDF_MD_NODISCARD
964 bool month(Month& value) const
965 noexcept
966 {
967 value = month_;
968 return NullMonth() != month_;
969 }
970
972 ONIXS_B3_UMDF_MD_NODISCARD
973 bool day(Day& value) const
974 noexcept
975 {
976 value = day_;
977 return NullDay() != day_;
978 }
979
981 ONIXS_B3_UMDF_MD_NODISCARD
982 bool week(Week& value) const
983 noexcept
984 {
985 value = week_;
986 return NullWeek() != week_;
987 }
988
990 ONIXS_B3_UMDF_MD_NODISCARD
991 bool
993 const MaturityMonthYear& other) const
994 noexcept ;
995
997 ONIXS_B3_UMDF_MD_NODISCARD
998 bool
999 operator!=(
1000 const MaturityMonthYear& other) const
1001 noexcept
1002 {
1003 return !(*this == other);
1004 }
1005
1006private:
1007 Year year_;
1011};
1012
1013
1016{
1020
1022 ONIXS_B3_UMDF_MD_NODISCARD
1023 bool operator ==(const Value& other) const
1024 noexcept
1025 {
1026 return (
1028 other.year());
1029 }
1030
1032 ONIXS_B3_UMDF_MD_NODISCARD
1033 bool operator !=(const Value& other) const
1034 noexcept
1035 {
1036 return !(*this == other);
1037 }
1038
1040 constexpr
1041 operator Value() const
1042 noexcept
1043 {
1044 return Value();
1045 }
1046
1048 constexpr
1049 Value operator()() const
1050 noexcept
1051 {
1052 return Value();
1053 }
1054
1056 constexpr
1057 static Value value()
1058 noexcept
1059 {
1060 return Value();
1061 }
1062};
1063
1064inline
1065bool
1066MaturityMonthYear::operator==(
1067 const MaturityMonthYear& other) const
1068 noexcept
1069{
1070 if((NullMaturityMonthYear() == *this) &&
1071 (NullMaturityMonthYear() == other))
1072 return true;
1073
1074 return
1075 (this->year_ == other.year_) &&
1076 (this->month_ == other.month_) &&
1077 (this->day_ == other.day_) &&
1078 (this->week_ == other.week_);
1079}
1080
#define ONIXS_B3_UMDF_MD_MESSAGING_NAMESPACE_END
Definition ABI.h:158
#define ONIXS_B3_UMDF_MD_LTWT_STRUCT
Definition ABI.h:93
#define ONIXS_B3_UMDF_MD_MESSAGING_NAMESPACE_BEGIN
Definition ABI.h:153
#define ONIXS_B3_UMDF_MD_LTWT_CLASS
Definition ABI.h:90
UInt8 NumInGroup
A counter representing the number of entries in a repeating group.
Definition Composites.h:108
Week, month and year of the maturity (used for standardized futures and options).
Definition Composites.h:869
constexpr MaturityMonthYear() noexcept
Default constructor.
Definition Composites.h:910
IntegralConstant< UInt16, 0 > NullYear
Null value for an optional Year field.
Definition Composites.h:880
IntegralConstant< UInt8, 0 > NullMonth
Null value for an optional Month field.
Definition Composites.h:888
IntegralConstant< UInt8, 0 > NullDay
Null value for an optional Day field.
Definition Composites.h:896
constexpr MaturityMonthYear(Year year, Month month, Day day, Week week) noexcept
Initializes fields with provided values.
Definition Composites.h:921
IntegralConstant< UInt8, 0 > NullWeek
Null value for an optional Week field.
Definition Composites.h:904
Message identifiers and length of message root.
Definition Composites.h:38
A nullable real number with a constant exponent.
Definition Decimal.h:119
UTC timestamp with nanosecond precision (Unix Epoch).
Definition Composites.h:615
UInt64 Time
UTC timestamp with nanosecond precision (Unix Epoch).
Definition Composites.h:621
IntegralConstant< UInt8, TimeUnit::NANOSECOND > Unit
time unit (nanoseconds).
Definition Composites.h:631
IntegralConstant< UInt64, 0ULL > NullTime
Null value for an optional Time field.
Definition Composites.h:626
constexpr UTCTimestampNanos() noexcept
Default constructor.
Definition Composites.h:637
constexpr UTCTimestampNanos(Time time) noexcept
Initializes fields with provided values.
Definition Composites.h:646
UTC timestamp with second precision (Unix Epoch).
Definition Composites.h:742
constexpr UTCTimestampSeconds() noexcept
Default constructor.
Definition Composites.h:764
IntegralConstant< UInt8, TimeUnit::SECOND > Unit
time unit (seconds).
Definition Composites.h:758
IntegralConstant< Int64, -9223372036854775807LL-1 > NullTime
Null value for an optional Time field.
Definition Composites.h:753
Int64 Time
UTC timestamp with second precision (Unix Epoch).
Definition Composites.h:748
constexpr UTCTimestampSeconds(Time time) noexcept
Initializes fields with provided values.
Definition Composites.h:773
FixedPointDecimal< Int64, IntegralConstant< Int8, -4 > > Percentage
Optional percentage (4 decimal places).
Definition Composites.h:237
Int8 Int8
1-byte signed integer, from -128 to 127; if optional, null value is -128.
Definition Fields.h:34
FixedPointDecimal< Int64, IntegralConstant< Int8, -8 > > Price8
Price (8 decimal places).
Definition Composites.h:439
Int64 Int64
8-byte signed integer, from -9223372036854775808 (-2^63) to 9223372036854775807 (2^63-1).
Definition Fields.h:46
FixedPointDecimal< Int64, IntegralConstant< Int8, -8 > > Fixed8
Optional decimal with constant exponent -8.
Definition Composites.h:371
UInt64 UInt64
8-byte unsigned integer, from 0 to 18446744073709551615 (2^64-1).
Definition Fields.h:62
FixedPointDecimal< Int64, IntegralConstant< Int8, -7 > > RatioQty
Ratio of quantity relative to the whole thing.
Definition Composites.h:305
FixedPointDecimal< Int64, IntegralConstant< Int8, -4 > > Price
Price (4 decimal places).
Definition Composites.h:148
char Char
Character type alias.
Definition String.h:30
FixedPointDecimal< Int64, IntegralConstant< Int8, -8 > > PriceOffset8Optional
Price Offset (8 decimal places).
Definition Composites.h:450
NullableFixedPointDecimal< Int64, IntegralConstant< Int8, -4 >, IntegralConstant< Int64, -9223372036854775807LL-1 > > PriceOptional
Optional price (4 decimal places).
Definition Composites.h:160
UInt8 UInt8
1-byte unsigned integer, from 0 to 255.
Definition Fields.h:50
UInt16 UInt16
2-byte unsigned integer, from 0 to 65535.
Definition Fields.h:54
Messaging::Int8 Int8
Definition Integral.h:30
bool operator==(const TimeSpan &left, const TimeSpan &right)
Compares with other instance for equality.
Definition Time.h:327
Messaging::Int64 Int64
Definition Integral.h:39
Null values definition for optional Fixed8 field.
Definition Composites.h:375
IntegralConstant< Int64, -9223372036854775807LL-1 > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:383
Fixed8 Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:378
Null values definition for optional MaturityMonthYear field.
MaturityMonthYear Value
Aliases the type whose null value traits are exposed by the given class.
Null values definition for optional Percentage field.
Definition Composites.h:241
IntegralConstant< Int64, 0LL > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:249
Percentage Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:244
Null values definition for optional PriceOffset8Optional field.
Definition Composites.h:454
IntegralConstant< Int64, -9223372036854775807LL-1 > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:462
PriceOffset8Optional Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:457
Null values definition for optional PriceOptional field.
Definition Composites.h:164
IntegralConstant< Int64, -9223372036854775807LL-1 > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:172
PriceOptional Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:167
Null values definition for optional RatioQty field.
Definition Composites.h:309
IntegralConstant< Int64, -9223372036854775807LL-1 > NullMantissa
Null value for an optional Mantissa field.
Definition Composites.h:317
RatioQty Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:312
Null values definition for optional UTCTimestampNanos field.
Definition Composites.h:689
UTCTimestampNanos Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:692
Null values definition for optional UTCTimestampSeconds field.
Definition Composites.h:816
UTCTimestampSeconds Value
Aliases the type whose null value traits are exposed by the given class.
Definition Composites.h:819
Identifies months in year.
Definition Time.h:444