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