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