OnixS C++ CME Market Data Handler  4.8.0.10
API documentation
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 
26 #include <OnixS/CME/MDH/String.h>
27 #include <OnixS/CME/MDH/Memory.h>
28 
31 
33 
34 /// Exposes base services to access fields stored in
35 /// SBE-encoded block of memory. Class represents an
36 /// abstraction, instance construction available through
37 /// descendants implementing actual access to encoded data.
38 template
39 <
40  class Block,
41  class BlockSize
42 >
44 {
45  /// Instance of block providing
46  /// actual access to encoded data.
47  const Block& block() const
48  {
49  return *static_cast<const Block*>(this);
50  }
51 
52 protected:
53  /// Initializes blank instance.
55  {
56  }
57 
58  /// Cleans everything up.
60  {
61  }
62 
63  /// Returns value of a field by its offset.
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 
89  /// Provides access to a value of
90  /// an optional field by its offset.
91  ///
92  /// Returned result indicates whether field is
93  /// present in given field block and its value
94  /// was copied into a given parameter-variable.
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 
119  /// Provides access to a value of
120  /// an optional field by its offset.
121  ///
122  /// Returned result indicates whether field is
123  /// present in given field block and its value
124  /// was copied into a given parameter-variable.
125  ///
126  /// Field may not be present in earlier versions
127  /// of binary message and thus its value may not be
128  /// available. For this reason, parameter indicating
129  /// version of data assumed is required to access
130  /// the field.
131  template
132  <
133  class FieldValue,
134  class NullValue
135  >
136  bool
138  FieldValue& value,
139  BlockSize offset,
140  const NullValue& null,
141  SchemaVersion since) const
142  {
143  return (
144  since <= block().version()
145  &&
146  ordinary(value, offset, null)
147  );
148  }
149 
150  /// Returns value of a field by its offset.
151  ///
152  /// Given function serves as specialization of
153  /// general case for fields of enumeration type.
154  template
155  <
156  class Enumeration
157  >
158  typename
159  Enumeration::Enum
161  BlockSize offset) const
162  {
163  typedef
164  typename
165  Enumeration::Base
166  Base;
167 
168  typedef
169  typename
170  Enumeration::Enum
171  Enum;
172 
173  return
174  static_cast<Enum>(
175  ordinary<Base>(offset));
176  }
177 
178  /// Provides access to value of
179  /// an optional field by its offset.
180  ///
181  /// Given function serves as specialization of
182  /// general case for fields of enumeration type.
183  template
184  <
185  class Enumeration,
186  class NullValue
187  >
188  bool
190  typename
191  Enumeration::Enum& value,
192  BlockSize offset,
193  const NullValue& null) const
194  {
195  typedef
196  typename
197  Enumeration::Base
198  Base;
199 
200  typedef
201  typename
202  Enumeration::Enum
203  Enum;
204 
205  const Base& fieldValue =
206  ordinary<Base>(offset);
207 
208  if (null != fieldValue)
209  {
210  value = static_cast<Enum>(fieldValue);
211 
212  return true;
213  }
214 
215  return false;
216  }
217 
218  /// Provides access to value of
219  /// an optional field by its offset.
220  ///
221  /// Given function serves as specialization of
222  /// general case for fields of enumeration type.
223  template
224  <
225  class Enumeration,
226  class NullValue
227  >
228  bool
230  typename
231  Enumeration::Enum& value,
232  BlockSize offset,
233  const NullValue& null,
234  SchemaVersion since) const
235  {
236  return (
237  since <= block().version()
238  &&
239  enumeration(value, offset, null)
240  );
241  }
242 
243  /// Returns value of a field by its
244  /// offset converted into a decimal.
245  template
246  <
247  class FieldValue
248  >
249  Decimal
251  BlockSize offset) const
252  {
253  return Decimal
254  (
255  ordinary
256  <FieldValue>
257  (offset)
258  );
259  }
260 
261  /// Provides access to a value of
262  /// an optional field by its offset.
263  /// The result is converted into decimal.
264  ///
265  /// Returned result indicates whether field is
266  /// present in given field block and its value
267  /// was copied into a given parameter-variable.
268  template
269  <
270  class NullValue
271  >
272  bool
274  Decimal& value,
275  BlockSize offset,
276  const NullValue& null) const
277  {
278  typedef
279  typename
280  NullValue::Value
281  FieldValue;
282 
283  const FieldValue& fieldValue =
284  ordinary<FieldValue>(offset);
285 
286  if (null != fieldValue)
287  {
288  value = fieldValue;
289 
290  return true;
291  }
292 
293  return false;
294  }
295 
296  /// Provides access to a value of
297  /// an optional field by its offset.
298  /// The result is converted into decimal.
299  ///
300  /// Returned result indicates whether field is
301  /// present in given field block and its value
302  /// was copied into a given parameter-variable.
303  ///
304  /// Field may not be present in earlier versions
305  /// of binary message and thus its value may not be
306  /// available. For this reason, parameter indicating
307  /// version of data assumed is required to access
308  /// the field.
309  template
310  <
311  class NullValue
312  >
313  bool
315  Decimal& value,
316  BlockSize offset,
317  const NullValue& null,
318  SchemaVersion since) const
319  {
320  return (
321  since <= block().version()
322  &&
323  decimal(value, offset, null)
324  );
325  }
326 
327  /// Provides access to string field by its offset.
328  ///
329  /// Given function serves as specialization
330  /// of general case for fields of string type.
331  template
332  <
333  BlockSize Size
334  >
335  StrRef
337  BlockSize offset) const
338  {
339  typedef Char Str[Size];
340 
341  const Str& str =
342  ordinary<Str>(offset);
343 
344  return
345  StrRef
346  (
347  str,
348  strnlen(str, Size)
349  );
350  }
351 
352  /// Provides access to an optional
353  /// field of string type by its offset.
354  ///
355  /// Given function serves as specialization
356  /// of general case for fields of string type.
357  template
358  <
359  BlockSize Size
360  >
361  StrRef
363  BlockSize offset,
364  SchemaVersion since) const
365  {
366  return (
367  since >=
368  block().version()
369 
370  ? fixedStr<Size>(offset)
371  : StrRef()
372  );
373  }
374 };
375 
376 /// Throws exception on bad repeating group entry.
377 ONIXS_CMEMDH_EXPORTED
378 void
380  const Char* className);
381 
382 /// Encapsulates operations over SBE-encoded
383 /// repeating group entry instance.
384 template
385 <
386  class BodySizeType
387 >
388 class
390 : public BinaryFields
391 <
392  BinaryGroupEntry
393  <
394  BodySizeType
395  >,
396  BodySizeType
397 >
398 {
399  const void* body_;
400  BodySizeType size_;
401 
402  SchemaVersion version_;
403 
404 public:
405  /// Type to present length of binary
406  /// data of given repeating group entry.
407  typedef
408  BodySizeType
410 
411  /// Initializes instance referring to nothing.
413  : body_(NULL)
414  , size_(0)
415  , version_(0)
416  {
417  }
418 
419  /// Initializes instance from memory
420  /// block of given SBE-encoded message.
422  const void* body,
423  BodySize size,
424  SchemaVersion version)
425  : body_(body)
426  , size_(size)
427  , version_(version)
428  {
429  assert(NULL != body);
430 
431  assert(
432  version >=
433  SchemaTraits::
434  minimalVersion());
435  }
436 
437  /// Initializes instance as a copy of the other one.
439  const BinaryGroupEntry& other)
440  : body_(
441  other.body_)
442  , size_(
443  other.size_)
444  , version_(
445  other.version_)
446  {
447  }
448 
449  /// Indicates whether instance refers to a valid content.
450  operator bool() const
451  {
452  return (NULL != body_);
453  }
454 
455  /// Indicates beginning of group entry body.
456  const void* body() const
457  {
458  return body_;
459  }
460 
461  /// Indicates end of group entry body.
463  {
464  return size_;
465  }
466 
467  /// Version of message containing
468  /// given repeating group instance.
470  {
471  return version_;
472  }
473 
474  /// Re-initializes instance as a copy of the other one.
476  operator =(
477  const BinaryGroupEntry& other)
478  {
479  body_ = other.body_;
480  size_ = other.size_;
481 
482  version_ = other.version_;
483 
484  return *this;
485  }
486 };
487 
488 /// Throws exception on bad repeating group.
489 ONIXS_CMEMDH_EXPORTED
490 void
492 
493 /// Encapsulates operations over SBE-encoded repeating group.
494 template
495 <
496  class EntryType,
497  class DimensionType,
498  class GroupSizeType
499 >
501 {
502 public:
503  /// Aliases type of repeating group entry.
504  typedef EntryType Entry;
505 
506  /// Aliases repeating group dimension type.
507  typedef DimensionType Dimension;
508 
509  /// Length of group data.
510  typedef GroupSizeType BinarySize;
511 
512  /// Length of group entry data.
513  typedef
514  typename
515  DimensionType::BlockLength
517 
518 
519  /// Size of group (number of entries).
520  typedef
521  typename
522  Dimension::NumInGroup
524 
525  /// Provides iterating facilities
526  /// over SBE-encoded group entries.
527  class Iterator
528  {
529  const void* entry_;
530  EntrySize size_;
531 
532  SchemaVersion version_;
533 
534  public:
535  /// Aliases type of object referenced by iterator.
536  typedef EntryType Entry;
537 
538  /// Aliases entry for STL conformance.
539  typedef const Entry value_type;
540 
541  /// Aliases pointer to entry for STL conformance.
542  typedef const Entry* pointer;
543 
544  /// Aliases entry reference for STL conformance.
545  typedef const Entry& reference;
546 
547  /// Iterator difference type.
548  typedef ptrdiff_t difference_type;
549 
550  /// Identifies iterator category.
551  typedef
552  std::random_access_iterator_tag
554 
555  /// Initializes instance referring to nothing.
557  : entry_(NULL)
558  , size_(0)
559  , version_(0)
560  {
561  }
562 
563  /// Initializes instance for given repeating group.
565  const void* entry,
566  EntrySize size,
567  SchemaVersion version)
568  : entry_(entry)
569  , size_(size)
570  , version_(version)
571  {
572  }
573 
574  /// Initializes instance as copy of the other one.
576  const Iterator& other)
577  : entry_(
578  other.entry_)
579  , size_(
580  other.size_)
581  , version_(
582  other.version_)
583  {
584  }
585 
586  /// Repeating group entry referenced by the instance.
587  const Entry get() const
588  {
589  assert(NULL != entry_);
590 
591  return
592  Entry(
593  entry_,
594  size_,
595  version_);
596  }
597 
598  /// Repeating group entry referenced by the instance.
599  const Entry operator *() const
600  {
601  return get();
602  }
603 
604  /// Compares given iterator with the other instance.
605  bool
607  const Iterator& other) const
608  {
609  return entry_ == other.entry_;
610  }
611 
612  /// Compares given iterator with the other instance.
613  bool
615  const Iterator& other) const
616  {
617  return entry_ != other.entry_;
618  }
619 
620  /// Established order between two iterators.
621  bool
623  const Iterator& other) const
624  {
625  return entry_ < other.entry_;
626  }
627 
628  /// Established order between two iterators.
629  bool
631  const Iterator& other) const
632  {
633  return entry_ > other.entry_;
634  }
635 
636  /// Advances instance to the next repeating group entry.
637  Iterator&
638  operator ++()
639  {
640  entry_ =
642  entry_, size_);
643 
644  return *this;
645  }
646 
647  /// Advances instance to the next repeating group entry.
648  Iterator&
649  operator --()
650  {
651  entry_ =
653  entry_,
654  size_);
655 
656  return *this;
657  }
658 
659  /// Advances instance by given number of entries.
660  Iterator
662  difference_type distance) const
663  {
664  return
665  Iterator(
667  entry_,
668  distance * size_),
669  size_,
670  version_);
671  }
672 
673  /// Advances instance by given number of entries.
674  Iterator
676  difference_type distance) const
677  {
678  return
679  Iterator(
681  entry_,
682  distance * size_),
683  size_,
684  version_);
685  }
686 
687  /// Re-initializes instance as copy of the other one.
688  Iterator&
689  operator =(
690  const Iterator& other)
691  {
692  entry_ = other.entry_;
693  size_ = other.size_;
694 
695  version_ = other.version_;
696 
697  return *this;
698  }
699  };
700 
701  /// Initializes blank instance referencing to nothing.
703  : entries_(NULL)
704  , entrySize_(0)
705  , entryCount_(0)
706  , version_(0)
707  , size_(0)
708  {
709  }
710 
711  /// Initializes instance referencing
712  /// to a valid group of a given message.
714  const void* data,
715  BinarySize size,
716  SchemaVersion version)
717  : entries_(
719  data,
720  Dimension::Size))
721  , entrySize_(0)
722  , entryCount_(0)
723  , version_(version)
724  , size_(Dimension::Size)
725  {
726  if (size < size_)
728 
729  const
730  Dimension*
731  group =
732  static_cast
733  <const Dimension*>
734  (data);
735 
736  entrySize_ =
737  group->blockLength();
738 
739  entryCount_ =
740  group->numInGroup();
741 
742  size_ +=
743  (
744  static_cast
745  <BinarySize>
746  (entrySize_) *
747  static_cast
748  <BinarySize>
749  (entryCount_)
750  );
751 
752  if (size < size_)
754  }
755 
756  /// Initializes instance as a copy of the other one.
758  const BinaryGroup& other)
759  : entries_(
760  other.entries_)
761  , entrySize_(
762  other.entrySize_)
763  , entryCount_(
764  other.entryCount_)
765  , version_(
766  other.version_)
767  , size_(
768  other.size_)
769  {
770  }
771 
772  /// Indicates whether given instance
773  /// refers to a valid repeating group.
774  operator bool() const
775  {
776  return (NULL != entries_);
777  }
778 
779  /// Indicates whether a repeating
780  /// group being referenced is empty.
781  bool empty() const
782  {
783  return 0 == size();
784  }
785 
786  /// Returns number of entries in a
787  /// repeating group being referenced.
788  Size size() const
789  {
790  return entryCount_;
791  }
792 
793  /// Returns iterator pointing to the first repeating group entry.
794  Iterator begin() const
795  {
796  return
797  Iterator(
798  entries_,
799  entrySize_,
800  version_);
801  }
802 
803  /// Returns iterator pointing to the entry behind the end of the group.
804  Iterator end() const
805  {
806  return
807  Iterator(
809  binary(),
810  binarySize()),
811  entrySize_,
812  version_);
813  }
814 
815  /// Provides access to a repeating group entry by index.
816  /// Index validness is not checked due to performance considerations.
817  Entry operator [](Size index) const
818  {
819  assert(index < size());
820 
821  return
822  Entry(
824  entries(),
825  index * entrySize_),
826  entrySize_,
827  version_);
828  }
829 
830  /// SBE-encoded data representing repeating group.
831  const void* binary() const
832  {
833  return
834  entries_
836  entries_, Dimension::Size)
837  : NULL;
838  }
839 
840  /// Size of SBE-encoded data representing repeating group.
841  BinarySize binarySize() const
842  {
843  return size_;
844  }
845 
846  /// Location of repeating group entries.
847  const void* entries() const
848  {
849  return entries_;
850  }
851 
852  /// Size in bytes of single repeating group entry.
854  {
855  return entrySize_;
856  }
857 
858  /// Re-initializes instance as copy of the other one.
859  BinaryGroup&
860  operator =(
861  const BinaryGroup& other)
862  {
863  entries_ = other.entries_;
864 
865  entrySize_ = other.entrySize_;
866  entryCount_ = other.entryCount_;
867 
868  version_ = other.version_;
869  size_ = other.size_;
870 
871  return *this;
872  }
873 
874 private:
875  const void* entries_;
876 
877  EntrySize entrySize_;
878  Size entryCount_;
879 
880  SchemaVersion version_;
881  BinarySize size_;
882 };
883 
884 /// Encapsulates services for manipulating SBE-encoded
885 /// groups stored sequentially in SBE-encoded message.
886 template
887 <
888  class BinarySize
889 >
891 {
892  const void* binary_;
893  BinarySize size_;
894  SchemaVersion version_;
895 
896 public:
897  /// Initializes empty list.
899  : binary_(NULL)
900  , size_(0)
901  , version_(0)
902  {
903  }
904 
905  /// Initializes list over memory block,
906  /// where given message is stored.
908  const void* binary,
909  BinarySize size,
910  SchemaVersion version)
911  : binary_(binary)
912  , size_(size)
913  , version_(version)
914  {
915  }
916 
917  /// Initializes as copy of other list.
919  const BinaryGroupList& other)
920  : binary_(
921  other.binary_)
922  , size_(
923  other.size_)
924  , version_(
925  other.version_)
926  {
927  }
928 
929  /// Indicates whether group list is empty.
930  bool empty() const
931  {
932  return (0 == size_);
933  }
934 
935  /// Provides access to the head group of the list.
936  template
937  <
938  class Group
939  >
940  Group head() const
941  {
942  return
943  Group(
944  binary_,
945  size_,
946  version_);
947  }
948 
949  /// Returns list of groups following the head.
950  template
951  <
952  class Group
953  >
955  {
956  const
957  BinarySize
958  headSize =
959  head<Group>().
960  binarySize();
961 
962  assert(headSize <= size_);
963 
964  return
967  binary_, headSize),
968  size_ - headSize,
969  version_);
970  }
971 
972  /// SBE-encoded content referenced by given list.
973  const void* binary() const
974  {
975  return binary_;
976  }
977 
978  /// Size of SBE-encoded content referenced by the list.
979  BinarySize binarySize() const
980  {
981  return size_;
982  }
983 
984  /// Re-initializes instance as copy of the other one.
986  operator =(
987  const BinaryGroupList& other)
988  {
989  binary_ = other.binary_;
990  size_ = other.size_;
991 
992  version_ = other.version_;
993 
994  return *this;
995  }
996 };
997 
998 /// Raises exception on bad binary message.
999 inline
1000 void
1002 {
1003  throw std::runtime_error(
1004  "Cannot construct message instance. Memory "
1005  "block is too small to access SBE message header. ");
1006 }
1007 
1008 /// Raises exception on bad message version.
1009 ONIXS_CMEMDH_EXPORTED
1010 void
1012  SchemaVersion messageVersion);
1013 
1014 /// Aliases message type (template) identification.
1015 typedef
1018 
1019 /// Aliases message length type.
1020 typedef UInt16 MessageSize;
1021 
1022 /// Encapsulates services for manipulating SBE-encoded messages.
1025 : public BinaryFields
1026 <
1027  BinaryMessage,
1028  MessageSize
1029 >
1030 {
1031  const MessageHeader* header_;
1032  MessageSize size_;
1033 
1034 protected:
1035  /// Binary group list instantiation.
1036  typedef
1039 
1040  /// Returns list of repeating groups
1041  /// of a message being referenced.
1043  {
1044  assert(NULL != header_);
1045 
1046  const void*
1047  const list =
1049  body(), bodySize());
1050 
1051  const
1052  MessageSize
1053  listSize =
1054  size_ -
1055  MessageHeader::Size -
1056  header_->blockLength();
1057 
1058  return
1059  GroupList(
1060  list,
1061  listSize,
1062  header_->version());
1063  }
1064 
1065 public:
1066  /// Length of message binary data.
1068 
1069  /// Length of message body without repeating groups.
1070  typedef
1073 
1074  /// Initializes blank instance referencing to nothing.
1076  : header_(NULL)
1077  , size_(0)
1078  {
1079  }
1080 
1081  /// Initializes instance over given memory block.
1083  const void* data,
1084  MessageSize size)
1085  : header_(
1086  static_cast
1087  <const MessageHeader*>
1088  (data))
1089  , size_(size)
1090  {
1091  assert(NULL != data);
1092 
1093  if (size <
1094  MessageHeader::Size
1095  ||
1096  size <
1097  (MessageHeader::Size +
1098  header_->blockLength()))
1099  {
1101  }
1102 
1103  const
1104  SchemaVersion
1105  version = this->version();
1106 
1107  if (version <
1108  SchemaTraits::minimalVersion())
1109  {
1110  throwBadMessageVersion(version);
1111  }
1112  }
1113 
1114  /// Initializes instance as copy of the other one.
1116  const BinaryMessage& other)
1117  : header_(other.header_)
1118  , size_(other.size_)
1119  {
1120  }
1121 
1122  /// Indicates whether instance refers to a valid message.
1123  operator bool() const
1124  {
1125  return (NULL != header_);
1126  }
1127 
1128  /// Template identifier of message being referenced.
1130  {
1131  assert(NULL != header_);
1132 
1133  return header_->templateId();
1134  }
1135 
1136  /// Version of message being referenced.
1138  {
1139  assert(NULL != header_);
1140 
1141  return header_->version();
1142  }
1143 
1144  /// SBE-encoded message content.
1145  const void* binary() const
1146  {
1147  return header_;
1148  }
1149 
1150  /// Size of SBE-encoded message.
1152  {
1153  return size_;
1154  }
1155 
1156  /// Indicates beginning of message body.
1157  const void* body() const
1158  {
1159  assert(NULL != header_);
1160 
1161  return
1163  header_,
1164  MessageHeader::Size);
1165  }
1166 
1167  /// Size of message body in bytes.
1169  {
1170  assert(NULL != header_);
1171 
1172  return header_->blockLength();
1173  }
1174 
1175  /// Re-initializes instance as a copy of the other one.
1176  BinaryMessage&
1177  operator =(
1178  const BinaryMessage& other)
1179  {
1180  header_ = other.header_;
1181  size_ = other.size_;
1182 
1183  return *this;
1184  }
1185 };
1186 
#define ONIXS_CMEMDH_LTWT_CLASS
Definition: Bootstrap.h:110
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Definition: Decimal.h:134
Iterator end() const
Returns iterator pointing to the entry behind the end of the group.
const FieldValue & ordinary(BlockSize offset) const
Returns value of a field by its offset.
Definition: BinaryMessage.h:70
const Entry & reference
Aliases entry reference for STL conformance.
Group head() const
Provides access to the head group of the list.
BinaryMessage(const void *data, MessageSize size)
Initializes instance over given memory block.
bool empty() const
Indicates whether group list is empty.
bool enumeration(typename Enumeration::Enum &value, BlockSize offset, const NullValue &null, SchemaVersion since) const
EntryType Entry
Aliases type of repeating group entry.
UInt16 BlockLength
blockLength type.
Definition: Composites.h:474
GroupSizeType BinarySize
Length of group data.
ONIXS_CMEMDH_EXPORTED void throwBadMessageVersion(SchemaVersion messageVersion)
Raises exception on bad message version.
const void * binary() const
SBE-encoded content referenced by given list.
ONIXS_CMEMDH_EXPORTED void throwBadBinaryData(const Char *className)
Throws exception on bad repeating group entry.
BinaryMessage()
Initializes blank instance referencing to nothing.
BinaryGroupList()
Initializes empty list.
BinaryGroupEntry()
Initializes instance referring to nothing.
Dimension::NumInGroup Size
Size of group (number of entries).
BodySize bodySize() const
Indicates end of group entry body.
const void * binary() const
SBE-encoded data representing repeating group.
DimensionType::BlockLength EntrySize
Length of group entry data.
const void * body() const
Indicates beginning of message body.
Enumeration::Enum enumeration(BlockSize offset) const
bool decimal(Decimal &value, BlockSize offset, const NullValue &null) const
BinaryGroupEntry(const BinaryGroupEntry &other)
Initializes instance as a copy of the other one.
bool decimal(Decimal &value, BlockSize offset, const NullValue &null, SchemaVersion since) const
Iterator()
Initializes instance referring to nothing.
ONIXS_CMEMDH_EXPORTED void throwBadBinaryGroup()
Throws exception on bad repeating group.
bool ordinary(FieldValue &value, BlockSize offset, const NullValue &null, SchemaVersion since) const
char Char
Character type alias.
Definition: String.h:36
UInt16 MessageSize
Aliases message length type.
BinarySize binarySize() const
Size of SBE-encoded content referenced by the list.
BodySize bodySize() const
Size of message body in bytes.
std::random_access_iterator_tag iterator_category
Identifies iterator category.
BinaryMessage(const BinaryMessage &other)
Initializes instance as copy of the other one.
SchemaVersion version() const
bool operator>(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Definition: Decimal.h:170
TemplateId templateId() const
templateId field.
Definition: Composites.h:503
bool ordinary(FieldValue &value, BlockSize offset, const NullValue &null) const
BinaryFields()
Initializes blank instance.
Definition: BinaryMessage.h:54
Version version() const
version field.
Definition: Composites.h:515
MessageTemplateId templateId() const
Template identifier of message being referenced.
BinaryGroupList< MessageSize > GroupList
Binary group list instantiation.
Decimal decimal(BlockSize offset) const
Provides efficient way of accessing text-based FIX field values.
Definition: String.h:39
const void * binary() const
SBE-encoded message content.
MessageHeader::Version SchemaVersion
Aliases SBE-encoded data version type.
Definition: SchemaTraits.h:30
EntryType Entry
Aliases type of object referenced by iterator.
const Entry value_type
Aliases entry for STL conformance.
A real number with floating exponent.
Definition: Decimal.h:220
Timestamp operator+(const Timestamp &timestamp, const TimeSpan &timeSpan)
Adds time interval to given time point.
Definition: Time.h:702
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition: Bootstrap.h:168
BinaryGroupList tail() const
Returns list of groups following the head.
StrRef fixedStr(BlockSize offset, SchemaVersion since) const
UInt16 TemplateId
templateId type.
Definition: Composites.h:477
StrRef fixedStr(BlockSize offset) const
ptrdiff_t difference_type
Iterator difference type.
BinaryGroup()
Initializes blank instance referencing to nothing.
Type * advanceByBytes(Type *pointer, ptrdiff_t distance)
Advances given pointer to a given offset (distance) in bytes.
Definition: Memory.h:121
Attributes of SBE message schema.
Definition: SchemaTraits.h:33
BinaryGroupList(const BinaryGroupList &other)
Initializes as copy of other list.
Encapsulates services for manipulating SBE-encoded messages.
MessageHeader::BlockLength BodySize
Length of message body without repeating groups.
BinaryGroup(const void *data, BinarySize size, SchemaVersion version)
BinaryGroupEntry(const void *body, BodySize size, SchemaVersion version)
BinarySize binarySize() const
Size of SBE-encoded data representing repeating group.
Encapsulates operations over SBE-encoded repeating group.
EntrySize entrySize() const
Size in bytes of single repeating group entry.
Template ID and length of message root.
Definition: Composites.h:467
bool operator<(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Definition: Decimal.h:152
DimensionType Dimension
Aliases repeating group dimension type.
bool enumeration(typename Enumeration::Enum &value, BlockSize offset, const NullValue &null) const
Iterator begin() const
Returns iterator pointing to the first repeating group entry.
const void * entries() const
Location of repeating group entries.
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Definition: Decimal.h:116
Type * advanceBackByBytes(Type *pointer, ptrdiff_t distance)
Definition: Memory.h:140
MDEntryType type.
Definition: Fields.h:279
Timestamp operator-(const Timestamp &timestamp, const TimeSpan &timeSpan)
Subtracts time interval from given time point.
Definition: Time.h:716
MessageSize binarySize() const
Size of SBE-encoded message.
Iterator(const void *entry, EntrySize size, SchemaVersion version)
Initializes instance for given repeating group.
const void * body() const
Indicates beginning of group entry body.
SchemaVersion version() const
Version of message being referenced.
MessageHeader::TemplateId MessageTemplateId
Aliases message type (template) identification.
Iterator(const Iterator &other)
Initializes instance as copy of the other one.
BinaryGroupList(const void *binary, BinarySize size, SchemaVersion version)
const Entry * pointer
Aliases pointer to entry for STL conformance.
BinaryGroup(const BinaryGroup &other)
Initializes instance as a copy of the other one.
void throwBadBinaryMessage()
Raises exception on bad binary message.
~BinaryFields()
Cleans everything up.
Definition: BinaryMessage.h:59
MessageSize BinarySize
Length of message binary data.
BlockLength blockLength() const
blockLength field.
Definition: Composites.h:497
#define ONIXS_CMEMDH_NAMESPACE_END
Definition: Bootstrap.h:172