OnixS C++ CME MDP Streamlined Market Data Handler 1.2.0
API Documentation
Loading...
Searching...
No Matches
BinaryMessage.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
23#include <cassert>
24#include <stdexcept>
25
28
31
33
38template
39<
40 class Block,
41 class BlockSize
42>
44{
47 const Block& block() const
48 {
49 return *static_cast<const Block*>(this);
50 }
51
52protected:
55 {
56 }
57
60 {
61 }
62
64 template
65 <
66 class FieldValue
67 >
68 const
69 FieldValue&
71 BlockSize offset) const
72 {
73 assert(
74 block().bodySize() >=
75 (offset + sizeof(FieldValue)));
76
77 const void*
78 const fieldValue =
80 block().body(),
81 offset);
82
83 return
84 *static_cast
85 <const FieldValue*>
86 (fieldValue);
87 }
88
95 template
96 <
97 class FieldValue,
98 class NullValue
99 >
100 bool
102 FieldValue& value,
103 BlockSize offset,
104 const NullValue& null) const
105 {
106 const FieldValue& fieldValue =
107 ordinary<FieldValue>(offset);
108
109 if (null != fieldValue)
110 {
111 value = fieldValue;
112
113 return true;
114 }
115
116 return false;
117 }
118
121 template
122 <
123 class Value
124 >
125 Decimal
126 decimal(BlockSize offset) const
127 {
128 return Decimal
129 (
130 ordinary<Value>(offset)
131 );
132 }
133
141 template
142 <
143 class NullValue
144 >
145 bool
147 Decimal& value,
148 BlockSize offset,
149 const NullValue& null) const
150 {
151 typedef
152 typename
153 NullValue::Value
154 Value;
155
156 const Value& optional =
157 ordinary<Value>(offset);
158
159 if (null != optional)
160 {
161 value = optional;
162
163 return true;
164 }
165
166 return false;
167 }
168
169
182 template
183 <
184 class FieldValue,
185 class NullValue
186 >
187 bool
189 FieldValue& value,
190 BlockSize offset,
191 const NullValue& null,
192 SchemaVersion since) const
193 {
194 return (
195 since <= block().version()
196 &&
197 ordinary(value, offset, null)
198 );
199 }
200
201
206 template
207 <
208 class Enumeration
209 >
210 typename
211 Enumeration::Enum
213 BlockSize offset) const
214 {
215 typedef
216 typename
217 Enumeration::Base
218 Base;
219
220 typedef
221 typename
222 Enumeration::Enum
223 Enum;
224
225 return
226 static_cast<Enum>(
227 ordinary<Base>(offset));
228 }
229
235 template
236 <
237 class Enumeration,
238 class NullValue
239 >
240 bool
242 typename
243 Enumeration::Enum& value,
244 BlockSize offset,
245 const NullValue& null) const
246 {
247 typedef
248 typename
249 Enumeration::Base
250 Base;
251
252 typedef
253 typename
254 Enumeration::Enum
255 Enum;
256
257 const Base& fieldValue =
258 ordinary<Base>(offset);
259
260 if (null != fieldValue)
261 {
262 value = static_cast<Enum>(fieldValue);
263
264 return true;
265 }
266
267 return false;
268 }
269
275 template
276 <
277 class Enumeration,
278 class NullValue
279 >
280 bool
282 typename
283 Enumeration::Enum& value,
284 BlockSize offset,
285 const NullValue& null,
286 SchemaVersion since) const
287 {
288 return (
289 since <= block().version()
290 &&
291 enumeration(value, offset, null)
292 );
293 }
294
299 template
300 <
301 BlockSize Size
302 >
303 StrRef
305 BlockSize offset) const
306 {
307 typedef Char Str[Size];
308
309 const Str& str =
310 ordinary<Str>(offset);
311
312 return
313 StrRef
314 (
315 str,
316 strnlen(str, Size)
317 );
318 }
319
325 template
326 <
327 BlockSize Size
328 >
329 StrRef
331 BlockSize offset,
332 SchemaVersion since) const
333 {
334 return (
335 since >=
336 block().version()
337
338 ? fixedStr<Size>(offset)
339 : StrRef()
340 );
341 }
342
348 template
349 <
350 BlockSize Size
351 >
352 bool
354 StrRef& value,
355 BlockSize offset) const
356 {
357 typedef Char Str[Size];
358
359 const Str& str =
360 ordinary<Str>(offset);
361
362 if (str[0])
363 {
364 value = fixedStr<Size>(offset);
365 return true;
366 }
367 else
368 {
369 return false;
370 }
371 }
372};
373
376void
378 const Char* className);
379
382void
384
386template
387<
388 class EntryType,
389 class DimensionType,
390 class GroupSizeType
391>
393{
394public:
396 typedef EntryType Entry;
397
399 typedef DimensionType Dimension;
400
402 typedef GroupSizeType BinarySize;
403
405 typedef
406 typename
407 DimensionType::BlockLength
409
410
412 typedef
413 typename
414 Dimension::NumInGroup
416
420 {
421 const void* entry_;
422 EntrySize size_;
423
424 SchemaVersion version_;
425
426 public:
428 typedef EntryType Entry;
429
431 typedef const Entry value_type;
432
434 typedef const Entry* pointer;
435
437 typedef const Entry& reference;
438
440 typedef ptrdiff_t difference_type;
441
443 typedef
444 std::random_access_iterator_tag
446
450 , size_(0)
451 , version_(0)
452 {
453 }
454
457 const void* entry,
459 SchemaVersion version)
460 : entry_(entry)
461 , size_(size)
462 , version_(version)
463 {
464 }
465
468 const Iterator& other)
469 : entry_(
470 other.entry_)
471 , size_(
472 other.size_)
473 , version_(
474 other.version_)
475 {
476 }
477
479 const Entry get() const
480 {
481 assert(ONIXS_CMESTREAMLINEDMDH_NULLPTR != entry_);
482
483 return
484 Entry(
485 entry_,
486 size_,
487 version_);
488 }
489
491 const Entry operator *() const
492 {
493 return get();
494 }
495
497 bool
498 operator ==(
499 const Iterator& other) const
500 {
501 return entry_ == other.entry_;
502 }
503
505 bool
506 operator !=(
507 const Iterator& other) const
508 {
509 return entry_ != other.entry_;
510 }
511
513 bool
514 operator <(
515 const Iterator& other) const
516 {
517 return entry_ < other.entry_;
518 }
519
521 bool
522 operator >(
523 const Iterator& other) const
524 {
525 return entry_ > other.entry_;
526 }
527
529 Iterator&
530 operator ++()
531 {
532 entry_ =
534 entry_, size_);
535
536 return *this;
537 }
538
540 Iterator&
541 operator --()
542 {
543 entry_ =
545 entry_,
546 size_);
547
548 return *this;
549 }
550
552 Iterator
553 operator +(
554 difference_type distance) const
555 {
556 return
557 Iterator(
559 entry_,
560 distance * size_),
561 size_,
562 version_);
563 }
564
566 Iterator
567 operator -(
568 difference_type distance) const
569 {
570 return
571 Iterator(
573 entry_,
574 distance * size_),
575 size_,
576 version_);
577 }
578
580 Iterator&
581 operator =(
582 const Iterator& other)
583 {
584 entry_ = other.entry_;
585 size_ = other.size_;
586
587 version_ = other.version_;
588
589 return *this;
590 }
591 };
592
596 , entrySize_(0)
597 , entryCount_(0)
598 , version_(0)
599 , size_(0)
600 {
601 }
602
606 const void* data,
608 SchemaVersion version)
609 : entries_(
611 data,
612 Dimension::Size))
613 , entrySize_(0)
614 , entryCount_(0)
615 , version_(version)
616 , size_(Dimension::Size)
617 {
618 if (size < size_)
620
621 const
622 Dimension*
623 group =
624 static_cast
625 <const Dimension*>
626 (data);
627
628 entrySize_ =
629 group->blockLength();
630
631 entryCount_ =
632 group->numInGroup();
633
634 size_ +=
635 (
636 static_cast
637 <BinarySize>
638 (entrySize_) *
639 static_cast
640 <BinarySize>
641 (entryCount_)
642 );
643
644 if (size < size_)
646 }
647
650 const BinaryGroup& other)
651 : entries_(
652 other.entries_)
653 , entrySize_(
654 other.entrySize_)
655 , entryCount_(
656 other.entryCount_)
657 , version_(
658 other.version_)
659 , size_(
660 other.size_)
661 {
662 }
663
666 operator bool() const
667 {
668 return (ONIXS_CMESTREAMLINEDMDH_NULLPTR != entries_);
669 }
670
673 bool empty() const
674 {
675 return 0 == size();
676 }
677
680 Size size() const
681 {
682 return entryCount_;
683 }
684
686 Iterator begin() const
687 {
688 return
689 Iterator(
690 entries_,
691 entrySize_,
692 version_);
693 }
694
696 Iterator end() const
697 {
698 return
699 Iterator(
701 binary(),
702 binarySize()),
703 entrySize_,
704 version_);
705 }
706
709 Entry operator [](Size index) const
710 {
711 assert(index < size());
712
713 return
714 Entry(
716 entries(),
717 index * entrySize_),
718 entrySize_,
719 version_);
720 }
721
723 const void* binary() const
724 {
725 return
726 entries_
728 entries_, Dimension::Size)
730 }
731
734 {
735 return size_;
736 }
737
739 const void* entries() const
740 {
741 return entries_;
742 }
743
746 {
747 return entrySize_;
748 }
749
752 operator =(
753 const BinaryGroup& other)
754 {
755 entries_ = other.entries_;
756
757 entrySize_ = other.entrySize_;
758 entryCount_ = other.entryCount_;
759
760 version_ = other.version_;
761 size_ = other.size_;
762
763 return *this;
764 }
765
766private:
767 const void* entries_;
768
769 EntrySize entrySize_;
770 Size entryCount_;
771
772 SchemaVersion version_;
773 BinarySize size_;
774};
775
777template
778<
779 class EntryType,
780 class DimensionType,
781 class GroupSizeType
782>
784{
785public:
787 typedef EntryType Entry;
788
790 typedef DimensionType Dimension;
791
793 typedef GroupSizeType BinarySize;
794
796 typedef
797 typename
798 DimensionType::BlockLength
800
801
803 typedef
804 typename
805 Dimension::NumInGroup
807
811 {
812 const void* entry_;
813 EntrySize size_;
814
815 SchemaVersion version_;
816
817 public:
819 typedef EntryType Entry;
820
822 typedef const Entry value_type;
823
825 typedef const Entry* pointer;
826
828 typedef const Entry& reference;
829
831 typedef ptrdiff_t difference_type;
832
834 typedef
835 std::forward_iterator_tag
837
841 , size_(0)
842 , version_(0)
843 {
844 }
845
848 const void* entry,
850 SchemaVersion version)
851 : entry_(entry)
852 , size_(size)
853 , version_(version)
854 {
855 }
856
859 const Iterator& other)
860 : entry_(
861 other.entry_)
862 , size_(
863 other.size_)
864 , version_(
865 other.version_)
866 {
867 }
868
870 const Entry get() const
871 {
872 assert(ONIXS_CMESTREAMLINEDMDH_NULLPTR != entry_);
873
874 return
875 Entry(
876 entry_,
877 size_,
878 version_);
879 }
880
882 const Entry operator *() const
883 {
884 return get();
885 }
886
888 bool
889 operator ==(
890 const Iterator& other) const
891 {
892 return entry_ == other.entry_;
893 }
894
896 bool
897 operator !=(
898 const Iterator& other) const
899 {
900 return entry_ != other.entry_;
901 }
902
904 bool
905 operator <(
906 const Iterator& other) const
907 {
908 return entry_ < other.entry_;
909 }
910
912 bool
913 operator >(
914 const Iterator& other) const
915 {
916 return entry_ > other.entry_;
917 }
918
920 Iterator&
921 operator ++()
922 {
923 advance(1);
924 return *this;
925 }
926
929 operator +(
930 difference_type distance) const
931 {
932 Iterator result(*this);
933 result.advance(distance);
934 return result;
935 }
936
938 Iterator&
939 operator =(
940 const Iterator& other)
941 {
942 entry_ = other.entry_;
943 size_ = other.size_;
944
945 version_ = other.version_;
946
947 return *this;
948 }
949 private:
950 void advance(difference_type count)
951 {
952 const void* rawEntry = entry_;
953 for (difference_type i = 0; i < count; ++i)
954 {
955 // Query the last position of last repeating group at the entry.
956 // Here we need to has EntryType::next() method.
957 Entry e(rawEntry, size_, version_);
958 // Move entry over nested groups
959 rawEntry = e.next(version_).body();
960 }
961 entry_ = rawEntry;
962 }
963 };
964
968 , entrySize_(0)
969 , entryCount_(0)
970 , version_(0)
971 , size_(0)
972 {
973 }
974
978 const void* data,
980 SchemaVersion version)
981 : entries_(
983 data,
984 Dimension::Size))
985 , entrySize_(0)
986 , entryCount_(0)
987 , version_(version)
988 , size_(Dimension::Size)
989 {
990 if (size < size_)
992
993 const
994 Dimension*
995 group =
996 static_cast
997 <const Dimension*>
998 (data);
999
1000 entrySize_ =
1001 group->blockLength();
1002
1003 entryCount_ =
1004 group->numInGroup();
1005
1006 size_ += (static_cast<BinarySize>(entrySize_) * static_cast<BinarySize>(entryCount_));
1007
1008 if (size < size_)
1010 }
1011
1014 const BinaryGroupWithNested& other)
1015 : entries_(
1016 other.entries_)
1017 , entrySize_(
1018 other.entrySize_)
1019 , entryCount_(
1020 other.entryCount_)
1021 , version_(
1022 other.version_)
1023 , size_(
1024 other.size_)
1025 {
1026 }
1027
1030 operator bool() const
1031 {
1032 return (ONIXS_CMESTREAMLINEDMDH_NULLPTR != entries_);
1033 }
1034
1037 bool empty() const
1038 {
1039 return 0 == size();
1040 }
1041
1044 Size size() const
1045 {
1046 return entryCount_;
1047 }
1048
1050 Iterator begin() const
1051 {
1052 return
1053 Iterator(
1054 entries_,
1055 entrySize_,
1056 version_);
1057 }
1058
1060 Iterator end() const
1061 {
1062 return begin() + size();
1063 }
1064
1066 const void* binary() const
1067 {
1068 return
1069 entries_
1071 entries_, Dimension::Size)
1073 }
1074
1077 {
1078 return size_;
1079 }
1080
1082 const void* entries() const
1083 {
1084 return entries_;
1085 }
1086
1089 {
1090 return entrySize_;
1091 }
1092
1095 operator =(
1096 const BinaryGroupWithNested& other)
1097 {
1098 entries_ = other.entries_;
1099
1100 entrySize_ = other.entrySize_;
1101 entryCount_ = other.entryCount_;
1102
1103 version_ = other.version_;
1104 size_ = other.size_;
1105
1106 return *this;
1107 }
1108
1109private:
1110 const void* entries_;
1111
1112 EntrySize entrySize_;
1113 Size entryCount_;
1114
1115 SchemaVersion version_;
1116 BinarySize size_;
1117};
1118
1121template
1122<
1123 class BinarySize
1124>
1126{
1127 const void* binary_;
1128 BinarySize size_;
1129 SchemaVersion version_;
1130
1131public:
1135 , size_(0)
1136 , version_(0)
1137 {
1138 }
1139
1143 const void* binary,
1144 BinarySize size,
1145 SchemaVersion version)
1146 : binary_(binary)
1147 , size_(size)
1148 , version_(version)
1149 {
1150 }
1151
1154 const BinaryGroupList& other)
1155 : binary_(
1156 other.binary_)
1157 , size_(
1158 other.size_)
1159 , version_(
1160 other.version_)
1161 {
1162 }
1163
1165 bool empty() const
1166 {
1167 return (0 == size_);
1168 }
1169
1171 template
1172 <
1173 class Group
1174 >
1175 Group head() const
1176 {
1177 return
1178 Group(
1179 binary_,
1180 size_,
1181 version_);
1182 }
1183
1185 template
1186 <
1187 class Group
1188 >
1190 {
1191 const
1192 BinarySize
1193 headSize =
1194 head<Group>().
1195 binarySize();
1196
1197 assert(headSize <= size_);
1198
1199 // TODO: Move the calculation to the group itslef,
1200 // to support nested groups.
1201 return
1204 binary_, headSize),
1205 size_ - headSize,
1206 version_);
1207 }
1208
1210 const void* binary() const
1211 {
1212 return binary_;
1213 }
1214
1216 BinarySize binarySize() const
1217 {
1218 return size_;
1219 }
1220
1223 operator =(
1224 const BinaryGroupList& other)
1225 {
1226 binary_ = other.binary_;
1227 size_ = other.size_;
1228
1229 version_ = other.version_;
1230
1231 return *this;
1232 }
1233};
1234
1235
1236
1237
1239inline
1240void
1242{
1243 throw std::runtime_error(
1244 "Cannot construct message instance. Memory "
1245 "block is too small to access SBE message header. ");
1246}
1247
1250
1253
1257
1260template
1261<
1262 class BodySizeType
1263>
1264class
1266 : public BinaryFields
1267 <
1269 <
1270 BodySizeType
1271 >,
1272 BodySizeType
1273 >
1274{
1275 const void* body_;
1276 BodySizeType size_;
1277
1278 SchemaVersion version_;
1279
1280protected:
1282 typedef
1285
1289 {
1290 const void*
1291 const list =
1293 body(), bodySize());
1294
1295 //const
1296 // MessageSize
1297 // listSize =
1298 // size_ - entrySize;
1299
1300 return
1301 GroupList(
1302 list,
1303 10000,
1304 version_);
1305 }
1306
1307public:
1310 typedef
1311 BodySizeType
1313
1317 , size_(0)
1318 , version_(0)
1319 {
1320 }
1321
1325 const void* body,
1326 BodySize size,
1328 : body_(body)
1329 , size_(size)
1330 , version_(version)
1331 {
1333
1334 assert(
1335 version >=
1336 SchemaTraits::
1337 minimalVersion());
1338 }
1339
1342 const BinaryGroupEntry& other)
1343 : body_(
1344 other.body_)
1345 , size_(
1346 other.size_)
1347 , version_(
1348 other.version_)
1349 {
1350 }
1351
1353 operator bool() const
1354 {
1355 return (ONIXS_CMESTREAMLINEDMDH_NULLPTR != body_);
1356 }
1357
1359 const void* body() const
1360 {
1361 return body_;
1362 }
1363
1366 {
1367 return size_;
1368 }
1369
1373 {
1374 return version_;
1375 }
1376
1379 operator =(
1380 const BinaryGroupEntry& other)
1381 {
1382 body_ = other.body_;
1383 size_ = other.size_;
1384
1385 version_ = other.version_;
1386
1387 return *this;
1388 }
1389};
1390
1391
1394void
1396 SchemaVersion messageVersion);
1397
1399typedef
1402
1406: public BinaryFields
1407<
1410>
1411{
1412 const MessageHeader* header_;
1413 MessageSize size_;
1414
1415protected:
1417 typedef
1420
1424 {
1425 assert(ONIXS_CMESTREAMLINEDMDH_NULLPTR != header_);
1426
1427 const void*
1428 const list =
1430 body(), bodySize());
1431
1432 const
1434 listSize =
1435 size_ -
1437 header_->blockLength();
1438
1439 return
1440 GroupList(
1441 list,
1442 listSize,
1443 header_->version());
1444 }
1445
1446public:
1449
1451 typedef
1454
1458 , size_(0)
1459 {
1460 }
1461
1464 const void* data,
1465 MessageSize size)
1466 : header_(
1467 static_cast
1468 <const MessageHeader*>
1469 (data))
1470 , size_(size)
1471 {
1472 assert(ONIXS_CMESTREAMLINEDMDH_NULLPTR != data);
1473
1474 if (size <
1476 ||
1477 size <
1479 header_->blockLength()))
1480 {
1482 }
1483
1484 const
1486 version = this->version();
1487
1488 if (version <
1490 {
1492 }
1493 }
1494
1497 const BinaryMessage& other)
1498 : header_(other.header_)
1499 , size_(other.size_)
1500 {
1501 }
1502
1504 operator bool() const
1505 {
1506 return (ONIXS_CMESTREAMLINEDMDH_NULLPTR != header_);
1507 }
1508
1511 {
1512 assert(ONIXS_CMESTREAMLINEDMDH_NULLPTR != header_);
1513
1514 return header_->templateId();
1515 }
1516
1519 {
1520 assert(ONIXS_CMESTREAMLINEDMDH_NULLPTR != header_);
1521
1522 return header_->version();
1523 }
1524
1526 const void* binary() const
1527 {
1528 return header_;
1529 }
1530
1533 {
1534 return size_;
1535 }
1536
1538 const void* body() const
1539 {
1540 assert(ONIXS_CMESTREAMLINEDMDH_NULLPTR != header_);
1541
1542 return
1544 header_,
1546 }
1547
1550 {
1551 assert(ONIXS_CMESTREAMLINEDMDH_NULLPTR != header_);
1552
1553 return header_->blockLength();
1554 }
1555
1558 operator =(
1559 const BinaryMessage& other)
1560 {
1561 header_ = other.header_;
1562 size_ = other.size_;
1563
1564 return *this;
1565 }
1566};
1567
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:169
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
Definition Bootstrap.h:173
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
Definition Bootstrap.h:111
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED
Definition Compiler.h:160
#define ONIXS_CMESTREAMLINEDMDH_NULLPTR
Definition Compiler.h:167
Decimal decimal(BlockSize offset) const
Returns value of a field by its offset converted into a decimal.
bool enumeration(typename Enumeration::Enum &value, BlockSize offset, const NullValue &null) const
Provides access to value of an optional field by its offset.
StrRef fixedStr(BlockSize offset, SchemaVersion since) const
Provides access to an optional field of string type by its offset.
bool ordinary(FieldValue &value, BlockSize offset, const NullValue &null) const
Provides access to a value of an optional field by its offset.
bool decimal(Decimal &value, BlockSize offset, const NullValue &null) const
Provides access to a value of an optional field by its offset.
Enumeration::Enum enumeration(BlockSize offset) const
Returns value of a field by its offset.
StrRef fixedStr(BlockSize offset) const
Provides access to string field by its offset.
BinaryFields()
Initializes blank instance.
const FieldValue & ordinary(BlockSize offset) const
Returns value of a field by its offset.
bool fixedStr(StrRef &value, BlockSize offset) const
Provides access to an optional field of string type by its offset.
bool enumeration(typename Enumeration::Enum &value, BlockSize offset, const NullValue &null, SchemaVersion since) const
Provides access to value of an optional field by its offset.
bool ordinary(FieldValue &value, BlockSize offset, const NullValue &null, SchemaVersion since) const
Provides access to a value of an optional field by its offset.
Encapsulates operations over SBE-encoded repeating group entry instance.
BinaryGroupEntry(const void *body, BodySize size, SchemaVersion version)
Initializes instance from memory block of given SBE-encoded message.
BinaryGroupEntry()
Initializes instance referring to nothing.
BinaryGroupList< MessageSize > GroupList
Binary group list instantiation.
GroupList groups() const
Returns list of repeating groups of a entry being referenced.
BinaryGroupEntry(const BinaryGroupEntry &other)
Initializes instance as a copy of the other one.
BodySizeType BodySize
Type to present length of binary data of given repeating group entry.
Encapsulates services for manipulating SBE-encoded groups stored sequentially in SBE-encoded message.
Group head() const
Provides access to the head group of the list.
BinaryGroupList tail() const
Returns list of groups following the head.
bool empty() const
Indicates whether group list is empty.
BinaryGroupList(const BinaryGroupList &other)
Initializes as copy of other list.
BinaryGroupList(const void *binary, BinarySize size, SchemaVersion version)
Initializes list over memory block, where given message is stored.
Provides iterating facilities over SBE-encoded group entries.
Iterator(const void *entry, EntrySize size, SchemaVersion version)
Initializes instance for given repeating group.
const Entry * pointer
Aliases pointer to entry for STL conformance.
Iterator()
Initializes instance referring to nothing.
std::forward_iterator_tag iterator_category
Identifies iterator category.
Iterator(const Iterator &other)
Initializes instance as copy of the other one.
EntryType Entry
Aliases type of object referenced by iterator.
const Entry & reference
Aliases entry reference for STL conformance.
const Entry value_type
Aliases entry for STL conformance.
const Entry get() const
Repeating group entry referenced by the instance.
Encapsulates operations over SBE-encoded repeating group.
const void * binary() const
SBE-encoded data representing repeating group.
BinarySize binarySize() const
Size of SBE-encoded data representing repeating group.
Iterator begin() const
Returns iterator pointing to the first repeating group entry.
Dimension::NumInGroup Size
Size of group (number of entries).
GroupSizeType BinarySize
Length of group data.
DimensionType::BlockLength EntrySize
Length of group entry data.
EntryType Entry
Aliases type of repeating group entry.
const void * entries() const
Location of repeating group entries.
Iterator end() const
Returns iterator pointing to the entry behind the end of the group.
bool empty() const
Indicates whether a repeating group being referenced is empty.
BinaryGroupWithNested(const void *data, BinarySize size, SchemaVersion version)
Initializes instance referencing to a valid group of a given message.
EntrySize entrySize() const
Size in bytes of single repeating group entry.
BinaryGroupWithNested(const BinaryGroupWithNested &other)
Initializes instance as a copy of the other one.
DimensionType Dimension
Aliases repeating group dimension type.
Size size() const
Returns number of entries in a repeating group being referenced.
BinaryGroupWithNested()
Initializes blank instance referencing to nothing.
Provides iterating facilities over SBE-encoded group entries.
Iterator(const void *entry, EntrySize size, SchemaVersion version)
Initializes instance for given repeating group.
const Entry * pointer
Aliases pointer to entry for STL conformance.
Iterator()
Initializes instance referring to nothing.
Iterator(const Iterator &other)
Initializes instance as copy of the other one.
EntryType Entry
Aliases type of object referenced by iterator.
const Entry & reference
Aliases entry reference for STL conformance.
const Entry value_type
Aliases entry for STL conformance.
std::random_access_iterator_tag iterator_category
Identifies iterator category.
const Entry get() const
Repeating group entry referenced by the instance.
ptrdiff_t difference_type
Iterator difference type.
Encapsulates operations over SBE-encoded repeating group.
Iterator begin() const
Returns iterator pointing to the first repeating group entry.
Dimension::NumInGroup Size
Size of group (number of entries).
GroupSizeType BinarySize
Length of group data.
DimensionType::BlockLength EntrySize
Length of group entry data.
EntryType Entry
Aliases type of repeating group entry.
Iterator end() const
Returns iterator pointing to the entry behind the end of the group.
BinaryGroup(const void *data, BinarySize size, SchemaVersion version)
Initializes instance referencing to a valid group of a given message.
bool empty() const
Indicates whether a repeating group being referenced is empty.
BinaryGroup(const BinaryGroup &other)
Initializes instance as a copy of the other one.
EntrySize entrySize() const
Size in bytes of single repeating group entry.
DimensionType Dimension
Aliases repeating group dimension type.
Size size() const
Returns number of entries in a repeating group being referenced.
BinaryGroup()
Initializes blank instance referencing to nothing.
Encapsulates services for manipulating SBE-encoded messages.
const void * binary() const
SBE-encoded message content.
BinaryMessage()
Initializes blank instance referencing to nothing.
MessageHeader::BlockLength BodySize
Length of message body without repeating groups.
const void * body() const
Indicates beginning of message body.
MessageSize BinarySize
Length of message binary data.
SchemaVersion version() const
Version of message being referenced.
BinaryMessage(const void *data, MessageSize size)
Initializes instance over given memory block.
MessageSize binarySize() const
Size of SBE-encoded message.
BinaryGroupList< MessageSize > GroupList
Binary group list instantiation.
GroupList groups() const
Returns list of repeating groups of a message being referenced.
MessageTemplateId templateId() const
Template identifier of message being referenced.
BodySize bodySize() const
Size of message body in bytes.
BinaryMessage(const BinaryMessage &other)
Initializes instance as copy of the other one.
A real number with floating exponent.
Definition Decimal.h:225
NumInGroup numInGroup() const
numInGroup field.
Definition Composites.h:394
BlockLength blockLength() const
blockLength field.
Definition Composites.h:388
Template ID and length of message root.
Definition Composites.h:455
Provides efficient way of accessing text-based FIX field values.
Definition String.h:40
Type * advanceByBytes(Type *pointer, ptrdiff_t distance)
Advances given pointer to a given offset (distance) in bytes.
Definition Memory.h:121
void throwBadBinaryData(const Char *className)
Throws exception on bad repeating group entry.
Type * advanceBackByBytes(Type *pointer, ptrdiff_t distance)
Returns pointer which is lower than given one to a given number of bytes.
Definition Memory.h:140
void throwBadMessageVersion(SchemaVersion messageVersion)
Raises exception on bad message version.
MessageSize EncodedLength
Length of message binary data.
MessageHeader::Version SchemaVersion
Aliases SBE-encoded data version type.
char Char
Character type alias.
Definition String.h:36
void throwBadBinaryGroup()
Throws exception on bad repeating group.
UInt16 MessageSize
Aliases message length type.
MessageSize BlockLength
Length of message body representing a block of fixed-length fields.
void throwBadBinaryMessage()
Raises exception on bad binary message.
MessageHeader::TemplateId MessageTemplateId
Aliases message type (template) identification.
Attributes of SBE message schema.
static SchemaVersion minimalVersion()
Returns minimal version supported by given SDK.