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