Zserio C++ runtime library  1.0.0
Built for Zserio 2.13.0
Reflectable.h
Go to the documentation of this file.
1 #ifndef ZSERIO_REFLECTABLE_H_INC
2 #define ZSERIO_REFLECTABLE_H_INC
3 
4 #include <functional>
5 #include <type_traits>
6 
10 #include "zserio/IReflectable.h"
11 #include "zserio/Span.h"
13 #include "zserio/Traits.h"
14 #include "zserio/TypeInfo.h"
15 #include "zserio/TypeInfoUtil.h"
16 
17 namespace zserio
18 {
19 
26 template <typename ALLOC>
27 class ReflectableBase : public IBasicReflectable<ALLOC>
28 {
29 public:
35  explicit ReflectableBase(const IBasicTypeInfo<ALLOC>& typeInfo);
36 
38  ~ReflectableBase() override = 0;
39 
44  ReflectableBase(const ReflectableBase&) = delete;
45  ReflectableBase& operator=(const ReflectableBase&) = delete;
46 
47  ReflectableBase(const ReflectableBase&&) = delete;
48  ReflectableBase& operator=(const ReflectableBase&&) = delete;
53  const IBasicTypeInfo<ALLOC>& getTypeInfo() const override;
54  bool isArray() const override;
55 
56  void initializeChildren() override;
57  void initialize(const vector<AnyHolder<ALLOC>, ALLOC>& typeArguments) override;
58  size_t initializeOffsets(size_t bitPosition) override;
59  size_t initializeOffsets() override;
60  size_t bitSizeOf(size_t bitPosition) const override;
61  size_t bitSizeOf() const override;
62  void write(BitStreamWriter& writer) const override;
63 
67  void setField(StringView name, const AnyHolder<ALLOC>& value) override;
72 
73  StringView getChoice() const override;
74 
79 
80  size_t size() const override;
81  void resize(size_t size) override;
82  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override;
83  IBasicReflectablePtr<ALLOC> at(size_t index) override;
84  IBasicReflectableConstPtr<ALLOC> operator[](size_t index) const override;
85  IBasicReflectablePtr<ALLOC> operator[](size_t index) override;
86  void setAt(const AnyHolder<ALLOC>& value, size_t index) override;
87  void append(const AnyHolder<ALLOC>& value) override;
88 
89  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override;
90  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override;
91  AnyHolder<ALLOC> getAnyValue() const override;
92  AnyHolder<ALLOC> getAnyValue() override;
93 
94  // exact checked getters
95  bool getBool() const override;
96  int8_t getInt8() const override;
97  int16_t getInt16() const override;
98  int32_t getInt32() const override;
99  int64_t getInt64() const override;
100  uint8_t getUInt8() const override;
101  uint16_t getUInt16() const override;
102  uint32_t getUInt32() const override;
103  uint64_t getUInt64() const override;
104  float getFloat() const override;
105  double getDouble() const override;
106  Span<const uint8_t> getBytes() const override;
107  StringView getStringView() const override;
108  const BasicBitBuffer<ALLOC>& getBitBuffer() const override;
109 
110  // convenience conversions
111  int64_t toInt() const override;
112  uint64_t toUInt() const override;
113  double toDouble() const override;
114  string<ALLOC> toString(const ALLOC& allocator) const override;
115  string<ALLOC> toString() const override;
116 
117 private:
118  const IBasicTypeInfo<ALLOC>& m_typeInfo;
119 };
120 
124 template <typename ALLOC, typename T, typename = void>
126 {
127 private:
129 
130 protected:
131  BuiltinReflectableBase(const IBasicTypeInfo<ALLOC>& typeInfo, const T& value) :
132  Base(typeInfo), m_value(value)
133  {}
134 
135  const T& getValue() const
136  {
137  return m_value;
138  }
139 
140 public:
141  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
142  {
143  return AnyHolder<ALLOC>(std::cref(getValue()), allocator);
144  }
145 
146  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override
147  {
148  // we have only const reference, thus return it
149  return AnyHolder<ALLOC>(std::cref(getValue()), allocator);
150  }
151 
152 private:
153  const T& m_value;
154 };
155 
161 template <typename ALLOC, typename T>
162 class BuiltinReflectableBase<ALLOC, T,
163  typename std::enable_if<std::is_arithmetic<T>::value || std::is_same<T, StringView>::value ||
164  is_span<T>::value>::type> : public ReflectableBase<ALLOC>
165 {
166 private:
168 
169 protected:
170  BuiltinReflectableBase(const IBasicTypeInfo<ALLOC>& typeInfo, T value) :
171  Base(typeInfo), m_value(value)
172  {}
173 
174  T getValue() const
175  {
176  return m_value;
177  }
178 
179 public:
180  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
181  {
182  return AnyHolder<ALLOC>(m_value, allocator);
183  }
184 
185  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override
186  {
187  return AnyHolder<ALLOC>(m_value, allocator);
188  }
189 
190 private:
191  T m_value;
192 };
193 
202 template <typename ALLOC, typename T>
204 {
205 protected:
206  static_assert(std::is_integral<T>::value, "T must be a signed integral type!");
207 
209 
210 public:
211  IntegralReflectableBase(const IBasicTypeInfo<ALLOC>& typeInfo, T value) :
212  Base(typeInfo, value)
213  {}
214 
215  double toDouble() const override
216  {
217  return static_cast<double>(Base::getValue());
218  }
219 
220  string<ALLOC> toString(const ALLOC& allocator) const override
221  {
222  return ::zserio::toString<ALLOC>(Base::getValue(), allocator);
223  }
224 };
225 
231 template <typename ALLOC, typename T>
233 {
234 protected:
235  static_assert(std::is_signed<T>::value, "T must be a signed integral type!");
236 
238 
239  using Base::Base;
240 
241 public:
242  int64_t toInt() const override
243  {
244  return Base::getValue();
245  }
246 };
247 
253 template <typename ALLOC, typename T>
255 {
256 protected:
257  static_assert(std::is_unsigned<T>::value, "T must be an unsigned integral type!");
258 
260 
261  using Base::Base;
262 
263 public:
264  uint64_t toUInt() const override
265  {
266  return Base::getValue();
267  }
268 };
269 
273 template <typename ALLOC>
274 class BoolReflectable : public UnsignedReflectableBase<ALLOC, bool>
275 {
276 private:
278 
279 public:
281  {
283  }
284 
285  explicit BoolReflectable(bool value) :
286  Base(typeInfo(), value)
287  {}
288 
289  size_t bitSizeOf(size_t) const override
290  {
291  return 1;
292  }
293 
294  void write(BitStreamWriter& writer) const override
295  {
296  writer.writeBool(Base::getValue());
297  }
298 
299  bool getBool() const override
300  {
301  return Base::getValue();
302  }
303 };
304 
310 template <typename ALLOC>
311 class Int8ReflectableBase : public SignedReflectableBase<ALLOC, int8_t>
312 {
313 protected:
315 
316  using Base::Base;
317 
318 public:
319  int8_t getInt8() const override
320  {
321  return Base::getValue();
322  }
323 };
324 
330 template <typename ALLOC>
331 class Int16ReflectableBase : public SignedReflectableBase<ALLOC, int16_t>
332 {
333 protected:
335 
336  using Base::Base;
337 
338 public:
339  int16_t getInt16() const override
340  {
341  return Base::getValue();
342  }
343 };
344 
350 template <typename ALLOC>
351 class Int32ReflectableBase : public SignedReflectableBase<ALLOC, int32_t>
352 {
353 protected:
355 
356  using Base::Base;
357 
358 public:
359  int32_t getInt32() const override
360  {
361  return Base::getValue();
362  }
363 };
364 
370 template <typename ALLOC>
371 class Int64ReflectableBase : public SignedReflectableBase<ALLOC, int64_t>
372 {
373 protected:
375 
376  using Base::Base;
377 
378 public:
379  int64_t getInt64() const override
380  {
381  return Base::getValue();
382  }
383 };
384 
390 template <typename ALLOC>
391 class UInt8ReflectableBase : public UnsignedReflectableBase<ALLOC, uint8_t>
392 {
393 protected:
395 
396  using Base::Base;
397 
398 public:
399  uint8_t getUInt8() const override
400  {
401  return Base::getValue();
402  }
403 };
404 
410 template <typename ALLOC>
411 class UInt16ReflectableBase : public UnsignedReflectableBase<ALLOC, uint16_t>
412 {
413 protected:
415 
416  using Base::Base;
417 
418 public:
419  uint16_t getUInt16() const override
420  {
421  return Base::getValue();
422  }
423 };
424 
430 template <typename ALLOC>
431 class UInt32ReflectableBase : public UnsignedReflectableBase<ALLOC, uint32_t>
432 {
433 protected:
435 
436  using Base::Base;
437 
438 public:
439  uint32_t getUInt32() const override
440  {
441  return Base::getValue();
442  }
443 };
444 
450 template <typename ALLOC>
451 class UInt64ReflectableBase : public UnsignedReflectableBase<ALLOC, uint64_t>
452 {
453 protected:
455 
456  using Base::Base;
457 
458 public:
459  uint64_t getUInt64() const override
460  {
461  return Base::getValue();
462  }
463 };
464 
468 template <typename ALLOC>
470 {
471 private:
473 
474 public:
476  {
478  }
479 
480  explicit Int8Reflectable(int8_t value) :
481  Base(typeInfo(), value)
482  {}
483 
484  size_t bitSizeOf(size_t) const override
485  {
486  return 8;
487  }
488 
489  void write(BitStreamWriter& writer) const override
490  {
491  writer.writeSignedBits(Base::getValue(), 8);
492  }
493 };
494 
498 template <typename ALLOC>
500 {
501 private:
503 
504 public:
506  {
508  }
509 
510  explicit Int16Reflectable(int16_t value) :
511  Base(typeInfo(), value)
512  {}
513 
514  size_t bitSizeOf(size_t) const override
515  {
516  return 16;
517  }
518 
519  void write(BitStreamWriter& writer) const override
520  {
521  writer.writeSignedBits(Base::getValue(), 16);
522  }
523 };
524 
528 template <typename ALLOC>
530 {
531 private:
533 
534 public:
536  {
538  }
539 
540  explicit Int32Reflectable(int32_t value) :
541  Base(typeInfo(), value)
542  {}
543 
544  size_t bitSizeOf(size_t) const override
545  {
546  return 32;
547  }
548 
549  void write(BitStreamWriter& writer) const override
550  {
551  writer.writeSignedBits(Base::getValue(), 32);
552  }
553 };
554 
558 template <typename ALLOC>
560 {
561 private:
563 
564 public:
566  {
568  }
569 
570  explicit Int64Reflectable(int64_t value) :
571  Base(typeInfo(), value)
572  {}
573 
574  size_t bitSizeOf(size_t) const override
575  {
576  return 64;
577  }
578 
579  void write(BitStreamWriter& writer) const override
580  {
581  writer.writeSignedBits64(Base::getValue(), 64);
582  }
583 };
584 
588 template <typename ALLOC>
590 {
591 private:
593 
594 public:
596  {
598  }
599 
600  explicit UInt8Reflectable(uint8_t value) :
601  Base(typeInfo(), value)
602  {}
603 
604  size_t bitSizeOf(size_t) const override
605  {
606  return 8;
607  }
608 
609  void write(BitStreamWriter& writer) const override
610  {
611  writer.writeBits(Base::getValue(), 8);
612  }
613 };
614 
618 template <typename ALLOC>
620 {
621 private:
623 
624 public:
626  {
628  }
629 
630  explicit UInt16Reflectable(uint16_t value) :
631  Base(typeInfo(), value)
632  {}
633 
634  size_t bitSizeOf(size_t) const override
635  {
636  return 16;
637  }
638 
639  void write(BitStreamWriter& writer) const override
640  {
641  writer.writeBits(Base::getValue(), 16);
642  }
643 };
644 
648 template <typename ALLOC>
650 {
651 private:
653 
654 public:
656  {
658  }
659 
660  explicit UInt32Reflectable(uint32_t value) :
661  Base(typeInfo(), value)
662  {}
663 
664  size_t bitSizeOf(size_t) const override
665  {
666  return 32;
667  }
668 
669  void write(BitStreamWriter& writer) const override
670  {
671  writer.writeBits(Base::getValue(), 32);
672  }
673 };
674 
678 template <typename ALLOC>
680 {
681 private:
683 
684 public:
686  {
688  }
689 
690  explicit UInt64Reflectable(uint64_t value) :
691  Base(typeInfo(), value)
692  {}
693 
694  size_t bitSizeOf(size_t) const override
695  {
696  return 64;
697  }
698 
699  void write(BitStreamWriter& writer) const override
700  {
701  writer.writeBits64(Base::getValue(), 64);
702  }
703 };
704 
705 template <typename ALLOC, typename T>
707 
708 template <typename ALLOC>
709 class FixedSignedBitFieldReflectable<ALLOC, int8_t> : public Int8ReflectableBase<ALLOC>
710 {
711 private:
713 
714 public:
715  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t bitSize)
716  {
718  }
719 
720  FixedSignedBitFieldReflectable(int8_t value, uint8_t bitSize) :
721  Base(typeInfo(bitSize), value)
722  {
723  if (bitSize > 8)
724  {
725  throw CppRuntimeException("FixedSignedBitFieldReflectable ") <<
726  " - invalid bit size '" << bitSize << "' for 'int8_t' value!";
727  }
728  }
729 
730  size_t bitSizeOf(size_t) const override
731  {
732  return Base::getTypeInfo().getBitSize();
733  }
734 
735  void write(BitStreamWriter& writer) const override
736  {
737  writer.writeSignedBits(Base::getValue(), Base::getTypeInfo().getBitSize());
738  }
739 };
740 
741 template <typename ALLOC>
742 class FixedSignedBitFieldReflectable<ALLOC, int16_t> : public Int16ReflectableBase<ALLOC>
743 {
744 private:
746 
747 public:
748  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t bitSize)
749  {
751  }
752 
753  FixedSignedBitFieldReflectable(int16_t value, uint8_t bitSize) :
754  Base(typeInfo(bitSize), value)
755  {
756  if (bitSize <= 8 || bitSize > 16)
757  {
758  throw CppRuntimeException("FixedSignedBitFieldReflectable ") <<
759  " - invalid bit size '" << bitSize << "' for 'int16_t' value!";
760  }
761  }
762 
763  size_t bitSizeOf(size_t) const override
764  {
765  return Base::getTypeInfo().getBitSize();
766  }
767 
768  void write(BitStreamWriter& writer) const override
769  {
770  writer.writeSignedBits(Base::getValue(), Base::getTypeInfo().getBitSize());
771  }
772 };
773 
774 template <typename ALLOC>
775 class FixedSignedBitFieldReflectable<ALLOC, int32_t> : public Int32ReflectableBase<ALLOC>
776 {
777 private:
779 
780 public:
781  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t bitSize)
782  {
784  }
785 
786  FixedSignedBitFieldReflectable(int32_t value, uint8_t bitSize) :
787  Base(typeInfo(bitSize), value)
788  {
789  if (bitSize <= 16 || bitSize > 32)
790  {
791  throw CppRuntimeException("FixedSignedBitFieldReflectable ") <<
792  " - invalid bit size '" << bitSize << "' for 'int32_t' value!";
793  }
794  }
795 
796  size_t bitSizeOf(size_t) const override
797  {
798  return Base::getTypeInfo().getBitSize();
799  }
800 
801  void write(BitStreamWriter& writer) const override
802  {
803  writer.writeSignedBits(Base::getValue(), Base::getTypeInfo().getBitSize());
804  }
805 };
806 
807 template <typename ALLOC>
808 class FixedSignedBitFieldReflectable<ALLOC, int64_t> : public Int64ReflectableBase<ALLOC>
809 {
810 private:
812 
813 public:
814  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t bitSize)
815  {
817  }
818 
819  FixedSignedBitFieldReflectable(int64_t value, uint8_t bitSize) :
820  Base(typeInfo(bitSize), value)
821  {
822  if (bitSize <= 32) // check for maximum bit size (64) is done in type info
823  {
824  throw CppRuntimeException("FixedSignedBitFieldReflectable ") <<
825  " - invalid bit size '" << bitSize << "' for 'int64_t' value!";
826  }
827  }
828 
829  size_t bitSizeOf(size_t) const override
830  {
831  return Base::getTypeInfo().getBitSize();
832  }
833 
834  void write(BitStreamWriter& writer) const override
835  {
836  writer.writeSignedBits64(Base::getValue(), Base::getTypeInfo().getBitSize());
837  }
838 };
839 
840 template <typename ALLOC, typename T>
842 
843 template <typename ALLOC>
844 class FixedUnsignedBitFieldReflectable<ALLOC, uint8_t> : public UInt8ReflectableBase<ALLOC>
845 {
846 private:
848 
849 public:
850  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t bitSize)
851  {
853  }
854 
855  FixedUnsignedBitFieldReflectable(uint8_t value, uint8_t bitSize) :
856  Base(typeInfo(bitSize), value)
857  {
858  if (bitSize > 8)
859  {
860  throw CppRuntimeException("FixedUnsignedBitFieldReflectable") <<
861  " - invalid bit size '" << bitSize << "' for 'uint8_t' value!";
862  }
863  }
864 
865  size_t bitSizeOf(size_t) const override
866  {
867  return Base::getTypeInfo().getBitSize();
868  }
869 
870  void write(BitStreamWriter& writer) const override
871  {
872  writer.writeBits(Base::getValue(), Base::getTypeInfo().getBitSize());
873  }
874 };
875 
876 template <typename ALLOC>
877 class FixedUnsignedBitFieldReflectable<ALLOC, uint16_t> : public UInt16ReflectableBase<ALLOC>
878 {
879 private:
881 
882 public:
883  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t bitSize)
884  {
886  }
887 
888  FixedUnsignedBitFieldReflectable(uint16_t value, uint8_t bitSize) :
889  Base(typeInfo(bitSize), value)
890  {
891  if (bitSize <= 8 || bitSize > 16)
892  {
893  throw CppRuntimeException("FixedUnsignedBitFieldReflectable") <<
894  " - invalid bit size '" << bitSize << "' for 'uint16_t' value!";
895  }
896  }
897 
898  size_t bitSizeOf(size_t) const override
899  {
900  return Base::getTypeInfo().getBitSize();
901  }
902 
903  void write(BitStreamWriter& writer) const override
904  {
905  writer.writeBits(Base::getValue(), Base::getTypeInfo().getBitSize());
906  }
907 };
908 
909 template <typename ALLOC>
910 class FixedUnsignedBitFieldReflectable<ALLOC, uint32_t> : public UInt32ReflectableBase<ALLOC>
911 {
912 private:
914 
915 public:
916  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t bitSize)
917  {
919  }
920 
921  FixedUnsignedBitFieldReflectable(uint32_t value, uint8_t bitSize) :
922  Base(typeInfo(bitSize), value)
923  {
924  if (bitSize <= 16 || bitSize > 32)
925  {
926  throw CppRuntimeException("FixedUnsignedBitFieldReflectable") <<
927  " - invalid bit size '" << bitSize << "' for 'uint32_t' value!";
928  }
929  }
930 
931  size_t bitSizeOf(size_t) const override
932  {
933  return Base::getTypeInfo().getBitSize();
934  }
935 
936  void write(BitStreamWriter& writer) const override
937  {
938  writer.writeBits(Base::getValue(), Base::getTypeInfo().getBitSize());
939  }
940 };
941 
942 template <typename ALLOC>
943 class FixedUnsignedBitFieldReflectable<ALLOC, uint64_t> : public UInt64ReflectableBase<ALLOC>
944 {
945 private:
947 
948 public:
949  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t bitSize)
950  {
952  }
953 
954  FixedUnsignedBitFieldReflectable(uint64_t value, uint8_t bitSize) :
955  Base(typeInfo(bitSize), value)
956  {
957  if (bitSize <= 32) // check for maximum bit size (64) is done in type info
958  {
959  throw CppRuntimeException("FixedUnsignedBitFieldReflectable") <<
960  " - invalid bit size '" << bitSize << "' for 'uint64_t' value!";
961  }
962  }
963 
964  size_t bitSizeOf(size_t) const override
965  {
966  return Base::getTypeInfo().getBitSize();
967  }
968 
969  void write(BitStreamWriter& writer) const override
970  {
971  writer.writeBits64(Base::getValue(), Base::getTypeInfo().getBitSize());
972  }
973 };
974 
975 template <typename ALLOC, typename T>
977 
978 template <typename ALLOC>
979 class DynamicSignedBitFieldReflectable<ALLOC, int8_t> : public Int8ReflectableBase<ALLOC>
980 {
981 private:
983 
984 public:
985  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t maxBitSize)
986  {
988  }
989 
990  DynamicSignedBitFieldReflectable(int8_t value, uint8_t maxBitSize, uint8_t dynamicBitSize) :
991  Base(typeInfo(maxBitSize), value), m_dynamicBitSize(dynamicBitSize)
992  {
993  if (maxBitSize > 8)
994  {
995  throw CppRuntimeException("DynamicSignedBitFieldReflectable") <<
996  " - invalid max bit size '" << maxBitSize << "' for 'int8_t' value!";
997  }
998 
999  if (dynamicBitSize > maxBitSize)
1000  {
1001  throw CppRuntimeException("DynamicSignedBitFieldReflectable - dynamic bit size '") <<
1002  dynamicBitSize << "' is greater than max bit size '" << maxBitSize << "'!";
1003  }
1004  }
1005 
1006  size_t bitSizeOf(size_t) const override
1007  {
1008  return m_dynamicBitSize;
1009  }
1010 
1011  void write(BitStreamWriter& writer) const override
1012  {
1013  writer.writeSignedBits(Base::getValue(), m_dynamicBitSize);
1014  }
1015 
1016 private:
1017  uint8_t m_dynamicBitSize;
1018 };
1019 
1020 template <typename ALLOC>
1021 class DynamicSignedBitFieldReflectable<ALLOC, int16_t> : public Int16ReflectableBase<ALLOC>
1022 {
1023 private:
1025 
1026 public:
1027  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t maxBitSize)
1028  {
1030  }
1031 
1032  DynamicSignedBitFieldReflectable(int16_t value, uint8_t maxBitSize, uint8_t dynamicBitSize) :
1033  Base(typeInfo(maxBitSize), value), m_dynamicBitSize(dynamicBitSize)
1034  {
1035  if (maxBitSize <= 8 || maxBitSize > 16)
1036  {
1037  throw CppRuntimeException("DynamicSignedBitFieldReflectable") <<
1038  " - invalid max bit size '" << maxBitSize << "' for 'int16_t' value!";
1039  }
1040 
1041  if (dynamicBitSize > maxBitSize)
1042  {
1043  throw CppRuntimeException("DynamicSignedBitFieldReflectable - dynamic bit size '") <<
1044  dynamicBitSize << "' is greater than max bit size '" << maxBitSize << "'!";
1045  }
1046  }
1047 
1048  size_t bitSizeOf(size_t) const override
1049  {
1050  return m_dynamicBitSize;
1051  }
1052 
1053  void write(BitStreamWriter& writer) const override
1054  {
1055  writer.writeSignedBits(Base::getValue(), m_dynamicBitSize);
1056  }
1057 
1058 private:
1059  uint8_t m_dynamicBitSize;
1060 };
1061 
1062 template <typename ALLOC>
1063 class DynamicSignedBitFieldReflectable<ALLOC, int32_t> : public Int32ReflectableBase<ALLOC>
1064 {
1065 private:
1067 
1068 public:
1069  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t maxBitSize)
1070  {
1072  }
1073 
1074  DynamicSignedBitFieldReflectable(int32_t value, uint8_t maxBitSize, uint8_t dynamicBitSize) :
1075  Base(typeInfo(maxBitSize), value), m_dynamicBitSize(dynamicBitSize)
1076  {
1077  if (maxBitSize <= 16 || maxBitSize > 32)
1078  {
1079  throw CppRuntimeException("DynamicSignedBitFieldReflectable") <<
1080  " - invalid max bit size '" << maxBitSize << "' for 'int32_t' value!";
1081  }
1082 
1083  if (dynamicBitSize > maxBitSize)
1084  {
1085  throw CppRuntimeException("DynamicSignedBitFieldReflectable - dynamic bit size '") <<
1086  dynamicBitSize << "' is greater than max bit size '" << maxBitSize << "'!";
1087  }
1088  }
1089 
1090  size_t bitSizeOf(size_t) const override
1091  {
1092  return m_dynamicBitSize;
1093  }
1094 
1095  void write(BitStreamWriter& writer) const override
1096  {
1097  writer.writeSignedBits(Base::getValue(), m_dynamicBitSize);
1098  }
1099 
1100 private:
1101  uint8_t m_dynamicBitSize;
1102 };
1103 
1104 template <typename ALLOC>
1105 class DynamicSignedBitFieldReflectable<ALLOC, int64_t> : public Int64ReflectableBase<ALLOC>
1106 {
1107 private:
1109 
1110 public:
1111  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t maxBitSize)
1112  {
1114  }
1115 
1116  DynamicSignedBitFieldReflectable(int64_t value, uint8_t maxBitSize, uint8_t dynamicBitSize) :
1117  Base(typeInfo(maxBitSize), value), m_dynamicBitSize(dynamicBitSize)
1118  {
1119  if (maxBitSize <= 32) // check for maximum bit size (64) is done in type info
1120  {
1121  throw CppRuntimeException("DynamicSignedBitFieldReflectable") <<
1122  " - invalid max bit size '" << maxBitSize << "' for 'int64_t' value!";
1123  }
1124 
1125  if (dynamicBitSize > maxBitSize)
1126  {
1127  throw CppRuntimeException("DynamicSignedBitFieldReflectable - dynamic bit size '") <<
1128  dynamicBitSize << "' is greater than max bit size '" << maxBitSize << "'!";
1129  }
1130  }
1131 
1132  size_t bitSizeOf(size_t) const override
1133  {
1134  return m_dynamicBitSize;
1135  }
1136 
1137  void write(BitStreamWriter& writer) const override
1138  {
1139  writer.writeSignedBits64(Base::getValue(), m_dynamicBitSize);
1140  }
1141 
1142 private:
1143  uint8_t m_dynamicBitSize;
1144 };
1145 
1146 template <typename ALLOC, typename T>
1148 
1149 template <typename ALLOC>
1150 class DynamicUnsignedBitFieldReflectable<ALLOC, uint8_t> : public UInt8ReflectableBase<ALLOC>
1151 {
1152 private:
1154 
1155 public:
1156  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t maxBitSize)
1157  {
1159  }
1160 
1161  DynamicUnsignedBitFieldReflectable(uint8_t value, uint8_t maxBitSize, uint8_t dynamicBitSize) :
1162  Base(typeInfo(maxBitSize), value), m_dynamicBitSize(dynamicBitSize)
1163  {
1164  if (maxBitSize > 8)
1165  {
1166  throw CppRuntimeException("DynamicUnsignedBitFieldReflectable") <<
1167  " - invalid max bit size '" << maxBitSize << "' for 'uint8_t' value!";
1168  }
1169 
1170  if (dynamicBitSize > maxBitSize)
1171  {
1172  throw CppRuntimeException("DynamicSignedBitFieldReflectable - dynamic bit size '") <<
1173  dynamicBitSize << "' is greater than max bit size '" << maxBitSize << "'!";
1174  }
1175  }
1176 
1177  size_t bitSizeOf(size_t) const override
1178  {
1179  return m_dynamicBitSize;
1180  }
1181 
1182  void write(BitStreamWriter& writer) const override
1183  {
1184  writer.writeBits(Base::getValue(), m_dynamicBitSize);
1185  }
1186 
1187 private:
1188  uint8_t m_dynamicBitSize;
1189 };
1190 
1191 template <typename ALLOC>
1192 class DynamicUnsignedBitFieldReflectable<ALLOC, uint16_t> : public UInt16ReflectableBase<ALLOC>
1193 {
1194 private:
1196 
1197 public:
1198  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t maxBitSize)
1199  {
1201  }
1202 
1203  DynamicUnsignedBitFieldReflectable(uint16_t value, uint8_t maxBitSize, uint8_t dynamicBitSize) :
1204  Base(typeInfo(maxBitSize), value), m_dynamicBitSize(dynamicBitSize)
1205  {
1206  if (maxBitSize <= 8 || maxBitSize > 16)
1207  {
1208  throw CppRuntimeException("DynamicUnsignedBitFieldReflectable") <<
1209  " - invalid max bit size '" << maxBitSize << "' for 'uint16_t' value!";
1210  }
1211 
1212  if (dynamicBitSize > maxBitSize)
1213  {
1214  throw CppRuntimeException("DynamicSignedBitFieldReflectable - dynamic bit size '") <<
1215  dynamicBitSize << "' is greater than max bit size '" << maxBitSize << "'!";
1216  }
1217  }
1218 
1219  size_t bitSizeOf(size_t) const override
1220  {
1221  return m_dynamicBitSize;
1222  }
1223 
1224  void write(BitStreamWriter& writer) const override
1225  {
1226  writer.writeBits(Base::getValue(), m_dynamicBitSize);
1227  }
1228 
1229 private:
1230  uint8_t m_dynamicBitSize;
1231 };
1232 
1233 template <typename ALLOC>
1234 class DynamicUnsignedBitFieldReflectable<ALLOC, uint32_t> : public UInt32ReflectableBase<ALLOC>
1235 {
1236 private:
1238 
1239 public:
1240  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t maxBitSize)
1241  {
1243  }
1244 
1245  DynamicUnsignedBitFieldReflectable(uint32_t value, uint8_t maxBitSize, uint8_t dynamicBitSize) :
1246  Base(typeInfo(maxBitSize), value), m_dynamicBitSize(dynamicBitSize)
1247  {
1248  if (maxBitSize <= 16 || maxBitSize > 32)
1249  {
1250  throw CppRuntimeException("DynamicUnsignedBitFieldReflectable") <<
1251  " - invalid max bit size '" << maxBitSize << "' for 'uint32_t' value!";
1252  }
1253 
1254  if (dynamicBitSize > maxBitSize)
1255  {
1256  throw CppRuntimeException("DynamicSignedBitFieldReflectable - dynamic bit size '") <<
1257  dynamicBitSize << "' is greater than max bit size '" << maxBitSize << "'!";
1258  }
1259  }
1260 
1261  size_t bitSizeOf(size_t) const override
1262  {
1263  return m_dynamicBitSize;
1264  }
1265 
1266  void write(BitStreamWriter& writer) const override
1267  {
1268  writer.writeBits(Base::getValue(), m_dynamicBitSize);
1269  }
1270 
1271 private:
1272  uint8_t m_dynamicBitSize;
1273 };
1274 
1275 template <typename ALLOC>
1276 class DynamicUnsignedBitFieldReflectable<ALLOC, uint64_t> : public UInt64ReflectableBase<ALLOC>
1277 {
1278 private:
1280 
1281 public:
1282  static const IBasicTypeInfo<ALLOC>& typeInfo(uint8_t maxBitSize)
1283  {
1285  }
1286 
1287  DynamicUnsignedBitFieldReflectable(uint64_t value, uint8_t maxBitSize, uint8_t dynamicBitSize) :
1288  Base(typeInfo(maxBitSize), value), m_dynamicBitSize(dynamicBitSize)
1289  {
1290  if (maxBitSize <= 32) // check for maximum bit size (64) is done in type info
1291  {
1292  throw CppRuntimeException("DynamicUnsignedBitFieldReflectable") <<
1293  " - invalid max bit size '" << maxBitSize << "' for 'uint64_t' value!";
1294  }
1295 
1296  if (dynamicBitSize > maxBitSize)
1297  {
1298  throw CppRuntimeException("DynamicSignedBitFieldReflectable - dynamic bit size '") <<
1299  dynamicBitSize << "' is greater than max bit size '" << maxBitSize << "'!";
1300  }
1301  }
1302 
1303  size_t bitSizeOf(size_t) const override
1304  {
1305  return m_dynamicBitSize;
1306  }
1307 
1308  void write(BitStreamWriter& writer) const override
1309  {
1310  writer.writeBits64(Base::getValue(), m_dynamicBitSize);
1311  }
1312 
1313 private:
1314  uint8_t m_dynamicBitSize;
1315 };
1316 
1320 template <typename ALLOC>
1322 {
1323 private:
1325 
1326 public:
1328  {
1330  }
1331 
1332  explicit VarInt16Reflectable(int16_t value) :
1333  Base(typeInfo(), value)
1334  {}
1335 
1336  size_t bitSizeOf(size_t) const override
1337  {
1338  return zserio::bitSizeOfVarInt16(Base::getValue());
1339  }
1340 
1341  void write(BitStreamWriter& writer) const override
1342  {
1343  writer.writeVarInt16(Base::getValue());
1344  }
1345 };
1346 
1350 template <typename ALLOC>
1352 {
1353 private:
1355 
1356 public:
1358  {
1360  }
1361 
1362  explicit VarInt32Reflectable(int32_t value) :
1363  Base(typeInfo(), value)
1364  {}
1365 
1366  size_t bitSizeOf(size_t) const override
1367  {
1368  return zserio::bitSizeOfVarInt32(Base::getValue());
1369  }
1370 
1371  void write(BitStreamWriter& writer) const override
1372  {
1373  writer.writeVarInt32(Base::getValue());
1374  }
1375 };
1376 
1380 template <typename ALLOC>
1382 {
1383 private:
1385 
1386 public:
1388  {
1390  }
1391 
1392  explicit VarInt64Reflectable(int64_t value) :
1393  Base(typeInfo(), value)
1394  {}
1395 
1396  size_t bitSizeOf(size_t) const override
1397  {
1398  return zserio::bitSizeOfVarInt64(Base::getValue());
1399  }
1400 
1401  void write(BitStreamWriter& writer) const override
1402  {
1403  writer.writeVarInt64(Base::getValue());
1404  }
1405 };
1406 
1410 template <typename ALLOC>
1412 {
1413 private:
1415 
1416 public:
1418  {
1420  }
1421 
1422  explicit VarIntReflectable(int64_t value) :
1423  Base(typeInfo(), value)
1424  {}
1425 
1426  size_t bitSizeOf(size_t) const override
1427  {
1428  return zserio::bitSizeOfVarInt(Base::getValue());
1429  }
1430 
1431  void write(BitStreamWriter& writer) const override
1432  {
1433  writer.writeVarInt(Base::getValue());
1434  }
1435 };
1436 
1440 template <typename ALLOC>
1442 {
1443 private:
1445 
1446 public:
1448  {
1450  }
1451 
1452  explicit VarUInt16Reflectable(uint16_t value) :
1453  Base(typeInfo(), value)
1454  {}
1455 
1456  size_t bitSizeOf(size_t) const override
1457  {
1458  return zserio::bitSizeOfVarUInt16(Base::getValue());
1459  }
1460 
1461  void write(BitStreamWriter& writer) const override
1462  {
1463  writer.writeVarUInt16(Base::getValue());
1464  }
1465 };
1466 
1470 template <typename ALLOC>
1472 {
1473 private:
1475 
1476 public:
1478  {
1480  }
1481 
1482  explicit VarUInt32Reflectable(uint32_t value) :
1483  Base(typeInfo(), value)
1484  {}
1485 
1486  size_t bitSizeOf(size_t) const override
1487  {
1488  return zserio::bitSizeOfVarUInt32(Base::getValue());
1489  }
1490 
1491  void write(BitStreamWriter& writer) const override
1492  {
1493  writer.writeVarUInt32(Base::getValue());
1494  }
1495 };
1496 
1500 template <typename ALLOC>
1502 {
1503 private:
1505 
1506 public:
1508  {
1510  }
1511 
1512  explicit VarUInt64Reflectable(uint64_t value) :
1513  Base(typeInfo(), value)
1514  {}
1515 
1516  size_t bitSizeOf(size_t) const override
1517  {
1518  return zserio::bitSizeOfVarUInt64(Base::getValue());
1519  }
1520 
1521  void write(BitStreamWriter& writer) const override
1522  {
1523  writer.writeVarUInt64(Base::getValue());
1524  }
1525 };
1526 
1530 template <typename ALLOC>
1532 {
1533 private:
1535 
1536 public:
1538  {
1540  }
1541 
1542  explicit VarUIntReflectable(uint64_t value) :
1543  Base(typeInfo(), value)
1544  {}
1545 
1546  size_t bitSizeOf(size_t) const override
1547  {
1548  return zserio::bitSizeOfVarUInt(Base::getValue());
1549  }
1550 
1551  void write(BitStreamWriter& writer) const override
1552  {
1553  writer.writeVarUInt(Base::getValue());
1554  }
1555 };
1556 
1560 template <typename ALLOC>
1562 {
1563 private:
1565 
1566 public:
1568  {
1570  }
1571 
1572  explicit VarSizeReflectable(uint32_t value) :
1573  Base(typeInfo(), value)
1574  {}
1575 
1576  size_t bitSizeOf(size_t) const override
1577  {
1578  return zserio::bitSizeOfVarUInt(Base::getValue());
1579  }
1580 
1581  void write(BitStreamWriter& writer) const override
1582  {
1583  writer.writeVarSize(Base::getValue());
1584  }
1585 };
1586 
1590 template <typename ALLOC, typename T>
1592 {
1593 protected:
1594  static_assert(std::is_floating_point<T>::value, "T must be a floating point type!");
1595 
1598 
1599 public:
1600  double toDouble() const override
1601  {
1602  return static_cast<double>(getValue());
1603  }
1604 };
1605 
1609 template <typename ALLOC>
1611 {
1612 private:
1614 
1615 public:
1617  {
1619  }
1620 
1621  explicit Float16Reflectable(float value) :
1622  Base(typeInfo(), value)
1623  {}
1624 
1625  size_t bitSizeOf(size_t) const override
1626  {
1627  return 16;
1628  }
1629 
1630  void write(BitStreamWriter& writer) const override
1631  {
1632  writer.writeFloat16(Base::getValue());
1633  }
1634 
1635  float getFloat() const override
1636  {
1637  return Base::getValue();
1638  }
1639 };
1640 
1644 template <typename ALLOC>
1646 {
1647 private:
1649 
1650 public:
1652  {
1654  }
1655 
1656  explicit Float32Reflectable(float value) :
1657  Base(typeInfo(), value)
1658  {}
1659 
1660  size_t bitSizeOf(size_t) const override
1661  {
1662  return 32;
1663  }
1664 
1665  void write(BitStreamWriter& writer) const override
1666  {
1667  writer.writeFloat32(Base::getValue());
1668  }
1669 
1670  float getFloat() const override
1671  {
1672  return Base::getValue();
1673  }
1674 };
1675 
1679 template <typename ALLOC>
1681 {
1682 private:
1684 
1685 public:
1687  {
1689  }
1690 
1691  explicit Float64Reflectable(double value) :
1692  Base(typeInfo(), value)
1693  {}
1694 
1695  size_t bitSizeOf(size_t) const override
1696  {
1697  return 64;
1698  }
1699 
1700  void write(BitStreamWriter& writer) const override
1701  {
1702  writer.writeFloat64(Base::getValue());
1703  }
1704 
1705  double getDouble() const override
1706  {
1707  return Base::getValue();
1708  }
1709 };
1710 
1714 template <typename ALLOC>
1715 class BytesReflectable : public BuiltinReflectableBase<ALLOC, Span<const uint8_t>>
1716 {
1717 private:
1719 
1720 public:
1722  {
1724  }
1725 
1727  Base(typeInfo(), value)
1728  {}
1729 
1730  size_t bitSizeOf(size_t) const override
1731  {
1732  return zserio::bitSizeOfBytes(Base::getValue());
1733  }
1734 
1735  void write(BitStreamWriter& writer) const override
1736  {
1737  writer.writeBytes(Base::getValue());
1738  }
1739 
1741  {
1742  return Base::getValue();
1743  }
1744 };
1745 
1749 template <typename ALLOC>
1750 class StringReflectable : public BuiltinReflectableBase<ALLOC, StringView>
1751 {
1752 private:
1754 
1755 public:
1757  {
1759  }
1760 
1761  explicit StringReflectable(StringView value) :
1762  Base(typeInfo(), value)
1763  {}
1764 
1765  size_t bitSizeOf(size_t) const override
1766  {
1767  return zserio::bitSizeOfString(Base::getValue());
1768  }
1769 
1770  void write(BitStreamWriter& writer) const override
1771  {
1772  writer.writeString(Base::getValue());
1773  }
1774 
1775  StringView getStringView() const override
1776  {
1777  return Base::getValue();
1778  }
1779 
1780  string<ALLOC> toString(const ALLOC& allocator) const override
1781  {
1782  return zserio::toString(Base::getValue(), allocator);
1783  }
1784 };
1785 
1789 template <typename ALLOC>
1790 class BitBufferReflectable : public BuiltinReflectableBase<ALLOC, BasicBitBuffer<ALLOC>>
1791 {
1792 private:
1794 
1795 public:
1797  {
1799  }
1800 
1802  Base(typeInfo(), value)
1803  {}
1804 
1805  size_t bitSizeOf(size_t) const override
1806  {
1807  return zserio::bitSizeOfBitBuffer(Base::getValue());
1808  }
1809 
1810  void write(BitStreamWriter& writer) const override
1811  {
1812  writer.writeBitBuffer(Base::getValue());
1813  }
1814 
1815  const BasicBitBuffer<ALLOC>& getBitBuffer() const override
1816  {
1817  return Base::getValue();
1818  }
1819 };
1820 
1821 namespace detail
1822 {
1823 
1824 template <typename ALLOC>
1825 IBasicReflectableConstPtr<ALLOC> getFieldFromObject(const IBasicReflectable<ALLOC>& object, StringView name)
1826 {
1827  const auto& typeInfo = object.getTypeInfo();
1828  if (TypeInfoUtil::isCompound(typeInfo.getSchemaType()))
1829  {
1830  const auto& fields = typeInfo.getFields();
1831  auto fieldsIt = std::find_if(fields.begin(), fields.end(),
1832  [name](const BasicFieldInfo<ALLOC>& fieldInfo) { return fieldInfo.schemaName == name; });
1833  if (fieldsIt != fields.end())
1834  return object.getField(name);
1835  }
1836 
1837  return nullptr;
1838 }
1839 
1840 template <typename ALLOC>
1841 IBasicReflectablePtr<ALLOC> getFieldFromObject(IBasicReflectable<ALLOC>& object, StringView name)
1842 {
1843  const auto& typeInfo = object.getTypeInfo();
1844  if (TypeInfoUtil::isCompound(typeInfo.getSchemaType()))
1845  {
1846  const auto& fields = typeInfo.getFields();
1847  auto fieldsIt = std::find_if(fields.begin(), fields.end(),
1848  [name](const BasicFieldInfo<ALLOC>& fieldInfo) { return fieldInfo.schemaName == name; });
1849  if (fieldsIt != fields.end())
1850  return object.getField(name);
1851  }
1852 
1853  return nullptr;
1854 }
1855 
1856 template <typename ALLOC>
1857 IBasicReflectableConstPtr<ALLOC> getParameterFromObject(const IBasicReflectable<ALLOC>& object, StringView name)
1858 {
1859  const auto& typeInfo = object.getTypeInfo();
1860  if (TypeInfoUtil::isCompound(typeInfo.getSchemaType()))
1861  {
1862  const auto& parameters = typeInfo.getParameters();
1863  auto parametersIt = std::find_if(parameters.begin(), parameters.end(),
1864  [name](const BasicParameterInfo<ALLOC>& parameterInfo)
1865  { return parameterInfo.schemaName == name; });
1866  if (parametersIt != parameters.end())
1867  return object.getParameter(name);
1868  }
1869 
1870  return nullptr;
1871 }
1872 
1873 template <typename ALLOC>
1874 IBasicReflectablePtr<ALLOC> getParameterFromObject(IBasicReflectable<ALLOC>& object, StringView name)
1875 {
1876  const auto& typeInfo = object.getTypeInfo();
1877  if (TypeInfoUtil::isCompound(typeInfo.getSchemaType()))
1878  {
1879  const auto& parameters = typeInfo.getParameters();
1880  auto parametersIt = std::find_if(parameters.begin(), parameters.end(),
1881  [name](const BasicParameterInfo<ALLOC>& parameterInfo)
1882  { return parameterInfo.schemaName == name; });
1883  if (parametersIt != parameters.end())
1884  return object.getParameter(name);
1885  }
1886 
1887  return nullptr;
1888 }
1889 
1890 template <typename ALLOC>
1891 IBasicReflectableConstPtr<ALLOC> callFunctionInObject(const IBasicReflectable<ALLOC>& object, StringView name)
1892 {
1893  const auto& typeInfo = object.getTypeInfo();
1894  if (TypeInfoUtil::isCompound(typeInfo.getSchemaType()))
1895  {
1896  const auto& functions = typeInfo.getFunctions();
1897  auto functionsIt = std::find_if(functions.begin(), functions.end(),
1898  [name](const BasicFunctionInfo<ALLOC>& functionInfo)
1899  { return functionInfo.schemaName == name; });
1900  if (functionsIt != functions.end())
1901  return object.callFunction(name);
1902  }
1903 
1904  return nullptr;
1905 }
1906 
1907 template <typename ALLOC>
1908 IBasicReflectablePtr<ALLOC> callFunctionInObject(IBasicReflectable<ALLOC>& object, StringView name)
1909 {
1910  const auto& typeInfo = object.getTypeInfo();
1911  if (TypeInfoUtil::isCompound(typeInfo.getSchemaType()))
1912  {
1913  const auto& functions = typeInfo.getFunctions();
1914  auto functionsIt = std::find_if(functions.begin(), functions.end(),
1915  [name](const BasicFunctionInfo<ALLOC>& functionInfo)
1916  {
1917  return functionInfo.schemaName == name;
1918  }
1919  );
1920  if (functionsIt != functions.end())
1921  return object.callFunction(name);
1922  }
1923 
1924  return nullptr;
1925 }
1926 
1927 template <typename ALLOC>
1928 IBasicReflectableConstPtr<ALLOC> getFromObject(
1929  const IBasicReflectable<ALLOC>& object, StringView path, size_t pos)
1930 {
1931  try
1932  {
1933  const size_t dotPos = path.find('.', pos);
1934  const bool isLast = dotPos == StringView::npos;
1935  const StringView name = path.substr(pos, dotPos == StringView::npos ? StringView::npos : dotPos - pos);
1936 
1937  auto field = getFieldFromObject(object, name);
1938  if (field)
1939  return isLast ? field : getFromObject(*field, path, dotPos + 1);
1940 
1941  auto parameter = getParameterFromObject(object, name);
1942  if (parameter)
1943  return isLast ? parameter : getFromObject(*parameter, path, dotPos + 1);
1944 
1945  auto functionResult = callFunctionInObject(object, name);
1946  if (functionResult)
1947  return isLast ? functionResult : getFromObject(*functionResult, path, dotPos + 1);
1948  }
1949  catch (const CppRuntimeException&)
1950  {}
1951 
1952  return nullptr;
1953 }
1954 
1955 template <typename ALLOC>
1956 IBasicReflectablePtr<ALLOC> getFromObject(IBasicReflectable<ALLOC>& object, StringView path, size_t pos)
1957 {
1958  try
1959  {
1960  const size_t dotPos = path.find('.', pos);
1961  const bool isLast = dotPos == StringView::npos;
1962  const StringView name = path.substr(pos, dotPos == StringView::npos ? StringView::npos : dotPos - pos);
1963 
1964  auto field = getFieldFromObject(object, name);
1965  if (field)
1966  return isLast ? field : getFromObject(*field, path, dotPos + 1);
1967 
1968  auto parameter = getParameterFromObject(object, name);
1969  if (parameter)
1970  return isLast ? parameter : getFromObject(*parameter, path, dotPos + 1);
1971 
1972  auto functionResult = callFunctionInObject(object, name);
1973  if (functionResult)
1974  return isLast ? functionResult : getFromObject(*functionResult, path, dotPos + 1);
1975  }
1976  catch (const CppRuntimeException&)
1977  {}
1978 
1979  return nullptr;
1980 }
1981 
1982 } // namespace detail
1983 
1987 template <typename ALLOC>
1989 {
1990 public:
1991  ReflectableAllocatorHolderBase(const IBasicTypeInfo<ALLOC>& typeInfo, const ALLOC& allocator) :
1992  ReflectableBase<ALLOC>(typeInfo), AllocatorHolder<ALLOC>(allocator)
1993  {}
1994 };
1995 
2001 template <typename ALLOC>
2003 {
2004 private:
2006 
2007 public:
2008  using Base::Base;
2009  using Base::getTypeInfo;
2010 
2011  void initializeChildren() override;
2012  void initialize(const vector<AnyHolder<ALLOC>, ALLOC>& typeArguments) override;
2013  size_t initializeOffsets(size_t bitPosition) override;
2014 
2016  void setField(StringView name, const AnyHolder<ALLOC>& value) override;
2019 
2020  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override;
2021 };
2022 
2028 template <typename ALLOC>
2030 {
2031 private:
2033 
2034 public:
2035  using Base::Base;
2036  using Base::getTypeInfo;
2037 
2038  bool isArray() const override
2039  {
2040  return true;
2041  }
2042 
2043  void initializeChildren() override;
2044  void initialize(const vector<AnyHolder<ALLOC>, ALLOC>& typeArguments) override;
2045  size_t initializeOffsets(size_t bitPosition) override;
2046  size_t bitSizeOf(size_t bitPosition) const override;
2047  void write(BitStreamWriter& writer) const override;
2048 
2052  void setField(StringView name, const AnyHolder<ALLOC>& value) override;
2057 
2058  StringView getChoice() const override;
2059 
2060  IBasicReflectableConstPtr<ALLOC> operator[](size_t index) const override;
2061  IBasicReflectablePtr<ALLOC> operator[](size_t index) override;
2062 
2063  bool getBool() const override;
2064  int8_t getInt8() const override;
2065  int16_t getInt16() const override;
2066  int32_t getInt32() const override;
2067  int64_t getInt64() const override;
2068  uint8_t getUInt8() const override;
2069  uint16_t getUInt16() const override;
2070  uint32_t getUInt32() const override;
2071  uint64_t getUInt64() const override;
2072  float getFloat() const override;
2073  double getDouble() const override;
2074  Span<const uint8_t> getBytes() const override;
2075  StringView getStringView() const override;
2076  const BasicBitBuffer<ALLOC>& getBitBuffer() const override;
2077 
2078  int64_t toInt() const override;
2079  uint64_t toUInt() const override;
2080  double toDouble() const override;
2081  string<ALLOC> toString(const ALLOC& allocator) const override;
2082 };
2083 
2089 template <typename ALLOC>
2091 {
2092 private:
2094 
2095 public:
2096  using Base::Base;
2097  using Base::getTypeInfo;
2098 
2099  void resize(size_t index) override;
2100  IBasicReflectablePtr<ALLOC> at(size_t index) override;
2101  IBasicReflectablePtr<ALLOC> operator[](size_t index) override;
2102  void setAt(const AnyHolder<ALLOC>& value, size_t index) override;
2103  void append(const AnyHolder<ALLOC>& value) override;
2104 
2105  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override;
2106 };
2107 
2112 template <typename ALLOC, typename RAW_ARRAY, typename ELEMENT_REFLECTABLE>
2114 {
2115 private:
2117 
2118  using ElementReflectable = ELEMENT_REFLECTABLE;
2119 
2120 public:
2121  using Base::getTypeInfo;
2122  using Base::at;
2123  using Base::operator[];
2124  using Base::getAnyValue;
2125 
2126  BuiltinReflectableConstArray(const ALLOC& allocator, const RAW_ARRAY& rawArray) :
2127  Base(ElementReflectable::typeInfo(), allocator), m_rawArray(rawArray)
2128  {}
2129 
2130  size_t size() const override
2131  {
2132  return m_rawArray.size();
2133  }
2134 
2135  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2136  {
2137  if (index >= size())
2138  {
2139  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2140  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2141  }
2142 
2143  return std::allocate_shared<ElementReflectable>(Base::get_allocator(), m_rawArray[index]);
2144  }
2145 
2146  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2147  {
2148  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2149  }
2150 
2151 private:
2152  const RAW_ARRAY& m_rawArray;
2153 };
2154 
2155 template <typename ALLOC, typename RAW_ARRAY, typename ELEMENT_REFLECTABLE>
2157 {
2158 private:
2160 
2161  using ElementReflectable = ELEMENT_REFLECTABLE;
2162 
2163 public:
2164  using Base::getTypeInfo;
2165 
2166  BuiltinReflectableArray(const ALLOC& allocator, RAW_ARRAY& rawArray) :
2167  Base(ElementReflectable::typeInfo(), allocator), m_rawArray(rawArray)
2168  {}
2169 
2170  size_t size() const override
2171  {
2172  return m_rawArray.size();
2173  }
2174 
2175  void resize(size_t size) override
2176  {
2177  m_rawArray.resize(size);
2178  }
2179 
2180  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2181  {
2182  if (index >= size())
2183  {
2184  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2185  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2186  }
2187 
2188  return std::allocate_shared<ElementReflectable>(Base::get_allocator(), m_rawArray[index]);
2189  }
2190 
2191  IBasicReflectablePtr<ALLOC> at(size_t index) override
2192  {
2193  if (index >= size())
2194  {
2195  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2196  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2197  }
2198 
2199  return std::allocate_shared<ElementReflectable>(Base::get_allocator(), m_rawArray[index]);
2200  }
2201 
2202  void setAt(const AnyHolder<ALLOC>& value, size_t index) override
2203  {
2204  if (index >= size())
2205  {
2206  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2207  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2208  }
2209 
2210  m_rawArray[index] = value.template get<typename RAW_ARRAY::value_type>();
2211  }
2212 
2213  void append(const AnyHolder<ALLOC>& value) override
2214  {
2215  m_rawArray.push_back(value.template get<typename RAW_ARRAY::value_type>());
2216  }
2217 
2218  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2219  {
2220  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2221  }
2222 
2223  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override
2224  {
2225  return AnyHolder<ALLOC>(std::ref(m_rawArray), allocator);
2226  }
2227 
2228 private:
2229  RAW_ARRAY& m_rawArray;
2230 };
2237 template <typename ALLOC, typename RAW_ARRAY, typename ELEMENT_REFLECTABLE>
2239 {
2240 private:
2242 
2243  using ElementReflectable = ELEMENT_REFLECTABLE;
2244 
2245 public:
2246  using Base::getTypeInfo;
2247  using Base::at;
2248  using Base::operator[];
2249  using Base::getAnyValue;
2250 
2251  FixedBitFieldReflectableConstArray(const ALLOC& allocator, const RAW_ARRAY& rawArray, uint8_t bitSize) :
2252  Base(ElementReflectable::typeInfo(bitSize), allocator), m_rawArray(rawArray)
2253  {}
2254 
2255  size_t size() const override
2256  {
2257  return m_rawArray.size();
2258  }
2259 
2260  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2261  {
2262  if (index >= size())
2263  {
2264  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2265  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2266  }
2267 
2268  return std::allocate_shared<ElementReflectable>(
2269  Base::get_allocator(), m_rawArray[index], getTypeInfo().getBitSize());
2270  }
2271 
2272  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2273  {
2274  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2275  }
2276 
2277 private:
2278  const RAW_ARRAY& m_rawArray;
2279 };
2280 
2281 template <typename ALLOC, typename RAW_ARRAY, typename ELEMENT_REFLECTABLE>
2283 {
2284 private:
2286 
2287  using ElementReflectable = ELEMENT_REFLECTABLE;
2288 
2289 public:
2290  using Base::getTypeInfo;
2291 
2292  FixedBitFieldReflectableArray(const ALLOC& allocator, RAW_ARRAY& rawArray, uint8_t bitSize) :
2293  Base(ElementReflectable::typeInfo(bitSize), allocator), m_rawArray(rawArray)
2294  {}
2295 
2296  size_t size() const override
2297  {
2298  return m_rawArray.size();
2299  }
2300 
2301  void resize(size_t size) override
2302  {
2303  m_rawArray.resize(size);
2304  }
2305 
2306  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2307  {
2308  if (index >= size())
2309  {
2310  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2311  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2312  }
2313 
2314  return std::allocate_shared<ElementReflectable>(
2315  Base::get_allocator(), m_rawArray[index], getTypeInfo().getBitSize());
2316  }
2317 
2318  IBasicReflectablePtr<ALLOC> at(size_t index) override
2319  {
2320  if (index >= size())
2321  {
2322  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2323  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2324  }
2325 
2326  return std::allocate_shared<ElementReflectable>(
2327  Base::get_allocator(), m_rawArray[index], getTypeInfo().getBitSize());
2328  }
2329 
2330  void setAt(const AnyHolder<ALLOC>& value, size_t index) override
2331  {
2332  if (index >= size())
2333  {
2334  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2335  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2336  }
2337 
2338  m_rawArray[index] = value.template get<typename RAW_ARRAY::value_type>();
2339  }
2340 
2341  void append(const AnyHolder<ALLOC>& value) override
2342  {
2343  m_rawArray.push_back(value.template get<typename RAW_ARRAY::value_type>());
2344  }
2345 
2346  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2347  {
2348  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2349  }
2350 
2351  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override
2352  {
2353  return AnyHolder<ALLOC>(std::ref(m_rawArray), allocator);
2354  }
2355 
2356 private:
2357  RAW_ARRAY& m_rawArray;
2358 };
2365 template <typename ALLOC, typename RAW_ARRAY, typename ELEMENT_REFLECTABLE>
2367 {
2368 private:
2370 
2371  using ElementReflectable = ELEMENT_REFLECTABLE;
2372 
2373 public:
2374  using Base::getTypeInfo;
2375  using Base::at;
2376  using Base::operator[];
2377  using Base::getAnyValue;
2378 
2380  const RAW_ARRAY& rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize) :
2381  Base(ElementReflectable::typeInfo(maxBitSize), allocator),
2382  m_rawArray(rawArray), m_maxBitSize(maxBitSize), m_dynamicBitSize(dynamicBitSize)
2383  {}
2384 
2385  size_t size() const override
2386  {
2387  return m_rawArray.size();
2388  }
2389 
2390  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2391  {
2392  if (index >= size())
2393  {
2394  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2395  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2396  }
2397 
2398  return std::allocate_shared<ElementReflectable>(
2399  Base::get_allocator(), m_rawArray[index], m_maxBitSize, m_dynamicBitSize);
2400  }
2401 
2402  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2403  {
2404  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2405  }
2406 
2407 private:
2408  const RAW_ARRAY& m_rawArray;
2409  const uint8_t m_maxBitSize;
2410  const uint8_t m_dynamicBitSize;
2411 };
2412 
2413 template <typename ALLOC, typename RAW_ARRAY, typename ELEMENT_REFLECTABLE>
2415 {
2416 private:
2418 
2419  using ElementReflectable = ELEMENT_REFLECTABLE;
2420 
2421 public:
2422  using Base::getTypeInfo;
2423 
2424  DynamicBitFieldReflectableArray(const ALLOC& allocator,
2425  RAW_ARRAY& rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize) :
2426  Base(ElementReflectable::typeInfo(maxBitSize), allocator),
2427  m_rawArray(rawArray), m_maxBitSize(maxBitSize), m_dynamicBitSize(dynamicBitSize)
2428  {}
2429 
2430  size_t size() const override
2431  {
2432  return m_rawArray.size();
2433  }
2434 
2435  void resize(size_t size) override
2436  {
2437  m_rawArray.resize(size);
2438  }
2439 
2440  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2441  {
2442  if (index >= size())
2443  {
2444  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2445  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2446  }
2447 
2448  return std::allocate_shared<ElementReflectable>(
2449  Base::get_allocator(), m_rawArray[index], m_maxBitSize, m_dynamicBitSize);
2450  }
2451 
2452  IBasicReflectablePtr<ALLOC> at(size_t index) override
2453  {
2454  if (index >= size())
2455  {
2456  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2457  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2458  }
2459 
2460  return std::allocate_shared<ElementReflectable>(
2461  Base::get_allocator(), m_rawArray[index], m_maxBitSize, m_dynamicBitSize);
2462  }
2463 
2464  void setAt(const AnyHolder<ALLOC>& value, size_t index) override
2465  {
2466  if (index >= size())
2467  {
2468  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2469  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2470  }
2471 
2472  m_rawArray[index] = value.template get<typename RAW_ARRAY::value_type>();
2473  }
2474 
2475  void append(const AnyHolder<ALLOC>& value) override
2476  {
2477  m_rawArray.push_back(value.template get<typename RAW_ARRAY::value_type>());
2478  }
2479 
2480  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2481  {
2482  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2483  }
2484 
2485  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override
2486  {
2487  return AnyHolder<ALLOC>(std::ref(m_rawArray), allocator);
2488  }
2489 
2490 private:
2491  RAW_ARRAY& m_rawArray;
2492  const uint8_t m_maxBitSize;
2493  const uint8_t m_dynamicBitSize;
2494 };
2501 template <typename ALLOC, typename RAW_ARRAY>
2503 template <typename ALLOC, typename RAW_ARRAY>
2505 
2506 template <typename ALLOC, typename RAW_ARRAY>
2508 template <typename ALLOC, typename RAW_ARRAY>
2510 
2511 template <typename ALLOC, typename RAW_ARRAY>
2513 template <typename ALLOC, typename RAW_ARRAY>
2515 
2516 template <typename ALLOC, typename RAW_ARRAY>
2518 template <typename ALLOC, typename RAW_ARRAY>
2520 
2521 template <typename ALLOC, typename RAW_ARRAY>
2523 template <typename ALLOC, typename RAW_ARRAY>
2525 
2526 template <typename ALLOC, typename RAW_ARRAY>
2528 template <typename ALLOC, typename RAW_ARRAY>
2530 
2531 template <typename ALLOC, typename RAW_ARRAY>
2533 template <typename ALLOC, typename RAW_ARRAY>
2535 
2536 template <typename ALLOC, typename RAW_ARRAY>
2538 template <typename ALLOC, typename RAW_ARRAY>
2540 
2541 template <typename ALLOC, typename RAW_ARRAY>
2543 template <typename ALLOC, typename RAW_ARRAY>
2545 
2546 template <typename ALLOC, typename RAW_ARRAY>
2549 template <typename ALLOC, typename RAW_ARRAY>
2552 
2553 template <typename ALLOC, typename RAW_ARRAY>
2556 template <typename ALLOC, typename RAW_ARRAY>
2559 
2560 template <typename ALLOC, typename RAW_ARRAY>
2563 template <typename ALLOC, typename RAW_ARRAY>
2566 
2567 template <typename ALLOC, typename RAW_ARRAY>
2570 template <typename ALLOC, typename RAW_ARRAY>
2573 
2574 template <typename ALLOC, typename RAW_ARRAY>
2577 template <typename ALLOC, typename RAW_ARRAY>
2579 
2580 template <typename ALLOC, typename RAW_ARRAY>
2583 template <typename ALLOC, typename RAW_ARRAY>
2585 
2586 template <typename ALLOC, typename RAW_ARRAY>
2589 template <typename ALLOC, typename RAW_ARRAY>
2591 
2592 template <typename ALLOC, typename RAW_ARRAY>
2594 template <typename ALLOC, typename RAW_ARRAY>
2596 
2597 template <typename ALLOC, typename RAW_ARRAY>
2600 template <typename ALLOC, typename RAW_ARRAY>
2602 
2603 template <typename ALLOC, typename RAW_ARRAY>
2606 template <typename ALLOC, typename RAW_ARRAY>
2608 
2609 template <typename ALLOC, typename RAW_ARRAY>
2612 template <typename ALLOC, typename RAW_ARRAY>
2614 
2615 template <typename ALLOC, typename RAW_ARRAY>
2618 template <typename ALLOC, typename RAW_ARRAY>
2620 
2621 template <typename ALLOC, typename RAW_ARRAY>
2624 template <typename ALLOC, typename RAW_ARRAY>
2626 
2627 template <typename ALLOC, typename RAW_ARRAY>
2630 template <typename ALLOC, typename RAW_ARRAY>
2632 
2633 template <typename ALLOC, typename RAW_ARRAY>
2636 template <typename ALLOC, typename RAW_ARRAY>
2638 
2639 template <typename ALLOC, typename RAW_ARRAY>
2642 template <typename ALLOC, typename RAW_ARRAY>
2644 
2645 template <typename ALLOC, typename RAW_ARRAY>
2648 template <typename ALLOC, typename RAW_ARRAY>
2650 
2651 template <typename ALLOC, typename RAW_ARRAY>
2654 template <typename ALLOC, typename RAW_ARRAY>
2656 
2657 template <typename ALLOC, typename RAW_ARRAY>
2660 template <typename ALLOC, typename RAW_ARRAY>
2668 template <typename ALLOC, typename RAW_ARRAY>
2670 {
2671 private:
2673 
2674  using ElementType = typename RAW_ARRAY::value_type;
2675 
2676 public:
2677  using Base::getTypeInfo;
2678  using Base::at;
2679  using Base::operator[];
2680  using Base::getAnyValue;
2681 
2682  CompoundReflectableConstArray(const ALLOC& allocator, const RAW_ARRAY& rawArray) :
2683  Base(ElementType::typeInfo(), allocator), m_rawArray(rawArray)
2684  {}
2685 
2686  size_t size() const override
2687  {
2688  return m_rawArray.size();
2689  }
2690 
2691  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2692  {
2693  if (index >= size())
2694  {
2695  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2696  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2697  }
2698 
2699  return m_rawArray[index].reflectable(Base::get_allocator());
2700  }
2701 
2702  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2703  {
2704  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2705  }
2706 
2707 private:
2708  const RAW_ARRAY& m_rawArray;
2709 };
2710 
2711 template <typename ALLOC, typename RAW_ARRAY>
2713 {
2714 private:
2716 
2717  using ElementType = typename RAW_ARRAY::value_type;
2718 
2719 public:
2720  using Base::getTypeInfo;
2721 
2722  CompoundReflectableArray(const ALLOC& allocator, RAW_ARRAY& rawArray) :
2723  Base(ElementType::typeInfo(), allocator), m_rawArray(rawArray)
2724  {}
2725 
2726  size_t size() const override
2727  {
2728  return m_rawArray.size();
2729  }
2730 
2731  void resize(size_t size) override
2732  {
2733  m_rawArray.resize(size);
2734  }
2735 
2736  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2737  {
2738  if (index >= size())
2739  {
2740  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2741  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2742  }
2743 
2744  return m_rawArray[index].reflectable(Base::get_allocator());
2745  }
2746 
2747  IBasicReflectablePtr<ALLOC> at(size_t index) override
2748  {
2749  if (index >= size())
2750  {
2751  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2752  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2753  }
2754 
2755  return m_rawArray[index].reflectable(Base::get_allocator());
2756  }
2757 
2758  void setAt(const AnyHolder<ALLOC>& value, size_t index) override
2759  {
2760  if (index >= size())
2761  {
2762  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2763  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2764  }
2765 
2766  m_rawArray[index] = value.template get<typename RAW_ARRAY::value_type>();
2767  }
2768 
2769  void append(const AnyHolder<ALLOC>& value) override
2770  {
2771  m_rawArray.push_back(value.template get<typename RAW_ARRAY::value_type>());
2772  }
2773 
2774  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2775  {
2776  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2777  }
2778 
2779  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override
2780  {
2781  return AnyHolder<ALLOC>(std::ref(m_rawArray), allocator);
2782  }
2783 
2784 private:
2785  RAW_ARRAY& m_rawArray;
2786 };
2791 template <typename ALLOC, typename RAW_ARRAY>
2793 {
2794 private:
2796 
2797  using ElementType = typename RAW_ARRAY::value_type;
2798 
2799 public:
2800  using Base::getTypeInfo;
2801  using Base::at;
2802  using Base::operator[];
2803  using Base::getAnyValue;
2804 
2805  BitmaskReflectableConstArray(const ALLOC& allocator, const RAW_ARRAY& rawArray) :
2806  Base(ElementType::typeInfo(), allocator), m_rawArray(rawArray)
2807  {}
2808 
2809  size_t size() const override
2810  {
2811  return m_rawArray.size();
2812  }
2813 
2814  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2815  {
2816  if (index >= size())
2817  {
2818  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2819  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2820  }
2821 
2822  return m_rawArray[index].reflectable(Base::get_allocator());
2823  }
2824 
2825  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2826  {
2827  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2828  }
2829 
2830 private:
2831  const RAW_ARRAY& m_rawArray;
2832 };
2833 
2834 template <typename ALLOC, typename RAW_ARRAY>
2836 {
2837 private:
2839 
2840  using ElementType = typename RAW_ARRAY::value_type;
2841  using UnderlyingElementType = typename ElementType::underlying_type;
2842 
2843 public:
2844  using Base::getTypeInfo;
2845 
2846  BitmaskReflectableArray(const ALLOC& allocator, RAW_ARRAY& rawArray) :
2847  Base(ElementType::typeInfo(), allocator), m_rawArray(rawArray)
2848  {}
2849 
2850  size_t size() const override
2851  {
2852  return m_rawArray.size();
2853  }
2854 
2855  void resize(size_t size) override
2856  {
2857  m_rawArray.resize(size);
2858  }
2859 
2860  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2861  {
2862  if (index >= size())
2863  {
2864  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2865  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2866  }
2867 
2868  return m_rawArray[index].reflectable(Base::get_allocator());
2869  }
2870 
2871  IBasicReflectablePtr<ALLOC> at(size_t index) override
2872  {
2873  if (index >= size())
2874  {
2875  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2876  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2877  }
2878 
2879  return m_rawArray[index].reflectable(Base::get_allocator());
2880  }
2881 
2882  void setAt(const AnyHolder<ALLOC>& value, size_t index) override
2883  {
2884  if (index >= size())
2885  {
2886  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2887  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2888  }
2889 
2890  if (value.template isType<ElementType>())
2891  m_rawArray[index] = value.template get<ElementType>();
2892  else
2893  m_rawArray[index] = ElementType(value.template get<UnderlyingElementType>());
2894  }
2895 
2896  void append(const AnyHolder<ALLOC>& value) override
2897  {
2898  if (value.template isType<ElementType>())
2899  m_rawArray.push_back(value.template get<ElementType>());
2900  else
2901  m_rawArray.push_back(ElementType(value.template get<UnderlyingElementType>()));
2902  }
2903 
2904  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2905  {
2906  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2907  }
2908 
2909  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override
2910  {
2911  return AnyHolder<ALLOC>(std::ref(m_rawArray), allocator);
2912  }
2913 
2914 private:
2915  RAW_ARRAY& m_rawArray;
2916 };
2921 template <typename ALLOC, typename RAW_ARRAY>
2923 {
2924 private:
2926 
2927  using ElementType = typename RAW_ARRAY::value_type;
2928 
2929 public:
2930  using Base::getTypeInfo;
2931  using Base::at;
2932  using Base::operator[];
2933  using Base::getAnyValue;
2934 
2935  EnumReflectableConstArray(const ALLOC& allocator, const RAW_ARRAY& rawArray) :
2936  Base(enumTypeInfo<ElementType, ALLOC>(), allocator), m_rawArray(rawArray)
2937  {}
2938 
2939  size_t size() const override
2940  {
2941  return m_rawArray.size();
2942  }
2943 
2944  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2945  {
2946  if (index >= size())
2947  {
2948  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2949  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2950  }
2951 
2952  return enumReflectable(m_rawArray[index], Base::get_allocator());
2953  }
2954 
2955  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
2956  {
2957  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
2958  }
2959 
2960 private:
2961  const RAW_ARRAY& m_rawArray;
2962 };
2963 
2964 template <typename ALLOC, typename RAW_ARRAY>
2966 {
2967 private:
2969 
2970  using ElementType = typename RAW_ARRAY::value_type;
2971  using UnderlyingElementType = typename std::underlying_type<ElementType>::type;
2972 
2973 public:
2974  using Base::getTypeInfo;
2975 
2976  EnumReflectableArray(const ALLOC& allocator, RAW_ARRAY& rawArray) :
2977  Base(enumTypeInfo<ElementType, ALLOC>(), allocator), m_rawArray(rawArray)
2978  {}
2979 
2980  size_t size() const override
2981  {
2982  return m_rawArray.size();
2983  }
2984 
2985  void resize(size_t size) override
2986  {
2987  m_rawArray.resize(size);
2988  }
2989 
2990  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
2991  {
2992  if (index >= size())
2993  {
2994  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
2995  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
2996  }
2997 
2998  return enumReflectable(m_rawArray[index], Base::get_allocator());
2999  }
3000 
3001  IBasicReflectablePtr<ALLOC> at(size_t index) override
3002  {
3003  if (index >= size())
3004  {
3005  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
3006  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
3007  }
3008 
3009  return enumReflectable(m_rawArray[index], Base::get_allocator());
3010  }
3011 
3012  void setAt(const AnyHolder<ALLOC>& value, size_t index) override
3013  {
3014  if (index >= size())
3015  {
3016  throw CppRuntimeException("Index ") << index << " out of range for reflectable array '" <<
3017  getTypeInfo().getSchemaName() << "' of size " << size() << "!";
3018  }
3019 
3020  if (value.template isType<ElementType>())
3021  m_rawArray[index] = value.template get<ElementType>();
3022  else
3023  m_rawArray[index] = valueToEnum<ElementType>(value.template get<UnderlyingElementType>());
3024  }
3025 
3026  void append(const AnyHolder<ALLOC>& value) override
3027  {
3028  if (value.template isType<ElementType>())
3029  m_rawArray.push_back(value.template get<ElementType>());
3030  else
3031  m_rawArray.push_back(valueToEnum<ElementType>(value.template get<UnderlyingElementType>()));
3032  }
3033 
3034  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
3035  {
3036  return AnyHolder<ALLOC>(std::cref(m_rawArray), allocator);
3037  }
3038 
3039  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override
3040  {
3041  return AnyHolder<ALLOC>(std::ref(m_rawArray), allocator);
3042  }
3043 
3044 private:
3045  RAW_ARRAY& m_rawArray;
3046 };
3054 template <typename T, typename ALLOC = typename T::allocator_type>
3056 {
3057 public:
3059  ReflectableOwner(ALLOC())
3060  {}
3061 
3062  explicit ReflectableOwner(const ALLOC& allocator) :
3063  m_object(allocator),
3064  m_reflectable(m_object.reflectable(allocator))
3065  {}
3066 
3067  const IBasicTypeInfo<ALLOC>& getTypeInfo() const override
3068  {
3069  return m_reflectable->getTypeInfo();
3070  }
3071 
3072  bool isArray() const override
3073  {
3074  return m_reflectable->isArray();
3075  }
3076 
3077  void initializeChildren() override
3078  {
3079  m_reflectable->initializeChildren();
3080  }
3081 
3082  void initialize(const vector<AnyHolder<ALLOC>, ALLOC>& typeArguments) override
3083  {
3084  m_reflectable->initialize(typeArguments);
3085  }
3086 
3087  size_t initializeOffsets(size_t bitPosition) override
3088  {
3089  return m_reflectable->initializeOffsets(bitPosition);
3090  }
3091 
3092  size_t initializeOffsets() override
3093  {
3094  return initializeOffsets(0);
3095  }
3096 
3097  size_t bitSizeOf(size_t bitPosition) const override
3098  {
3099  return m_reflectable->bitSizeOf(bitPosition);
3100  }
3101 
3102  size_t bitSizeOf() const override
3103  {
3104  return bitSizeOf(0);
3105  }
3106 
3107  void write(BitStreamWriter& writer) const override
3108  {
3109  m_reflectable->write(writer);
3110  }
3111 
3113  {
3114  return m_reflectable->getField(name);
3115  }
3116 
3118  {
3119  return m_reflectable->getField(name);
3120  }
3121 
3123  {
3124  return m_reflectable->createField(name);
3125  }
3126 
3127  void setField(StringView name, const AnyHolder<ALLOC>& value) override
3128  {
3129  m_reflectable->setField(name, value);
3130  }
3131 
3133  {
3134  return m_reflectable->getParameter(name);
3135  }
3136 
3138  {
3139  return m_reflectable->getParameter(name);
3140  }
3141 
3143  {
3144  return m_reflectable->callFunction(name);
3145  }
3146 
3148  {
3149  return m_reflectable->callFunction(name);
3150  }
3151 
3152  StringView getChoice() const override
3153  {
3154  return m_reflectable->getChoice();
3155  }
3156 
3158  {
3159  return m_reflectable->find(path);
3160  }
3161 
3163  {
3164  return m_reflectable->find(path);
3165  }
3166 
3168  {
3169  return m_reflectable->operator[](path);
3170  }
3171 
3173  {
3174  return m_reflectable->operator[](path);
3175  }
3176 
3177  size_t size() const override
3178  {
3179  return m_reflectable->size();
3180  }
3181 
3182  void resize(size_t size) override
3183  {
3184  m_reflectable->resize(size);
3185  }
3186 
3187  IBasicReflectableConstPtr<ALLOC> at(size_t index) const override
3188  {
3189  return m_reflectable->at(index);
3190  }
3191 
3192  IBasicReflectablePtr<ALLOC> at(size_t index) override
3193  {
3194  return m_reflectable->at(index);
3195  }
3196 
3197  IBasicReflectableConstPtr<ALLOC> operator[](size_t index) const override
3198  {
3199  return m_reflectable->operator[](index);
3200  }
3201 
3203  {
3204  return m_reflectable->operator[](index);
3205  }
3206 
3207  void setAt(const AnyHolder<ALLOC>& value, size_t index) override
3208  {
3209  m_reflectable->setAt(value, index);
3210  }
3211 
3212  void append(const AnyHolder<ALLOC>& value) override
3213  {
3214  m_reflectable->append(value);
3215  }
3216 
3217  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) const override
3218  {
3219  return m_reflectable->getAnyValue(allocator);
3220  }
3221 
3222  AnyHolder<ALLOC> getAnyValue(const ALLOC& allocator) override
3223  {
3224  return m_reflectable->getAnyValue(allocator);
3225  }
3226 
3228  {
3229  return getAnyValue(ALLOC());
3230  }
3231 
3233  {
3234  return getAnyValue(ALLOC());
3235  }
3236 
3237  // exact checked getters
3238  bool getBool() const override { return m_reflectable->getBool(); }
3239  int8_t getInt8() const override { return m_reflectable->getInt8(); }
3240  int16_t getInt16() const override { return m_reflectable->getInt16(); }
3241  int32_t getInt32() const override { return m_reflectable->getInt32(); }
3242  int64_t getInt64() const override { return m_reflectable->getInt64(); }
3243  uint8_t getUInt8() const override { return m_reflectable->getUInt8(); }
3244  uint16_t getUInt16() const override { return m_reflectable->getUInt16(); }
3245  uint32_t getUInt32() const override { return m_reflectable->getUInt32(); }
3246  uint64_t getUInt64() const override { return m_reflectable->getUInt64(); }
3247  float getFloat() const override { return m_reflectable->getFloat(); }
3248  double getDouble() const override { return m_reflectable->getDouble(); }
3249  Span<const uint8_t> getBytes() const override { return m_reflectable->getBytes(); }
3250  StringView getStringView() const override { return m_reflectable->getStringView(); }
3251  const BasicBitBuffer<ALLOC>& getBitBuffer() const override { return m_reflectable->getBitBuffer(); }
3252 
3253  // convenience conversions
3254  int64_t toInt() const override { return m_reflectable->toInt(); }
3255  uint64_t toUInt() const override { return m_reflectable->toUInt(); }
3256  double toDouble() const override { return m_reflectable->toDouble(); }
3257  string<RebindAlloc<ALLOC, char>> toString(const ALLOC& allocator) const override
3258  {
3259  return m_reflectable->toString(allocator);
3260  }
3262  {
3263  return toString(ALLOC());
3264  }
3265 
3266 private:
3267  T m_object;
3268  IBasicReflectablePtr<ALLOC> m_reflectable;
3269 };
3270 
3276 template <typename ALLOC>
3278 {
3279 public:
3280  static IBasicReflectablePtr<ALLOC> getBool(bool value, const ALLOC& allocator = ALLOC())
3281  {
3282  return std::allocate_shared<BoolReflectable<ALLOC>>(allocator, value);
3283  }
3284 
3285  static IBasicReflectablePtr<ALLOC> getInt8(int8_t value, const ALLOC& allocator = ALLOC())
3286  {
3287  return std::allocate_shared<Int8Reflectable<ALLOC>>(allocator, value);
3288  }
3289 
3290  static IBasicReflectablePtr<ALLOC> getInt16(int16_t value, const ALLOC& allocator = ALLOC())
3291  {
3292  return std::allocate_shared<Int16Reflectable<ALLOC>>(allocator, value);
3293  }
3294 
3295  static IBasicReflectablePtr<ALLOC> getInt32(int32_t value, const ALLOC& allocator = ALLOC())
3296  {
3297  return std::allocate_shared<Int32Reflectable<ALLOC>>(allocator, value);
3298  }
3299 
3300  static IBasicReflectablePtr<ALLOC> getInt64(int64_t value, const ALLOC& allocator = ALLOC())
3301  {
3302  return std::allocate_shared<Int64Reflectable<ALLOC>>(allocator, value);
3303  }
3304 
3305  static IBasicReflectablePtr<ALLOC> getUInt8(uint8_t value, const ALLOC& allocator = ALLOC())
3306  {
3307  return std::allocate_shared<UInt8Reflectable<ALLOC>>(allocator, value);
3308  }
3309 
3310  static IBasicReflectablePtr<ALLOC> getUInt16(uint16_t value, const ALLOC& allocator = ALLOC())
3311  {
3312  return std::allocate_shared<UInt16Reflectable<ALLOC>>(allocator, value);
3313  }
3314 
3315  static IBasicReflectablePtr<ALLOC> getUInt32(uint32_t value, const ALLOC& allocator = ALLOC())
3316  {
3317  return std::allocate_shared<UInt32Reflectable<ALLOC>>(allocator, value);
3318  }
3319 
3320  static IBasicReflectablePtr<ALLOC> getUInt64(uint64_t value, const ALLOC& allocator = ALLOC())
3321  {
3322  return std::allocate_shared<UInt64Reflectable<ALLOC>>(allocator, value);
3323  }
3324 
3325  template <typename T, typename std::enable_if<std::is_signed<T>::value, int>::type = 0>
3327  T value, uint8_t bitSize, const ALLOC& allocator = ALLOC())
3328  {
3329  return std::allocate_shared<FixedSignedBitFieldReflectable<ALLOC, T>>(allocator, value, bitSize);
3330  }
3331 
3332  template <typename T, typename std::enable_if<std::is_unsigned<T>::value, int>::type = 0>
3334  T value, uint8_t bitSize, const ALLOC& allocator = ALLOC())
3335  {
3336  return std::allocate_shared<FixedUnsignedBitFieldReflectable<ALLOC, T>>(allocator, value, bitSize);
3337  }
3338 
3339  template <typename T, typename std::enable_if<std::is_signed<T>::value, int>::type = 0>
3341  T value, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC& allocator = ALLOC())
3342  {
3343  return std::allocate_shared<DynamicSignedBitFieldReflectable<ALLOC, T>>(
3344  allocator, value, maxBitSize, dynamicBitSize);
3345  }
3346 
3347  // for dynamic signed bit field given by a type reference (e.g. parameter, function return type)
3349  int64_t value, uint8_t maxBitSize, const ALLOC& allocator = ALLOC())
3350  {
3351  if (maxBitSize != 64)
3352  {
3353  throw CppRuntimeException("ReflectableFactory::getDynamicSignedBitField - ") <<
3354  "maxBitSize != 64 for referenced dynamic bit field!";
3355  }
3356 
3357  return getDynamicSignedBitField(value, maxBitSize, maxBitSize, allocator);
3358  }
3359 
3360  template <typename T, typename std::enable_if<std::is_unsigned<T>::value, int>::type = 0>
3362  T value, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC& allocator = ALLOC())
3363  {
3364  return std::allocate_shared<DynamicUnsignedBitFieldReflectable<ALLOC, T>>(
3365  allocator, value, maxBitSize, dynamicBitSize);
3366  }
3367 
3368  // for dynamic unsigned bit field given a by type reference (e.g. parameter, function return type)
3370  uint64_t value, uint8_t maxBitSize, const ALLOC& allocator = ALLOC())
3371  {
3372  if (maxBitSize != 64)
3373  {
3374  throw CppRuntimeException("ReflectableFactory::getDynamicUnsignedBitField - ") <<
3375  "maxBitSize != 64 for referenced dynamic bit field!";
3376  }
3377 
3378  return getDynamicUnsignedBitField(value, maxBitSize, maxBitSize, allocator);
3379  }
3380 
3382  int16_t value, const ALLOC& allocator = ALLOC())
3383  {
3384  return std::allocate_shared<VarInt16Reflectable<ALLOC>>(allocator, value);
3385  }
3386 
3388  int32_t value, const ALLOC& allocator = ALLOC())
3389  {
3390  return std::allocate_shared<VarInt32Reflectable<ALLOC>>(allocator, value);
3391  }
3392 
3394  int64_t value, const ALLOC& allocator = ALLOC())
3395  {
3396  return std::allocate_shared<VarInt64Reflectable<ALLOC>>(allocator, value);
3397  }
3398 
3399  static IBasicReflectablePtr<ALLOC> getVarInt(int64_t value, const ALLOC& allocator = ALLOC())
3400  {
3401  return std::allocate_shared<VarIntReflectable<ALLOC>>(allocator, value);
3402  }
3403 
3405  uint16_t value, const ALLOC& allocator = ALLOC())
3406  {
3407  return std::allocate_shared<VarUInt16Reflectable<ALLOC>>(allocator, value);
3408  }
3409 
3411  uint32_t value, const ALLOC& allocator = ALLOC())
3412  {
3413  return std::allocate_shared<VarUInt32Reflectable<ALLOC>>(allocator, value);
3414  }
3415 
3417  uint64_t value, const ALLOC& allocator = ALLOC())
3418  {
3419  return std::allocate_shared<VarUInt64Reflectable<ALLOC>>(allocator, value);
3420  }
3421 
3423  uint64_t value, const ALLOC& allocator = ALLOC())
3424  {
3425  return std::allocate_shared<VarUIntReflectable<ALLOC>>(allocator, value);
3426  }
3427 
3429  uint32_t value, const ALLOC& allocator = ALLOC())
3430  {
3431  return std::allocate_shared<VarSizeReflectable<ALLOC>>(allocator, value);
3432  }
3433 
3434  static IBasicReflectablePtr<ALLOC> getFloat16(float value, const ALLOC& allocator = ALLOC())
3435  {
3436  return std::allocate_shared<Float16Reflectable<ALLOC>>(allocator, value);
3437  }
3438 
3439  static IBasicReflectablePtr<ALLOC> getFloat32(float value, const ALLOC& allocator = ALLOC())
3440  {
3441  return std::allocate_shared<Float32Reflectable<ALLOC>>(allocator, value);
3442  }
3443 
3444  static IBasicReflectablePtr<ALLOC> getFloat64(double value, const ALLOC& allocator = ALLOC())
3445  {
3446  return std::allocate_shared<Float64Reflectable<ALLOC>>(allocator, value);
3447  }
3448 
3449  static IBasicReflectablePtr<ALLOC> getBytes(Span<const uint8_t> value, const ALLOC& allocator = ALLOC())
3450  {
3451  return std::allocate_shared<BytesReflectable<ALLOC>>(allocator, value);
3452  }
3453 
3454  static IBasicReflectablePtr<ALLOC> getString(StringView value, const ALLOC& allocator = ALLOC())
3455  {
3456  return std::allocate_shared<StringReflectable<ALLOC>>(allocator, value);
3457  }
3458 
3460  const BasicBitBuffer<ALLOC>& value, const ALLOC& allocator = ALLOC())
3461  {
3462  return std::allocate_shared<BitBufferReflectable<ALLOC>>(allocator, value);
3463  }
3464 
3465  template <typename RAW_ARRAY>
3467  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3468  {
3469  return std::allocate_shared<BoolReflectableConstArray<ALLOC, RAW_ARRAY>>(
3470  allocator, allocator, rawArray);
3471  }
3472 
3473  template <typename RAW_ARRAY>
3474  static IBasicReflectablePtr<ALLOC> getBoolArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3475  {
3476  return std::allocate_shared<BoolReflectableArray<ALLOC, RAW_ARRAY>>(
3477  allocator, allocator, rawArray);
3478  }
3479 
3480  template <typename RAW_ARRAY>
3482  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3483  {
3484  return std::allocate_shared<Int8ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3485  allocator, allocator, rawArray);
3486  }
3487 
3488  template <typename RAW_ARRAY>
3489  static IBasicReflectablePtr<ALLOC> getInt8Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3490  {
3491  return std::allocate_shared<Int8ReflectableArray<ALLOC, RAW_ARRAY>>(
3492  allocator, allocator, rawArray);
3493  }
3494 
3495  template <typename RAW_ARRAY>
3497  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3498  {
3499  return std::allocate_shared<Int16ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3500  allocator, allocator, rawArray);
3501  }
3502 
3503  template <typename RAW_ARRAY>
3504  static IBasicReflectablePtr<ALLOC> getInt16Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3505  {
3506  return std::allocate_shared<Int16ReflectableArray<ALLOC, RAW_ARRAY>>(
3507  allocator, allocator, rawArray);
3508  }
3509 
3510  template <typename RAW_ARRAY>
3512  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3513  {
3514  return std::allocate_shared<Int32ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3515  allocator, allocator, rawArray);
3516  }
3517 
3518  template <typename RAW_ARRAY>
3519  static IBasicReflectablePtr<ALLOC> getInt32Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3520  {
3521  return std::allocate_shared<Int32ReflectableArray<ALLOC, RAW_ARRAY>>(
3522  allocator, allocator, rawArray);
3523  }
3524 
3525  template <typename RAW_ARRAY>
3527  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3528  {
3529  return std::allocate_shared<Int64ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3530  allocator, allocator, rawArray);
3531  }
3532 
3533  template <typename RAW_ARRAY>
3534  static IBasicReflectablePtr<ALLOC> getInt64Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3535  {
3536  return std::allocate_shared<Int64ReflectableArray<ALLOC, RAW_ARRAY>>(
3537  allocator, allocator, rawArray);
3538  }
3539 
3540  template <typename RAW_ARRAY>
3542  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3543  {
3544  return std::allocate_shared<UInt8ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3545  allocator, allocator, rawArray);
3546  }
3547 
3548  template <typename RAW_ARRAY>
3549  static IBasicReflectablePtr<ALLOC> getUInt8Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3550  {
3551  return std::allocate_shared<UInt8ReflectableArray<ALLOC, RAW_ARRAY>>(
3552  allocator, allocator, rawArray);
3553  }
3554 
3555  template <typename RAW_ARRAY>
3557  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3558  {
3559  return std::allocate_shared<UInt16ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3560  allocator, allocator, rawArray);
3561  }
3562 
3563  template <typename RAW_ARRAY>
3564  static IBasicReflectablePtr<ALLOC> getUInt16Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3565  {
3566  return std::allocate_shared<UInt16ReflectableArray<ALLOC, RAW_ARRAY>>(
3567  allocator, allocator, rawArray);
3568  }
3569 
3570  template <typename RAW_ARRAY>
3572  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3573  {
3574  return std::allocate_shared<UInt32ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3575  allocator, allocator, rawArray);
3576  }
3577 
3578  template <typename RAW_ARRAY>
3579  static IBasicReflectablePtr<ALLOC> getUInt32Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3580  {
3581  return std::allocate_shared<UInt32ReflectableArray<ALLOC, RAW_ARRAY>>(
3582  allocator, allocator, rawArray);
3583  }
3584 
3585  template <typename RAW_ARRAY>
3587  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3588  {
3589  return std::allocate_shared<UInt64ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3590  allocator, allocator, rawArray);
3591  }
3592 
3593  template <typename RAW_ARRAY>
3594  static IBasicReflectablePtr<ALLOC> getUInt64Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3595  {
3596  return std::allocate_shared<UInt64ReflectableArray<ALLOC, RAW_ARRAY>>(
3597  allocator, allocator, rawArray);
3598  }
3599 
3600  template <typename RAW_ARRAY>
3602  const RAW_ARRAY& rawArray, uint8_t bitSize, const ALLOC& allocator = ALLOC())
3603  {
3604  return std::allocate_shared<FixedSignedBitFieldReflectableConstArray<ALLOC, RAW_ARRAY>>(
3605  allocator, allocator, rawArray, bitSize);
3606  }
3607 
3608  template <typename RAW_ARRAY>
3610  RAW_ARRAY& rawArray, uint8_t bitSize, const ALLOC& allocator = ALLOC())
3611  {
3612  return std::allocate_shared<FixedSignedBitFieldReflectableArray<ALLOC, RAW_ARRAY>>(
3613  allocator, allocator, rawArray, bitSize);
3614  }
3615 
3616  template <typename RAW_ARRAY>
3618  const RAW_ARRAY& rawArray, uint8_t bitSize, const ALLOC& allocator = ALLOC())
3619  {
3620  return std::allocate_shared<FixedUnsignedBitFieldReflectableConstArray<ALLOC, RAW_ARRAY>>(
3621  allocator, allocator, rawArray, bitSize);
3622  }
3623 
3624  template <typename RAW_ARRAY>
3626  RAW_ARRAY& rawArray, uint8_t bitSize, const ALLOC& allocator = ALLOC())
3627  {
3628  return std::allocate_shared<FixedUnsignedBitFieldReflectableArray<ALLOC, RAW_ARRAY>>(
3629  allocator, allocator, rawArray, bitSize);
3630  }
3631 
3632  template <typename RAW_ARRAY>
3634  const RAW_ARRAY& rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize,
3635  const ALLOC& allocator = ALLOC())
3636  {
3637  return std::allocate_shared<DynamicSignedBitFieldReflectableConstArray<ALLOC, RAW_ARRAY>>(
3638  allocator, allocator, rawArray, maxBitSize, dynamicBitSize);
3639  }
3640 
3641  template <typename RAW_ARRAY>
3643  RAW_ARRAY& rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC& allocator = ALLOC())
3644  {
3645  return std::allocate_shared<DynamicSignedBitFieldReflectableArray<ALLOC, RAW_ARRAY>>(
3646  allocator, allocator, rawArray, maxBitSize, dynamicBitSize);
3647  }
3648 
3649  template <typename RAW_ARRAY>
3651  const RAW_ARRAY& rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize,
3652  const ALLOC& allocator = ALLOC())
3653  {
3654  return std::allocate_shared<DynamicUnsignedBitFieldReflectableConstArray<ALLOC, RAW_ARRAY>>(
3655  allocator, allocator, rawArray, maxBitSize, dynamicBitSize);
3656  }
3657 
3658  template <typename RAW_ARRAY>
3660  RAW_ARRAY& rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC& allocator = ALLOC())
3661  {
3662  return std::allocate_shared<DynamicUnsignedBitFieldReflectableArray<ALLOC, RAW_ARRAY>>(
3663  allocator, allocator, rawArray, maxBitSize, dynamicBitSize);
3664  }
3665 
3666  template <typename RAW_ARRAY>
3668  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3669  {
3670  return std::allocate_shared<VarInt16ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3671  allocator, allocator, rawArray);
3672  }
3673 
3674  template <typename RAW_ARRAY>
3675  static IBasicReflectablePtr<ALLOC> getVarInt16Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3676  {
3677  return std::allocate_shared<VarInt16ReflectableArray<ALLOC, RAW_ARRAY>>(
3678  allocator, allocator, rawArray);
3679  }
3680 
3681  template <typename RAW_ARRAY>
3683  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3684  {
3685  return std::allocate_shared<VarInt32ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3686  allocator, allocator, rawArray);
3687  }
3688 
3689  template <typename RAW_ARRAY>
3690  static IBasicReflectablePtr<ALLOC> getVarInt32Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3691  {
3692  return std::allocate_shared<VarInt32ReflectableArray<ALLOC, RAW_ARRAY>>(
3693  allocator, allocator, rawArray);
3694  }
3695 
3696  template <typename RAW_ARRAY>
3698  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3699  {
3700  return std::allocate_shared<VarInt64ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3701  allocator, allocator, rawArray);
3702  }
3703 
3704  template <typename RAW_ARRAY>
3705  static IBasicReflectablePtr<ALLOC> getVarInt64Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3706  {
3707  return std::allocate_shared<VarInt64ReflectableArray<ALLOC, RAW_ARRAY>>(
3708  allocator, allocator, rawArray);
3709  }
3710 
3711  template <typename RAW_ARRAY>
3713  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3714  {
3715  return std::allocate_shared<VarIntReflectableConstArray<ALLOC, RAW_ARRAY>>(
3716  allocator, allocator, rawArray);
3717  }
3718 
3719  template <typename RAW_ARRAY>
3720  static IBasicReflectablePtr<ALLOC> getVarIntArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3721  {
3722  return std::allocate_shared<VarIntReflectableArray<ALLOC, RAW_ARRAY>>(
3723  allocator, allocator, rawArray);
3724  }
3725 
3726  template <typename RAW_ARRAY>
3728  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3729  {
3730  return std::allocate_shared<VarUInt16ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3731  allocator, allocator, rawArray);
3732  }
3733 
3734  template <typename RAW_ARRAY>
3735  static IBasicReflectablePtr<ALLOC> getVarUInt16Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3736  {
3737  return std::allocate_shared<VarUInt16ReflectableArray<ALLOC, RAW_ARRAY>>(
3738  allocator, allocator, rawArray);
3739  }
3740 
3741  template <typename RAW_ARRAY>
3743  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3744  {
3745  return std::allocate_shared<VarUInt32ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3746  allocator, allocator, rawArray);
3747  }
3748 
3749  template <typename RAW_ARRAY>
3750  static IBasicReflectablePtr<ALLOC> getVarUInt32Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3751  {
3752  return std::allocate_shared<VarUInt32ReflectableArray<ALLOC, RAW_ARRAY>>(
3753  allocator, allocator, rawArray);
3754  }
3755 
3756  template <typename RAW_ARRAY>
3758  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3759  {
3760  return std::allocate_shared<VarUInt64ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3761  allocator, allocator, rawArray);
3762  }
3763 
3764  template <typename RAW_ARRAY>
3765  static IBasicReflectablePtr<ALLOC> getVarUInt64Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3766  {
3767  return std::allocate_shared<VarUInt64ReflectableArray<ALLOC, RAW_ARRAY>>(
3768  allocator, allocator, rawArray);
3769  }
3770 
3771  template <typename RAW_ARRAY>
3773  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3774  {
3775  return std::allocate_shared<VarUIntReflectableConstArray<ALLOC, RAW_ARRAY>>(
3776  allocator, allocator, rawArray);
3777  }
3778 
3779  template <typename RAW_ARRAY>
3780  static IBasicReflectablePtr<ALLOC> getVarUIntArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3781  {
3782  return std::allocate_shared<VarUIntReflectableArray<ALLOC, RAW_ARRAY>>(
3783  allocator, allocator, rawArray);
3784  }
3785 
3786  template <typename RAW_ARRAY>
3788  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3789  {
3790  return std::allocate_shared<VarSizeReflectableConstArray<ALLOC, RAW_ARRAY>>(
3791  allocator, allocator, rawArray);
3792  }
3793 
3794  template <typename RAW_ARRAY>
3795  static IBasicReflectablePtr<ALLOC> getVarSizeArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3796  {
3797  return std::allocate_shared<VarSizeReflectableArray<ALLOC, RAW_ARRAY>>(
3798  allocator, allocator, rawArray);
3799  }
3800 
3801  template <typename RAW_ARRAY>
3803  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3804  {
3805  return std::allocate_shared<Float16ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3806  allocator, allocator, rawArray);
3807  }
3808 
3809  template <typename RAW_ARRAY>
3810  static IBasicReflectablePtr<ALLOC> getFloat16Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3811  {
3812  return std::allocate_shared<Float16ReflectableArray<ALLOC, RAW_ARRAY>>(
3813  allocator, allocator, rawArray);
3814  }
3815 
3816  template <typename RAW_ARRAY>
3818  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3819  {
3820  return std::allocate_shared<Float32ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3821  allocator, allocator, rawArray);
3822  }
3823 
3824  template <typename RAW_ARRAY>
3825  static IBasicReflectablePtr<ALLOC> getFloat32Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3826  {
3827  return std::allocate_shared<Float32ReflectableArray<ALLOC, RAW_ARRAY>>(
3828  allocator, allocator, rawArray);
3829  }
3830 
3831  template <typename RAW_ARRAY>
3833  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3834  {
3835  return std::allocate_shared<Float64ReflectableConstArray<ALLOC, RAW_ARRAY>>(
3836  allocator, allocator, rawArray);
3837  }
3838 
3839  template <typename RAW_ARRAY>
3840  static IBasicReflectablePtr<ALLOC> getFloat64Array(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3841  {
3842  return std::allocate_shared<Float64ReflectableArray<ALLOC, RAW_ARRAY>>(
3843  allocator, allocator, rawArray);
3844  }
3845 
3846  template <typename RAW_ARRAY>
3848  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3849  {
3850  return std::allocate_shared<BytesReflectableConstArray<ALLOC, RAW_ARRAY>>(
3851  allocator, allocator, rawArray);
3852  }
3853 
3854  template <typename RAW_ARRAY>
3855  static IBasicReflectablePtr<ALLOC> getBytesArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3856  {
3857  return std::allocate_shared<BytesReflectableArray<ALLOC, RAW_ARRAY>>(
3858  allocator, allocator, rawArray);
3859  }
3860 
3861  template <typename RAW_ARRAY>
3863  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3864  {
3865  return std::allocate_shared<StringReflectableConstArray<ALLOC, RAW_ARRAY>>(
3866  allocator, allocator, rawArray);
3867  }
3868 
3869  template <typename RAW_ARRAY>
3870  static IBasicReflectablePtr<ALLOC> getStringArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3871  {
3872  return std::allocate_shared<StringReflectableArray<ALLOC, RAW_ARRAY>>(
3873  allocator, allocator, rawArray);
3874  }
3875 
3876  template <typename RAW_ARRAY>
3878  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3879  {
3880  return std::allocate_shared<BitBufferReflectableConstArray<ALLOC, RAW_ARRAY>>(
3881  allocator, allocator, rawArray);
3882  }
3883 
3884  template <typename RAW_ARRAY>
3885  static IBasicReflectablePtr<ALLOC> getBitBufferArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3886  {
3887  return std::allocate_shared<BitBufferReflectableArray<ALLOC, RAW_ARRAY>>(
3888  allocator, allocator, rawArray);
3889  }
3890 
3891  template <typename RAW_ARRAY>
3893  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3894  {
3895  return std::allocate_shared<CompoundReflectableConstArray<ALLOC, RAW_ARRAY>>(
3896  allocator, allocator, rawArray);
3897  }
3898 
3899  template <typename RAW_ARRAY>
3900  static IBasicReflectablePtr<ALLOC> getCompoundArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3901  {
3902  return std::allocate_shared<CompoundReflectableArray<ALLOC, RAW_ARRAY>>(allocator, allocator, rawArray);
3903  }
3904 
3905  template <typename RAW_ARRAY>
3907  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3908  {
3909  return std::allocate_shared<BitmaskReflectableConstArray<ALLOC, RAW_ARRAY>>(
3910  allocator, allocator, rawArray);
3911  }
3912 
3913  template <typename RAW_ARRAY>
3914  static IBasicReflectablePtr<ALLOC> getBitmaskArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3915  {
3916  return std::allocate_shared<BitmaskReflectableArray<ALLOC, RAW_ARRAY>>(allocator, allocator, rawArray);
3917  }
3918 
3919  template <typename RAW_ARRAY>
3921  const RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3922  {
3923  return std::allocate_shared<EnumReflectableConstArray<ALLOC, RAW_ARRAY>>(
3924  allocator, allocator, rawArray);
3925  }
3926 
3927  template <typename RAW_ARRAY>
3928  static IBasicReflectablePtr<ALLOC> getEnumArray(RAW_ARRAY& rawArray, const ALLOC& allocator = ALLOC())
3929  {
3930  return std::allocate_shared<EnumReflectableArray<ALLOC, RAW_ARRAY>>(allocator, allocator, rawArray);
3931  }
3932 };
3933 
3936 
3937 template <typename ALLOC>
3939  m_typeInfo(typeInfo)
3940 {}
3941 
3942 template <typename ALLOC>
3944 
3945 template <typename ALLOC>
3947 {
3948  return m_typeInfo;
3949 }
3950 
3951 template <typename ALLOC>
3953 {
3954  return false;
3955 }
3956 
3957 template <typename ALLOC>
3959 {
3960  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not a compound type!";
3961 }
3962 
3963 template <typename ALLOC>
3965 {
3966  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' has no type arguments!";
3967 }
3968 
3969 template <typename ALLOC>
3971 {
3972  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not a compound type!";
3973 }
3974 
3975 template <typename ALLOC>
3977 {
3978  return initializeOffsets(0);
3979 }
3980 
3981 template <typename ALLOC>
3983 {
3984  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not implemented!";
3985 }
3986 
3987 template <typename ALLOC>
3989 {
3990  return bitSizeOf(0);
3991 }
3992 
3993 template <typename ALLOC>
3995 {
3996  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not implemented!";
3997 }
3998 
3999 template <typename ALLOC>
4001 {
4002  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' has no fields to get!";
4003 }
4004 
4005 template <typename ALLOC>
4007 {
4008  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' has no fields to get!";
4009 }
4010 
4011 template <typename ALLOC>
4013 {
4014  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' has no fields to create!";
4015 }
4016 
4017 template <typename ALLOC>
4019 {
4020  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' has no fields to set!";
4021 }
4022 
4023 template <typename ALLOC>
4025 {
4026  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' has no parameters to get!";
4027 }
4028 
4029 template <typename ALLOC>
4031 {
4032  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' has no parameters to get!";
4033 }
4034 
4035 template <typename ALLOC>
4037 {
4038  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' has no functions to call!";
4039 }
4040 
4041 template <typename ALLOC>
4043 {
4044  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' has no functions to call!";
4045 }
4046 
4047 template <typename ALLOC>
4049 {
4050  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is neither choice nor union!";
4051 }
4052 
4053 template <typename ALLOC>
4055 {
4056  return detail::getFromObject(*this, path, 0);
4057 }
4058 
4059 template <typename ALLOC>
4061 {
4062  return detail::getFromObject(*this, path, 0);
4063 }
4064 
4065 template <typename ALLOC>
4067 {
4068  return find(path);
4069 }
4070 
4071 template <typename ALLOC>
4073 {
4074  return find(path);
4075 }
4076 
4077 template <typename ALLOC>
4079 {
4080  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not an array!";
4081 }
4082 
4083 template <typename ALLOC>
4085 {
4086  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not an array!";
4087 }
4088 
4089 template <typename ALLOC>
4091 {
4092  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not an array!";
4093 }
4094 
4095 template <typename ALLOC>
4097 {
4098  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not an array!";
4099 }
4100 
4101 template <typename ALLOC>
4103 {
4104  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not an array!";
4105 }
4106 
4107 template <typename ALLOC>
4109 {
4110  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not an array!";
4111 }
4112 
4113 template <typename ALLOC>
4115 {
4116  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not an array!";
4117 }
4118 
4119 template <typename ALLOC>
4121 {
4122  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not an array!";
4123 }
4124 
4125 template <typename ALLOC>
4127 {
4128  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not implemented!";
4129 }
4130 
4131 template <typename ALLOC>
4133 {
4134  throw CppRuntimeException("Type '") << getTypeInfo().getSchemaName() << "' is not implemented!";
4135 }
4136 
4137 template <typename ALLOC>
4139 {
4140  return getAnyValue(ALLOC());
4141 }
4142 
4143 template <typename ALLOC>
4145 {
4146  return getAnyValue(ALLOC());
4147 }
4148 
4149 template <typename ALLOC>
4151 {
4152  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not boolean type!";
4153 }
4154 
4155 template <typename ALLOC>
4157 {
4158  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not int8 type!";
4159 }
4160 
4161 template <typename ALLOC>
4163 {
4164  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not int16 type!";
4165 }
4166 
4167 template <typename ALLOC>
4169 {
4170  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not int32 type!";
4171 }
4172 
4173 template <typename ALLOC>
4175 {
4176  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not int64 type!";
4177 }
4178 
4179 template <typename ALLOC>
4181 {
4182  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not uint8 type!";
4183 }
4184 
4185 template <typename ALLOC>
4187 {
4188  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not uint16 type!";
4189 }
4190 
4191 template <typename ALLOC>
4193 {
4194  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not uint32 type!";
4195 }
4196 
4197 template <typename ALLOC>
4199 {
4200  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not uint64 type!";
4201 }
4202 
4203 template <typename ALLOC>
4205 {
4206  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not float type!";
4207 }
4208 
4209 template <typename ALLOC>
4211 {
4212  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not double type!";
4213 }
4214 
4215 template <typename ALLOC>
4217 {
4218  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not bytes type!";
4219 }
4220 
4221 template <typename ALLOC>
4223 {
4224  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not string type!";
4225 }
4226 
4227 template <typename ALLOC>
4229 {
4230  throw CppRuntimeException("'") << getTypeInfo().getSchemaName() << "' is not an extern type!";
4231 }
4232 
4233 template <typename ALLOC>
4235 {
4236  throw CppRuntimeException("Conversion from '") << getTypeInfo().getSchemaName() <<
4237  "' to signed integer is not available!";
4238 }
4239 
4240 template <typename ALLOC>
4242 {
4243  throw CppRuntimeException("Conversion from '") << getTypeInfo().getSchemaName() <<
4244  "' to unsigned integer is not available!";
4245 }
4246 
4247 template <typename ALLOC>
4249 {
4250  throw CppRuntimeException("Conversion from '") << getTypeInfo().getSchemaName() <<
4251  "' to double is not available!";
4252 }
4253 
4254 template <typename ALLOC>
4256 {
4257  throw CppRuntimeException("Conversion from '") << getTypeInfo().getSchemaName() <<
4258  "' to string is not available!";
4259 }
4260 
4261 template <typename ALLOC>
4263 {
4264  return toString(ALLOC());
4265 }
4266 
4267 template <typename ALLOC>
4269 {
4270  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is constant!";
4271 }
4272 
4273 template <typename ALLOC>
4275 {
4276  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is constant!";
4277 }
4278 
4279 template <typename ALLOC>
4281 {
4282  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is constant!";
4283 }
4284 
4285 template <typename ALLOC>
4287 {
4288  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is constant!";
4289 }
4290 
4291 template <typename ALLOC>
4293 {
4294  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is constant!";
4295 }
4296 
4297 template <typename ALLOC>
4299 {
4300  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is constant!";
4301 }
4302 
4303 template <typename ALLOC>
4305 {
4306  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is constant!";
4307 }
4308 
4309 template <typename ALLOC>
4311 {
4312  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is constant!";
4313 }
4314 
4315 template <typename ALLOC>
4317 {
4318  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4319 }
4320 
4321 template <typename ALLOC>
4323 {
4324  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4325 }
4326 
4327 template <typename ALLOC>
4329 {
4330  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4331 }
4332 
4333 template <typename ALLOC>
4335 {
4336  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4337 }
4338 
4339 template <typename ALLOC>
4341 {
4342  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4343 }
4344 
4345 template <typename ALLOC>
4347 {
4348  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4349 }
4350 
4351 template <typename ALLOC>
4353 {
4354  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4355 }
4356 
4357 template <typename ALLOC>
4359 {
4360  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4361 }
4362 
4363 template <typename ALLOC>
4365 {
4366  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4367 }
4368 
4369 template <typename ALLOC>
4371 {
4372  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4373 }
4374 
4375 template <typename ALLOC>
4377 {
4378  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4379 }
4380 
4381 template <typename ALLOC>
4383 {
4384  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4385 }
4386 
4387 template <typename ALLOC>
4389 {
4390  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4391 }
4392 
4393 template <typename ALLOC>
4395 {
4396  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4397 }
4398 
4399 template <typename ALLOC>
4401 {
4402  return this->at(index);
4403 }
4404 
4405 template <typename ALLOC>
4407 {
4408  return this->at(index);
4409 }
4410 
4411 template <typename ALLOC>
4413 {
4414  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4415 }
4416 
4417 template <typename ALLOC>
4419 {
4420  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4421 }
4422 
4423 template <typename ALLOC>
4425 {
4426  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4427 }
4428 
4429 template <typename ALLOC>
4431 {
4432  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4433 }
4434 
4435 template <typename ALLOC>
4437 {
4438  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4439 }
4440 
4441 template <typename ALLOC>
4443 {
4444  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4445 }
4446 
4447 template <typename ALLOC>
4449 {
4450  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4451 }
4452 
4453 template <typename ALLOC>
4455 {
4456  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4457 }
4458 
4459 template <typename ALLOC>
4461 {
4462  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4463 }
4464 
4465 template <typename ALLOC>
4467 {
4468  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4469 }
4470 
4471 template <typename ALLOC>
4473 {
4474  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4475 }
4476 
4477 template <typename ALLOC>
4479 {
4480  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4481 }
4482 
4483 template <typename ALLOC>
4485 {
4486  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4487 }
4488 
4489 template <typename ALLOC>
4491 {
4492  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4493 }
4494 
4495 template <typename ALLOC>
4497 {
4498  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4499 }
4500 
4501 template <typename ALLOC>
4503 {
4504  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4505 }
4506 
4507 template <typename ALLOC>
4509 {
4510  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4511 }
4512 
4513 template <typename ALLOC>
4515 {
4516  throw CppRuntimeException("Reflectable is an array '") << getTypeInfo().getSchemaName() << "[]'!";
4517 }
4518 
4519 template <typename ALLOC>
4521 {
4522  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is a constant array!";
4523 }
4524 
4525 template <typename ALLOC>
4527 {
4528  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is a constant array!";
4529 }
4530 
4531 template <typename ALLOC>
4533 {
4534  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is a constant array!";
4535 }
4536 
4537 template <typename ALLOC>
4539 {
4540  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is a constant array!";
4541 }
4542 
4543 template <typename ALLOC>
4545 {
4546  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is a constant array!";
4547 }
4548 
4549 template <typename ALLOC>
4551 {
4552  throw CppRuntimeException("Reflectable '") << getTypeInfo().getSchemaName() << "' is a constant array!";
4553 }
4554 
4555 } // namespace zserio
4556 
4557 #endif // ZSERIO_REFLECTABLE_H_INC
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:625
typename IBasicReflectable< ALLOC >::ConstPtr IBasicReflectableConstPtr
Definition: IReflectable.h:519
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1567
DynamicUnsignedBitFieldReflectable(uint64_t value, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:1287
void writeVarInt64(int64_t data)
uint32_t getUInt32() const override
Definition: Reflectable.h:4192
static IBasicReflectableConstPtr< ALLOC > getFloat16Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3802
void setAt(const AnyHolder< ALLOC > &value, size_t index) override
Definition: Reflectable.h:2464
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:3994
static IBasicReflectableConstPtr< ALLOC > getUInt64Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3586
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t maxBitSize)
Definition: Reflectable.h:1240
void writeVarUInt16(uint16_t data)
static const IBasicTypeInfo< ALLOC > & getBool()
Definition: TypeInfo.h:1010
static IBasicReflectablePtr< ALLOC > getFixedUnsignedBitFieldArray(RAW_ARRAY &rawArray, uint8_t bitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3625
FixedSignedBitFieldReflectable(int32_t value, uint8_t bitSize)
Definition: Reflectable.h:786
uint64_t getUInt64() const override
Definition: Reflectable.h:4198
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:535
static const IBasicTypeInfo< ALLOC > & getVarInt16()
Definition: TypeInfo.h:1064
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1507
void setField(StringView name, const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:4364
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2135
void setAt(const AnyHolder< ALLOC > &value, size_t index) override
Definition: Reflectable.h:3207
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:694
int32_t getInt32() const override
Definition: Reflectable.h:4168
IBasicReflectableConstPtr< ALLOC > callFunction(StringView name) const override
Definition: Reflectable.h:3142
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1665
void writeBytes(Span< const uint8_t > data)
VarInt16Reflectable(int16_t value)
Definition: Reflectable.h:1332
CompoundReflectableArray(const ALLOC &allocator, RAW_ARRAY &rawArray)
Definition: Reflectable.h:2722
void initializeChildren() override
Definition: Reflectable.h:4316
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1695
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2904
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t bitSize)
Definition: Reflectable.h:883
void writeFloat16(float data)
static IBasicReflectablePtr< ALLOC > getFixedSignedBitField(T value, uint8_t bitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3326
BitmaskReflectableConstArray(const ALLOC &allocator, const RAW_ARRAY &rawArray)
Definition: Reflectable.h:2805
static IBasicReflectablePtr< ALLOC > getInt64(int64_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3300
Float32Reflectable(float value)
Definition: Reflectable.h:1656
ReflectableBase & operator=(const ReflectableBase &)=delete
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2990
IBasicReflectablePtr< ALLOC > callFunction(StringView name) override
Definition: Reflectable.h:3147
static IBasicReflectablePtr< ALLOC > getFloat64(double value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3444
static IBasicReflectablePtr< ALLOC > getInt64Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3534
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:3217
static const IBasicTypeInfo< ALLOC > & getInt32()
Definition: TypeInfo.h:1028
const BasicBitBuffer< ALLOC > & getBitBuffer() const override
Definition: Reflectable.h:4490
void writeVarUInt64(uint64_t data)
void append(const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:2213
double toDouble() const override
Definition: Reflectable.h:3256
void writeVarInt16(int16_t data)
size_t bitSizeOfVarUInt64(uint64_t value)
string< ALLOC > toString() const override
Definition: Reflectable.h:4262
int64_t toInt() const override
Definition: Reflectable.h:242
void setField(StringView name, const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:4292
IBasicReflectablePtr< ALLOC > at(size_t index) override
Definition: Reflectable.h:3001
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1630
double toDouble() const override
Definition: Reflectable.h:215
typename IBasicReflectable< ALLOC >::Ptr IBasicReflectablePtr
Definition: IReflectable.h:516
static IBasicReflectablePtr< ALLOC > getVarInt32Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3690
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1756
void setAt(const AnyHolder< ALLOC > &value, size_t index) override
Definition: Reflectable.h:4538
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1401
int64_t getInt64() const override
Definition: Reflectable.h:4436
IBasicReflectablePtr< ALLOC > createField(StringView name) override
Definition: Reflectable.h:4012
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2955
void initialize(const vector< AnyHolder< ALLOC >, ALLOC > &typeArguments) override
Definition: Reflectable.h:3082
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1431
UInt8Reflectable(uint8_t value)
Definition: Reflectable.h:600
IBasicReflectableConstPtr< ALLOC > getParameter(StringView name) const override
Definition: Reflectable.h:4370
uint8_t getUInt8() const override
Definition: Reflectable.h:4180
static IBasicReflectablePtr< ALLOC > getFloat32Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3825
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2944
static IBasicReflectableConstPtr< ALLOC > getInt32Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3511
const BasicBitBuffer< ALLOC > & getBitBuffer() const override
Definition: Reflectable.h:1815
FixedUnsignedBitFieldReflectable(uint16_t value, uint8_t bitSize)
Definition: Reflectable.h:888
size_t size() const override
Definition: Reflectable.h:2170
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:475
void append(const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:2896
void initializeChildren() override
Definition: Reflectable.h:3077
int8_t getInt8() const override
Definition: Reflectable.h:4418
static IBasicReflectableConstPtr< ALLOC > getStringArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3862
BoolReflectable(bool value)
Definition: Reflectable.h:285
size_t size() const override
Definition: Reflectable.h:2939
void setAt(const AnyHolder< ALLOC > &value, size_t index) override
Definition: Reflectable.h:2882
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) override
Definition: Reflectable.h:2485
static IBasicReflectableConstPtr< ALLOC > getUInt8Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3541
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:664
size_t bitSizeOf() const override
Definition: Reflectable.h:3102
static IBasicReflectablePtr< ALLOC > getStringArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3870
static IBasicReflectablePtr< ALLOC > getBytesArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3855
StringView getStringView() const override
Definition: Reflectable.h:4222
StringView getChoice() const override
Definition: Reflectable.h:3152
size_type find(BasicStringView str, size_type pos=0) const noexcept
Definition: StringView.h:447
static IBasicReflectablePtr< ALLOC > getInt16Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3504
string< ALLOC > toString(T value, const ALLOC &allocator=ALLOC())
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2825
string< RebindAlloc< ALLOC, char > > toString(const ALLOC &allocator) const override
Definition: Reflectable.h:3257
void writeFloat32(float data)
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1447
static const IBasicTypeInfo< ALLOC > & getVarUInt16()
Definition: TypeInfo.h:1100
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:903
static IBasicReflectablePtr< ALLOC > getVarUInt64Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3765
bool getBool() const override
Definition: Reflectable.h:4412
float getFloat() const override
Definition: Reflectable.h:4466
IBasicReflectableConstPtr< ALLOC > getParameter(StringView name) const override
Definition: Reflectable.h:3132
uint64_t getUInt64() const override
Definition: Reflectable.h:459
IBasicReflectablePtr< ALLOC > createField(StringView name) override
Definition: Reflectable.h:4358
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:735
bool isArray() const override
Definition: Reflectable.h:3952
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:3187
Int64Reflectable(int64_t value)
Definition: Reflectable.h:570
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:669
static IBasicReflectablePtr< ALLOC > getVarInt16Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3675
static IBasicReflectablePtr< ALLOC > getDynamicUnsignedBitField(T value, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3361
static IBasicReflectablePtr< ALLOC > getFixedUnsignedBitField(T value, uint8_t bitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3333
DynamicUnsignedBitFieldReflectable(uint32_t value, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:1245
void initializeChildren() override
Definition: Reflectable.h:3958
static IBasicReflectableConstPtr< ALLOC > getEnumArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3920
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2218
IBasicReflectablePtr< ALLOC > getParameter(StringView name) override
Definition: Reflectable.h:3137
IBasicReflectablePtr< ALLOC > at(size_t index) override
Definition: Reflectable.h:2452
VarUIntReflectable(uint64_t value)
Definition: Reflectable.h:1542
static IBasicReflectablePtr< ALLOC > getVarInt(int64_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3399
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2180
void append(const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:3026
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1551
StringView getChoice() const override
Definition: Reflectable.h:4394
static const IBasicTypeInfo< ALLOC > & getUInt64()
Definition: TypeInfo.h:1058
FixedBitFieldReflectableArray(const ALLOC &allocator, RAW_ARRAY &rawArray, uint8_t bitSize)
Definition: Reflectable.h:2292
~ReflectableBase() override=0
static IBasicReflectableConstPtr< ALLOC > getVarUInt32Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3742
static IBasicReflectableConstPtr< ALLOC > getFloat64Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3832
int16_t getInt16() const override
Definition: Reflectable.h:4162
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t maxBitSize)
Definition: Reflectable.h:1156
void writeBitBuffer(const BasicBitBuffer< ALLOC > &bitBuffer)
IBasicReflectableConstPtr< ALLOC > callFunction(StringView name) const override
Definition: Reflectable.h:4382
size_t size() const override
Definition: Reflectable.h:2850
BitmaskReflectableArray(const ALLOC &allocator, RAW_ARRAY &rawArray)
Definition: Reflectable.h:2846
static IBasicReflectablePtr< ALLOC > getInt16(int16_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3290
void writeVarInt(int64_t data)
static IBasicReflectablePtr< ALLOC > getUInt32Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3579
IBasicReflectableConstPtr< ALLOC > operator[](StringView path) const override
Definition: Reflectable.h:4066
void writeVarInt32(int32_t data)
size_t bitSizeOf() const override
Definition: Reflectable.h:3988
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1053
static IBasicReflectablePtr< ALLOC > getVarUInt32Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3750
static IBasicReflectableConstPtr< ALLOC > getVarSizeArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3787
static IBasicReflectablePtr< ALLOC > getDynamicUnsignedBitField(uint64_t value, uint8_t maxBitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3369
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1730
size_t size() const override
Definition: Reflectable.h:2980
uint8_t getUInt8() const override
Definition: Reflectable.h:399
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1700
int8_t getInt8() const override
Definition: Reflectable.h:3239
uint64_t toUInt() const override
Definition: Reflectable.h:4241
IntegralReflectableBase(const IBasicTypeInfo< ALLOC > &typeInfo, T value)
Definition: Reflectable.h:211
void writeVarUInt32(uint32_t data)
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1805
static const IBasicTypeInfo< ALLOC > & getFloat16()
Definition: TypeInfo.h:1145
const T & getValue() const
Definition: Reflectable.h:135
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2736
size_t bitSizeOf(size_t bitPosition) const override
Definition: Reflectable.h:3097
DynamicSignedBitFieldReflectable(int8_t value, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:990
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:595
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:519
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1308
static IBasicReflectablePtr< ALLOC > getVarUInt16Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3735
static IBasicReflectablePtr< ALLOC > getVarInt64Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3705
DynamicUnsignedBitFieldReflectable(uint8_t value, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:1161
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2440
static IBasicReflectablePtr< ALLOC > getUInt8(uint8_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3305
string< RebindAlloc< ALLOC, char > > toString() const override
Definition: Reflectable.h:3261
IBasicReflectablePtr< ALLOC > at(size_t index) override
Definition: Reflectable.h:4526
void writeString(StringView data)
size_t size() const override
Definition: Reflectable.h:3177
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1371
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t maxBitSize)
Definition: Reflectable.h:1069
FixedUnsignedBitFieldReflectable(uint8_t value, uint8_t bitSize)
Definition: Reflectable.h:855
DynamicSignedBitFieldReflectable(int32_t value, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:1074
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2402
void setAt(const AnyHolder< ALLOC > &value, size_t index) override
Definition: Reflectable.h:2202
IBasicReflectablePtr< ALLOC > callFunction(StringView name) override
Definition: Reflectable.h:4304
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:936
static IBasicReflectablePtr< ALLOC > getUInt32(uint32_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3315
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t maxBitSize)
Definition: Reflectable.h:1111
static IBasicReflectablePtr< ALLOC > getVarUInt16(uint16_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3404
DynamicSignedBitFieldReflectable(int64_t value, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:1116
size_t bitSizeOfBytes(Span< const uint8_t > bytesValue)
void writeVarSize(uint32_t data)
void writeSignedBits(int32_t data, uint8_t numBits=32)
static IBasicReflectableConstPtr< ALLOC > getBytesArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3847
void resize(size_t size) override
Definition: Reflectable.h:2301
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1011
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2860
int64_t toInt() const override
Definition: Reflectable.h:3254
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2260
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:3034
static IBasicReflectableConstPtr< ALLOC > getFixedUnsignedBitFieldArray(const RAW_ARRAY &rawArray, uint8_t bitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3617
static IBasicReflectableConstPtr< ALLOC > getCompoundArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3892
StringView getStringView() const override
Definition: Reflectable.h:1775
IBasicReflectablePtr< ALLOC > getParameter(StringView name) override
Definition: Reflectable.h:4298
StringView getStringView() const override
Definition: Reflectable.h:4484
static const IBasicTypeInfo< ALLOC > & getBytes()
Definition: TypeInfo.h:1163
void resize(size_t size) override
Definition: Reflectable.h:2435
size_t bitSizeOfVarInt64(int64_t value)
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2774
int64_t toInt() const override
Definition: Reflectable.h:4234
EnumReflectableConstArray(const ALLOC &allocator, const RAW_ARRAY &rawArray)
Definition: Reflectable.h:2935
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:685
IBasicReflectablePtr< ALLOC > find(StringView path) override
Definition: Reflectable.h:3162
FixedUnsignedBitFieldReflectable(uint64_t value, uint8_t bitSize)
Definition: Reflectable.h:954
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1581
BuiltinReflectableConstArray(const ALLOC &allocator, const RAW_ARRAY &rawArray)
Definition: Reflectable.h:2126
void setAt(const AnyHolder< ALLOC > &value, size_t index) override
Definition: Reflectable.h:4114
static IBasicReflectablePtr< ALLOC > getDynamicSignedBitField(int64_t value, uint8_t maxBitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3348
void setAt(const AnyHolder< ALLOC > &value, size_t index) override
Definition: Reflectable.h:3012
size_t bitSizeOfVarInt16(int16_t value)
IBasicReflectablePtr< ALLOC > operator[](size_t index) override
Definition: Reflectable.h:3202
void resize(size_t size) override
Definition: Reflectable.h:2175
UInt32Reflectable(uint32_t value)
Definition: Reflectable.h:660
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:544
uint16_t getUInt16() const override
Definition: Reflectable.h:4448
void append(const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:4544
size_t initializeOffsets() override
Definition: Reflectable.h:3976
IBasicReflectablePtr< ALLOC > at(size_t index) override
Definition: Reflectable.h:2318
bool getBool() const override
Definition: Reflectable.h:299
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2480
IBasicReflectableConstPtr< ALLOC > operator[](size_t index) const override
Definition: Reflectable.h:4400
int64_t getInt64() const override
Definition: Reflectable.h:4174
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1095
static IBasicReflectablePtr< ALLOC > getFloat16(float value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3434
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2390
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2146
size_t bitSizeOfVarUInt16(uint16_t value)
static IBasicReflectablePtr< ALLOC > getVarUIntArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3780
void initialize(const vector< AnyHolder< ALLOC >, ALLOC > &typeArguments) override
Definition: Reflectable.h:4274
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2814
float getFloat() const override
Definition: Reflectable.h:3247
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1456
UInt16Reflectable(uint16_t value)
Definition: Reflectable.h:630
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) override
Definition: Reflectable.h:2779
IBasicReflectablePtr< ALLOC > operator[](StringView path) override
Definition: Reflectable.h:3172
static IBasicReflectablePtr< ALLOC > getVarInt32(int32_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3387
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:141
size_t size() const override
Definition: Reflectable.h:2809
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:609
EnumReflectableArray(const ALLOC &allocator, RAW_ARRAY &rawArray)
Definition: Reflectable.h:2976
static IBasicReflectableConstPtr< ALLOC > getDynamicSignedBitFieldArray(const RAW_ARRAY &rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3633
uint64_t toUInt() const override
Definition: Reflectable.h:4502
static const IBasicTypeInfo< ALLOC > & getFixedUnsignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1196
IBasicReflectablePtr< ALLOC > at(size_t index) override
Definition: Reflectable.h:3192
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t bitSize)
Definition: Reflectable.h:748
size_t bitSizeOfBitBuffer(const BasicBitBuffer< ALLOC > &bitBuffer)
static IBasicReflectablePtr< ALLOC > getBitBuffer(const BasicBitBuffer< ALLOC > &value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3459
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2272
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1765
BuiltinReflectableArray(const ALLOC &allocator, RAW_ARRAY &rawArray)
Definition: Reflectable.h:2166
static const IBasicTypeInfo< ALLOC > & getDynamicSignedBitField(uint8_t maxBitSize)
Definition: TypeInfo.h:1202
static const IBasicTypeInfo< ALLOC > & getFloat64()
Definition: TypeInfo.h:1157
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1426
uint16_t getUInt16() const override
Definition: Reflectable.h:419
static IBasicReflectablePtr< ALLOC > getUInt64(uint64_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3320
static IBasicReflectableConstPtr< ALLOC > getUInt16Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3556
const IBasicTypeInfo< ALLOC > & getTypeInfo() const override
Definition: Reflectable.h:3067
int32_t getInt32() const override
Definition: Reflectable.h:4430
static IBasicReflectableConstPtr< ALLOC > getVarInt64Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3697
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1366
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t maxBitSize)
Definition: Reflectable.h:1027
Float16Reflectable(float value)
Definition: Reflectable.h:1621
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:489
IBasicReflectablePtr< ALLOC > at(size_t index) override
Definition: Reflectable.h:2871
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:969
Span< const uint8_t > getBytes() const override
Definition: Reflectable.h:3249
int8_t getInt8() const override
Definition: Reflectable.h:319
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1224
static IBasicReflectableConstPtr< ALLOC > getVarUIntArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3772
static IBasicReflectableConstPtr< ALLOC > getVarIntArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3712
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1625
void writeFloat64(double data)
static IBasicReflectablePtr< ALLOC > getVarInt16(int16_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3381
double getDouble() const override
Definition: Reflectable.h:3248
float getFloat() const override
Definition: Reflectable.h:1635
BytesReflectable(Span< const uint8_t > value)
Definition: Reflectable.h:1726
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1486
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2306
IBasicReflectablePtr< ALLOC > at(size_t index) override
Definition: Reflectable.h:2747
size_t bitSizeOfVarUInt32(uint32_t value)
static bool isCompound(SchemaType schemaType)
Definition: TypeInfoUtil.cpp:6
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1810
uint64_t getUInt64() const override
Definition: Reflectable.h:4460
int64_t getInt64() const override
Definition: Reflectable.h:379
DynamicBitFieldReflectableArray(const ALLOC &allocator, RAW_ARRAY &rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:2424
Int16Reflectable(int16_t value)
Definition: Reflectable.h:510
static IBasicReflectableConstPtr< ALLOC > getVarInt32Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3682
static IBasicReflectablePtr< ALLOC > getVarSizeArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3795
static IBasicReflectablePtr< ALLOC > getVarInt64(int64_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3393
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1417
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) override
Definition: Reflectable.h:2909
static IBasicReflectableConstPtr< ALLOC > getVarInt16Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3667
FixedBitFieldReflectableConstArray(const ALLOC &allocator, const RAW_ARRAY &rawArray, uint8_t bitSize)
Definition: Reflectable.h:2251
double getDouble() const override
Definition: Reflectable.h:1705
void setAt(const AnyHolder< ALLOC > &value, size_t index) override
Definition: Reflectable.h:2330
void writeBits(uint32_t data, uint8_t numBits=32)
const IBasicTypeInfo< ALLOC > & getTypeInfo() const override
Definition: Reflectable.h:3946
static const IBasicTypeInfo< ALLOC > & getInt16()
Definition: TypeInfo.h:1022
ReflectableBase(const IBasicTypeInfo< ALLOC > &typeInfo)
Definition: Reflectable.h:3938
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1387
void writeVarUInt(uint64_t data)
static IBasicReflectablePtr< ALLOC > getEnumArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3928
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:280
FixedSignedBitFieldReflectable(int8_t value, uint8_t bitSize)
Definition: Reflectable.h:720
IBasicReflectableConstPtr< ALLOC > operator[](StringView path) const override
Definition: Reflectable.h:3167
int32_t getInt32() const override
Definition: Reflectable.h:3241
static const IBasicTypeInfo< ALLOC > & getInt64()
Definition: TypeInfo.h:1034
void resize(size_t index) override
Definition: Reflectable.h:4520
int8_t getInt8() const override
Definition: Reflectable.h:4156
Span< const uint8_t > getBytes() const override
Definition: Reflectable.h:1740
Int8Reflectable(int8_t value)
Definition: Reflectable.h:480
static const IBasicTypeInfo< ALLOC > & getVarUInt()
Definition: TypeInfo.h:1127
uint16_t getUInt16() const override
Definition: Reflectable.h:3244
AnyHolder< ALLOC > getAnyValue() override
Definition: Reflectable.h:3232
static IBasicReflectableConstPtr< ALLOC > getBoolArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3466
size_t size() const override
Definition: Reflectable.h:2726
static IBasicReflectablePtr< ALLOC > getUInt8Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3549
bool getBool() const override
Definition: Reflectable.h:3238
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1546
static IBasicReflectablePtr< ALLOC > getBitmaskArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3914
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t bitSize)
Definition: Reflectable.h:814
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1266
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1461
uint8_t getUInt8() const override
Definition: Reflectable.h:4442
StringReflectable(StringView value)
Definition: Reflectable.h:1761
float getFloat() const override
Definition: Reflectable.h:1670
VarInt64Reflectable(int64_t value)
Definition: Reflectable.h:1392
StringView getChoice() const override
Definition: Reflectable.h:4048
IBasicReflectablePtr< ALLOC > getField(StringView name) override
Definition: Reflectable.h:4286
void resize(size_t size) override
Definition: Reflectable.h:2855
IBasicReflectableConstPtr< ALLOC > getField(StringView name) const override
Definition: Reflectable.h:3112
CompoundReflectableConstArray(const ALLOC &allocator, const RAW_ARRAY &rawArray)
Definition: Reflectable.h:2682
static const IBasicTypeInfo< ALLOC > & getVarInt64()
Definition: TypeInfo.h:1082
static IBasicReflectablePtr< ALLOC > getInt8Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3489
std::vector< T, RebindAlloc< ALLOC, T >> vector
Definition: Vector.h:16
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1537
const IBasicTypeInfo< ALLOC > & enumTypeInfo()
static const IBasicTypeInfo< ALLOC > & getFloat32()
Definition: TypeInfo.h:1151
static IBasicReflectableConstPtr< ALLOC > getBitmaskArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3906
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2702
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:3107
static IBasicReflectablePtr< ALLOC > getDynamicSignedBitField(T value, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3340
IBasicReflectablePtr< ALLOC > enumReflectable(T value, const ALLOC &allocator=ALLOC())
static IBasicReflectableConstPtr< ALLOC > getInt64Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3526
static IBasicReflectableConstPtr< ALLOC > getInt16Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3496
VarSizeReflectable(uint32_t value)
Definition: Reflectable.h:1572
int64_t getInt64() const override
Definition: Reflectable.h:3242
size_t bitSizeOfVarUInt(uint64_t value)
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1341
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1137
static IBasicReflectablePtr< ALLOC > getBitBufferArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3885
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:565
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:634
static IBasicReflectableConstPtr< ALLOC > getVarUInt16Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3727
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) override
Definition: Reflectable.h:2351
AnyHolder< ALLOC > getAnyValue() const override
Definition: Reflectable.h:3227
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:549
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:655
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:768
static const IBasicTypeInfo< ALLOC > & getVarInt()
Definition: TypeInfo.h:1091
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1770
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:574
void append(const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:3212
const BasicBitBuffer< ALLOC > & getBitBuffer() const override
Definition: Reflectable.h:3251
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) const override
Definition: Reflectable.h:2346
BuiltinReflectableBase(const IBasicTypeInfo< ALLOC > &typeInfo, const T &value)
Definition: Reflectable.h:131
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1616
VarIntReflectable(int64_t value)
Definition: Reflectable.h:1422
uint8_t getUInt8() const override
Definition: Reflectable.h:3243
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1721
static const IBasicTypeInfo< ALLOC > & getDynamicUnsignedBitField(uint8_t maxBitSize)
Definition: TypeInfo.h:1241
IBasicReflectableConstPtr< ALLOC > operator[](size_t index) const override
Definition: Reflectable.h:3197
static IBasicReflectablePtr< ALLOC > getDynamicUnsignedBitFieldArray(RAW_ARRAY &rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3659
void append(const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:4120
IBasicReflectableConstPtr< ALLOC > getField(StringView name) const override
Definition: Reflectable.h:4346
Span< const uint8_t > getBytes() const override
Definition: Reflectable.h:4216
uint32_t getUInt32() const override
Definition: Reflectable.h:3245
VarUInt64Reflectable(uint64_t value)
Definition: Reflectable.h:1512
uint32_t getUInt32() const override
Definition: Reflectable.h:4454
size_t bitSizeOfVarInt(int64_t value)
DynamicUnsignedBitFieldReflectable(uint16_t value, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:1203
bool isArray() const override
Definition: Reflectable.h:3072
void setAt(const AnyHolder< ALLOC > &value, size_t index) override
Definition: Reflectable.h:2758
void setField(StringView name, const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:4018
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1396
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1336
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1521
void initialize(const vector< AnyHolder< ALLOC >, ALLOC > &typeArguments) override
Definition: Reflectable.h:4322
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:834
size_t initializeOffsets() override
Definition: Reflectable.h:3092
void resize(size_t size) override
Definition: Reflectable.h:3182
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t maxBitSize)
Definition: Reflectable.h:1282
IBasicReflectablePtr< ALLOC > at(size_t index) override
Definition: Reflectable.h:2191
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) override
Definition: Reflectable.h:3039
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t maxBitSize)
Definition: Reflectable.h:1198
FixedSignedBitFieldReflectable(int64_t value, uint8_t bitSize)
Definition: Reflectable.h:819
BasicStringView substr(size_type pos=0, size_type count=npos) const
Definition: StringView.h:335
IBasicReflectableConstPtr< ALLOC > find(StringView path) const override
Definition: Reflectable.h:4054
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) override
Definition: Reflectable.h:3222
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:579
static const IBasicTypeInfo< ALLOC > & getVarSize()
Definition: TypeInfo.h:1136
size_t bitSizeOfString(StringView stringValue)
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) override
Definition: Reflectable.h:2223
static IBasicReflectablePtr< ALLOC > getUInt64Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3594
static IBasicReflectablePtr< ALLOC > getVarIntArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3720
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:2691
VarUInt32Reflectable(uint32_t value)
Definition: Reflectable.h:1482
static IBasicReflectableConstPtr< ALLOC > getInt8Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3481
void append(const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:2341
double getDouble() const override
Definition: Reflectable.h:4472
static constexpr const size_type npos
Definition: StringView.h:42
static const IBasicTypeInfo< ALLOC > & getString()
Definition: TypeInfo.h:1172
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:289
static IBasicReflectablePtr< ALLOC > getVarUInt(uint64_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3422
static IBasicReflectableConstPtr< ALLOC > getVarUInt64Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3757
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:505
static const IBasicTypeInfo< ALLOC > & getUInt8()
Definition: TypeInfo.h:1040
double getDouble() const override
Definition: Reflectable.h:4210
static const IBasicTypeInfo< ALLOC > & getUInt16()
Definition: TypeInfo.h:1046
double toDouble() const override
Definition: Reflectable.h:4248
bool getBool() const override
Definition: Reflectable.h:4150
static IBasicReflectablePtr< ALLOC > getBoolArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3474
string< ALLOC > toString(const ALLOC &allocator) const override
Definition: Reflectable.h:220
void append(const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:2475
static IBasicReflectablePtr< ALLOC > getFloat64Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3840
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:294
Span< const uint8_t > getBytes() const override
Definition: Reflectable.h:4478
Float64Reflectable(double value)
Definition: Reflectable.h:1691
static IBasicReflectablePtr< ALLOC > getCompoundArray(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3900
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1477
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:484
ReflectableAllocatorHolderBase(const IBasicTypeInfo< ALLOC > &typeInfo, const ALLOC &allocator)
Definition: Reflectable.h:1991
uint32_t getUInt32() const override
Definition: Reflectable.h:439
const BasicBitBuffer< ALLOC > & getBitBuffer() const override
Definition: Reflectable.h:4228
IBasicReflectableConstPtr< ALLOC > callFunction(StringView name) const override
Definition: Reflectable.h:4036
static IBasicReflectablePtr< ALLOC > getInt32(int32_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3295
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1686
static IBasicReflectablePtr< ALLOC > getFloat32(float value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3439
void initialize(const vector< AnyHolder< ALLOC >, ALLOC > &typeArguments) override
Definition: Reflectable.h:3964
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:699
AnyHolder< ALLOC > getAnyValue(const ALLOC &allocator) override
Definition: Reflectable.h:146
Int32Reflectable(int32_t value)
Definition: Reflectable.h:540
AnyHolder< ALLOC > getAnyValue() const override
Definition: Reflectable.h:4138
int16_t getInt16() const override
Definition: Reflectable.h:339
double toDouble() const override
Definition: Reflectable.h:1600
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:870
std::basic_string< char, std::char_traits< char >, RebindAlloc< ALLOC, char >> string
Definition: String.h:16
IBasicReflectablePtr< ALLOC > getField(StringView name) override
Definition: Reflectable.h:3117
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:604
static IBasicReflectablePtr< ALLOC > getUInt16(uint16_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3310
IBasicReflectablePtr< ALLOC > operator[](size_t index) override
Definition: Reflectable.h:4532
int64_t toInt() const override
Definition: Reflectable.h:4496
static IBasicReflectablePtr< ALLOC > getBool(bool value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3280
bool isArray() const override
Definition: Reflectable.h:2038
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1796
static const IBasicTypeInfo< ALLOC > & getVarUInt32()
Definition: TypeInfo.h:1109
static IBasicReflectableConstPtr< ALLOC > getFloat32Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3817
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1357
FixedSignedBitFieldReflectable(int16_t value, uint8_t bitSize)
Definition: Reflectable.h:753
StringView getStringView() const override
Definition: Reflectable.h:3250
static IBasicReflectableConstPtr< ALLOC > getFixedSignedBitFieldArray(const RAW_ARRAY &rawArray, uint8_t bitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3601
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:514
static IBasicReflectablePtr< ALLOC > getFixedSignedBitFieldArray(RAW_ARRAY &rawArray, uint8_t bitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3609
static IBasicReflectablePtr< ALLOC > getVarUInt32(uint32_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3410
int32_t getInt32() const override
Definition: Reflectable.h:359
UInt64Reflectable(uint64_t value)
Definition: Reflectable.h:690
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:4340
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1491
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:639
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t bitSize)
Definition: Reflectable.h:781
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t bitSize)
Definition: Reflectable.h:715
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:801
void writeSignedBits64(int64_t data, uint8_t numBits=64)
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t bitSize)
Definition: Reflectable.h:916
double toDouble() const override
Definition: Reflectable.h:4508
float getFloat() const override
Definition: Reflectable.h:4204
static const IBasicTypeInfo< ALLOC > & getUInt32()
Definition: TypeInfo.h:1052
static IBasicReflectableConstPtr< ALLOC > getUInt32Array(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3571
static IBasicReflectablePtr< ALLOC > getInt8(int8_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3285
IBasicReflectableConstPtr< ALLOC > getParameter(StringView name) const override
Definition: Reflectable.h:4024
static IBasicReflectablePtr< ALLOC > getDynamicSignedBitFieldArray(RAW_ARRAY &rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3642
DynamicBitFieldReflectableConstArray(const ALLOC &allocator, const RAW_ARRAY &rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:2379
void setField(StringView name, const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:3127
size_t bitSizeOfVarInt32(int32_t value)
uint64_t toUInt() const override
Definition: Reflectable.h:264
static IBasicReflectablePtr< ALLOC > getBytes(Span< const uint8_t > value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3449
IBasicReflectableConstPtr< ALLOC > at(size_t index) const override
Definition: Reflectable.h:4090
BitBufferReflectable(const BasicBitBuffer< ALLOC > &value)
Definition: Reflectable.h:1801
static IBasicReflectableConstPtr< ALLOC > getDynamicUnsignedBitFieldArray(const RAW_ARRAY &rawArray, uint8_t maxBitSize, uint8_t dynamicBitSize, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3650
static IBasicReflectablePtr< ALLOC > getUInt16Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3564
void resize(size_t size) override
Definition: Reflectable.h:2985
IBasicReflectableConstPtr< ALLOC > getField(StringView name) const override
Definition: Reflectable.h:4000
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1327
void resize(size_t size) override
Definition: Reflectable.h:4084
IBasicReflectableConstPtr< ALLOC > find(StringView path) const override
Definition: Reflectable.h:3157
DynamicSignedBitFieldReflectable(int16_t value, uint8_t maxBitSize, uint8_t dynamicBitSize)
Definition: Reflectable.h:1032
void resize(size_t size) override
Definition: Reflectable.h:2731
size_t size() const override
Definition: Reflectable.h:2130
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1660
static IBasicReflectablePtr< ALLOC > getString(StringView value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3454
static const IBasicTypeInfo< ALLOC > & getInt8()
Definition: TypeInfo.h:1016
uint16_t getUInt16() const override
Definition: Reflectable.h:4186
static IBasicReflectablePtr< ALLOC > getVarUInt64(uint64_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3416
FixedUnsignedBitFieldReflectable(uint32_t value, uint8_t bitSize)
Definition: Reflectable.h:921
ReflectableOwner(const ALLOC &allocator)
Definition: Reflectable.h:3062
static const IBasicTypeInfo< ALLOC > & getBitBuffer()
Definition: TypeInfo.h:1181
size_t size() const override
Definition: Reflectable.h:4078
static IBasicReflectablePtr< ALLOC > getInt32Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3519
VarUInt16Reflectable(uint16_t value)
Definition: Reflectable.h:1452
void append(const AnyHolder< ALLOC > &value) override
Definition: Reflectable.h:2769
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1182
IBasicReflectablePtr< ALLOC > createField(StringView name) override
Definition: Reflectable.h:3122
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t bitSize)
Definition: Reflectable.h:850
static const IBasicTypeInfo< ALLOC > & getVarInt32()
Definition: TypeInfo.h:1073
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t bitSize)
Definition: Reflectable.h:949
static const IBasicTypeInfo< ALLOC > & getFixedSignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1190
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1516
size_t initializeOffsets(size_t bitPosition) override
Definition: Reflectable.h:3087
uint64_t getUInt64() const override
Definition: Reflectable.h:3246
int16_t getInt16() const override
Definition: Reflectable.h:3240
size_t bitSizeOf(size_t) const override
Definition: Reflectable.h:1576
static const IBasicTypeInfo< ALLOC > & getVarUInt64()
Definition: TypeInfo.h:1118
static IBasicReflectableConstPtr< ALLOC > getBitBufferArray(const RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3877
VarInt32Reflectable(int32_t value)
Definition: Reflectable.h:1362
static const IBasicTypeInfo< ALLOC > & typeInfo(uint8_t maxBitSize)
Definition: Reflectable.h:985
string< ALLOC > toString(const ALLOC &allocator) const override
Definition: Reflectable.h:1780
void write(BitStreamWriter &writer) const override
Definition: Reflectable.h:1735
void writeBits64(uint64_t data, uint8_t numBits=64)
int16_t getInt16() const override
Definition: Reflectable.h:4424
static IBasicReflectablePtr< ALLOC > getVarSize(uint32_t value, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3428
uint64_t toUInt() const override
Definition: Reflectable.h:3255
static IBasicReflectablePtr< ALLOC > getFloat16Array(RAW_ARRAY &rawArray, const ALLOC &allocator=ALLOC())
Definition: Reflectable.h:3810
static const IBasicTypeInfo< ALLOC > & typeInfo()
Definition: Reflectable.h:1651