Zserio C++ runtime library  1.3.0
Built for Zserio 2.18.0
TypeInfo.h
Go to the documentation of this file.
1 #ifndef ZSERIO_TYPE_INFO_INC_H
2 #define ZSERIO_TYPE_INFO_INC_H
3 
4 #include <algorithm>
5 #include <memory>
6 #include <string>
7 
8 #include "zserio/AnyHolder.h"
9 #include "zserio/BitBuffer.h"
11 #include "zserio/ITypeInfo.h"
12 #include "zserio/Types.h"
13 
14 namespace zserio
15 {
16 
23 template <typename ALLOC>
24 class TypeInfoBase : public IBasicTypeInfo<ALLOC>
25 {
26 public:
34  TypeInfoBase(StringView schemaName, SchemaType schemaType, CppType cppType);
35 
40  TypeInfoBase(const TypeInfoBase&) = delete;
41  TypeInfoBase& operator=(const TypeInfoBase&) = delete;
42 
43  TypeInfoBase(const TypeInfoBase&&) = delete;
44  TypeInfoBase& operator=(const TypeInfoBase&&) = delete;
49  ~TypeInfoBase() override = 0;
50 
51  StringView getSchemaName() const override;
52  SchemaType getSchemaType() const override;
53  CppType getCppType() const override;
54  uint8_t getBitSize() const override;
55 
59 
60  StringView getSelector() const override;
62 
63  const IBasicTypeInfo<ALLOC>& getUnderlyingType() const override;
67 
69  StringView getSqlConstraint() const override;
70  StringView getVirtualTableUsing() const override;
71  bool isWithoutRowId() const override;
72 
74 
75  StringView getTemplateName() const override;
77 
80 
81  IBasicReflectablePtr<ALLOC> createInstance(const ALLOC& allocator) const override;
83 
84 private:
85  StringView m_schemaName;
86  SchemaType m_schemaType;
87  CppType m_cppType;
88 };
89 
93 template <typename ALLOC = std::allocator<uint8_t>>
94 class BuiltinTypeInfo : public TypeInfoBase<ALLOC>
95 {
96 protected:
104  BuiltinTypeInfo(StringView schemaName, SchemaType schemaType, CppType cppType);
105 
106 public:
113 
120 
127 
134 
141 
148 
155 
162 
169 
176 
183 
190 
197 
204 
211 
218 
225 
232 
239 
246 
253 
260 
267 
274 
282  static const IBasicTypeInfo<ALLOC>& getFixedSignedBitField(uint8_t bitSize);
283 
291  static const IBasicTypeInfo<ALLOC>& getFixedUnsignedBitField(uint8_t bitSize);
292 
300  static const IBasicTypeInfo<ALLOC>& getDynamicSignedBitField(uint8_t maxBitSize);
301 
309  static const IBasicTypeInfo<ALLOC>& getDynamicUnsignedBitField(uint8_t maxBitSize);
310 };
311 
315 template <typename ALLOC>
317 {
318 protected:
327  FixedSizeBuiltinTypeInfo(StringView schemaName, SchemaType schemaType, CppType cppType, uint8_t bitSize);
328 
329 public:
330  uint8_t getBitSize() const override;
331 
337  static const IBasicTypeInfo<ALLOC>& getBool();
338 
344  static const IBasicTypeInfo<ALLOC>& getInt8();
345 
351  static const IBasicTypeInfo<ALLOC>& getInt16();
352 
358  static const IBasicTypeInfo<ALLOC>& getInt32();
359 
365  static const IBasicTypeInfo<ALLOC>& getInt64();
366 
372  static const IBasicTypeInfo<ALLOC>& getUInt8();
373 
379  static const IBasicTypeInfo<ALLOC>& getUInt16();
380 
386  static const IBasicTypeInfo<ALLOC>& getUInt32();
387 
393  static const IBasicTypeInfo<ALLOC>& getUInt64();
394 
400  static const IBasicTypeInfo<ALLOC>& getFloat16();
401 
407  static const IBasicTypeInfo<ALLOC>& getFloat32();
408 
414  static const IBasicTypeInfo<ALLOC>& getFloat64();
415 
423  static const IBasicTypeInfo<ALLOC>& getFixedSignedBitField(uint8_t bitSize);
424 
432  static const IBasicTypeInfo<ALLOC>& getFixedUnsignedBitField(uint8_t bitSize);
433 
434 private:
435  uint8_t m_bitSize;
436 };
437 
441 template <typename ALLOC>
443 {
444 public:
454  TemplatableTypeInfoBase(StringView schemaName, SchemaType schemaType, CppType cppType,
455  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments);
456 
457  ~TemplatableTypeInfoBase() override = 0;
458 
461 
464 
465  StringView getTemplateName() const override;
467 
468 private:
469  StringView m_templateName;
470  Span<const BasicTemplateArgumentInfo<ALLOC>> m_templateArguments;
471 };
472 
476 template <typename ALLOC>
478 {
479 public:
482 
495  CompoundTypeInfoBase(StringView schemaName, CreateInstanceFunc createInstanceFunc, SchemaType schemaType,
496  CppType cppType, StringView templateName,
497  Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
498  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
499  Span<const BasicFunctionInfo<ALLOC>> functions);
500 
501  ~CompoundTypeInfoBase() override = 0;
502 
505 
508 
512 
513  IBasicReflectablePtr<ALLOC> createInstance(const ALLOC& allocator) const override;
514 
515 private:
516  CreateInstanceFunc m_createInstanceFunc;
520 };
521 
525 template <typename ALLOC>
527 {
528 public:
530 
541  StructTypeInfo(StringView schemaName, CreateInstanceFunc createInstanceFunc, StringView templateName,
542  Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
543  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
544  Span<const BasicFunctionInfo<ALLOC>> functions);
545 };
546 
550 template <typename ALLOC>
551 class UnionTypeInfo : public CompoundTypeInfoBase<ALLOC>
552 {
553 public:
555 
566  UnionTypeInfo(StringView schemaName, CreateInstanceFunc createInstanceFunc, StringView templateName,
567  Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
568  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
569  Span<const BasicFunctionInfo<ALLOC>> functions);
570 };
571 
575 template <typename ALLOC>
577 {
578 public:
580 
593  ChoiceTypeInfo(StringView schemaName, CreateInstanceFunc createInstanceFunc, StringView templateName,
594  Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
595  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
596  Span<const BasicFunctionInfo<ALLOC>> functions, StringView selector,
597  Span<const BasicCaseInfo<ALLOC>> cases);
598 
599  StringView getSelector() const override;
600  Span<const BasicCaseInfo<ALLOC>> getCases() const override;
601 
602 private:
603  StringView m_selector;
605 };
606 
610 template <typename ALLOC>
612 {
613 public:
623  TypeInfoWithUnderlyingTypeBase(StringView schemaName, SchemaType schemaType, CppType cppType,
624  const IBasicTypeInfo<ALLOC>& underlyingType, Span<const StringView> underlyingTypeArguments);
625 
626  const IBasicTypeInfo<ALLOC>& getUnderlyingType() const override;
628 
629 private:
630  const IBasicTypeInfo<ALLOC>& m_underlyingType;
631  Span<const StringView> m_underlyingTypeArguments;
632 };
633 
637 template <typename ALLOC>
639 {
640 public:
649  EnumTypeInfo(StringView schemaName, const IBasicTypeInfo<ALLOC>& underlyingType,
650  Span<const StringView> underlyingTypeArguments, Span<const ItemInfo> enumItems);
651 
652  Span<const ItemInfo> getEnumItems() const override;
653 
654 private:
655  Span<const ItemInfo> m_enumItems;
656 };
657 
661 template <typename ALLOC>
663 {
664 public:
673  BitmaskTypeInfo(StringView schemaName, const IBasicTypeInfo<ALLOC>& underlyingType,
674  Span<const StringView> underlyingTypeArguments, Span<const ItemInfo> bitmaskValues);
675 
676  Span<const ItemInfo> getBitmaskValues() const override;
677 
678 private:
679  Span<const ItemInfo> m_bitmaskValues;
680 };
681 
685 template <typename ALLOC>
687 {
688 public:
700  SqlTableTypeInfo(StringView schemaName, StringView templateName,
701  Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
702  Span<const BasicColumnInfo<ALLOC>> columns, StringView sqlConstraint, StringView virtualTableUsing,
703  bool isWithoutRowId);
704 
706  StringView getSqlConstraint() const override;
707  StringView getVirtualTableUsing() const override;
708  bool isWithoutRowId() const override;
709 
710 private:
712  StringView m_sqlConstraint;
713  StringView m_virtualTableUsing;
714  bool m_isWithoutRowId;
715 };
716 
720 template <typename ALLOC>
721 class SqlDatabaseTypeInfo : public TypeInfoBase<ALLOC>
722 {
723 public:
730  SqlDatabaseTypeInfo(StringView schemaName, Span<const BasicTableInfo<ALLOC>> tables);
731 
733 
734 private:
736 };
737 
741 template <typename ALLOC>
742 class PubsubTypeInfo : public TypeInfoBase<ALLOC>
743 {
744 public:
751  PubsubTypeInfo(StringView schemaName, Span<const BasicMessageInfo<ALLOC>> messages);
752 
754 
755 private:
757 };
758 
762 template <typename ALLOC>
763 class ServiceTypeInfo : public TypeInfoBase<ALLOC>
764 {
765 public:
772  ServiceTypeInfo(StringView schemaName, Span<const BasicMethodInfo<ALLOC>> methods);
773 
775 
776 private:
778 };
779 
784 template <typename ALLOC>
785 class RecursiveTypeInfo : public IBasicTypeInfo<ALLOC>
786 {
787 public:
789  using TypeInfoFunc = const IBasicTypeInfo<ALLOC>& (*)();
790 
796  explicit RecursiveTypeInfo(TypeInfoFunc typeInfoFunc) :
797  m_typeInfoFunc(typeInfoFunc)
798  {}
799 
800  ~RecursiveTypeInfo() override = default;
801 
808 
815  StringView getSchemaName() const override;
816  SchemaType getSchemaType() const override;
817  CppType getCppType() const override;
818  uint8_t getBitSize() const override;
819 
823 
824  StringView getSelector() const override;
825  Span<const BasicCaseInfo<ALLOC>> getCases() const override;
826 
827  const IBasicTypeInfo<ALLOC>& getUnderlyingType() const override;
829  Span<const ItemInfo> getEnumItems() const override;
830  Span<const ItemInfo> getBitmaskValues() const override;
831 
833  StringView getSqlConstraint() const override;
834  StringView getVirtualTableUsing() const override;
835  bool isWithoutRowId() const override;
836 
838 
839  StringView getTemplateName() const override;
841 
844 
845  IBasicReflectablePtr<ALLOC> createInstance(const ALLOC& allocator) const override;
847 
848 private:
849  TypeInfoFunc m_typeInfoFunc;
850 };
851 
852 template <typename ALLOC>
854  m_schemaName(schemaName),
855  m_schemaType(schemaType),
856  m_cppType(cppType)
857 {}
858 
859 template <typename ALLOC>
861 
862 template <typename ALLOC>
864 {
865  return m_schemaName;
866 }
867 
868 template <typename ALLOC>
870 {
871  return m_schemaType;
872 }
873 
874 template <typename ALLOC>
876 {
877  return m_cppType;
878 }
879 
880 template <typename ALLOC>
882 {
883  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a fixed size type!";
884 }
885 
886 template <typename ALLOC>
888 {
889  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a compound type!";
890 }
891 
892 template <typename ALLOC>
894 {
895  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a compound type!";
896 }
897 
898 template <typename ALLOC>
900 {
901  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a compound type!";
902 }
903 
904 template <typename ALLOC>
906 {
907  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a choice type!";
908 }
909 
910 template <typename ALLOC>
912 {
913  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a choice type!";
914 }
915 
916 template <typename ALLOC>
918 {
919  throw CppRuntimeException("Type '") << getSchemaName() << "' does not have underlying type!";
920 }
921 
922 template <typename ALLOC>
924 {
925  throw CppRuntimeException("Type '") << getSchemaName() << "' does not have underlying type!";
926 }
927 
928 template <typename ALLOC>
930 {
931  throw CppRuntimeException("Type '") << getSchemaName() << "' is not an enum type!";
932 }
933 
934 template <typename ALLOC>
936 {
937  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a bitmask type!";
938 }
939 
940 template <typename ALLOC>
942 {
943  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL table type!";
944 }
945 
946 template <typename ALLOC>
948 {
949  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL table type!";
950 }
951 
952 template <typename ALLOC>
954 {
955  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL table type!";
956 }
957 
958 template <typename ALLOC>
960 {
961  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL table type!";
962 }
963 
964 template <typename ALLOC>
966 {
967  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL database type!";
968 }
969 
970 template <typename ALLOC>
972 {
973  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a templatable type!";
974 }
975 
976 template <typename ALLOC>
978 {
979  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a templatable type!";
980 }
981 
982 template <typename ALLOC>
984 {
985  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a pubsub type!";
986 }
987 
988 template <typename ALLOC>
990 {
991  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a service type!";
992 }
993 
994 template <typename ALLOC>
996 {
997  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a compound type!";
998 }
999 
1000 template <typename ALLOC>
1002 {
1003  return createInstance(ALLOC());
1004 }
1005 
1006 template <typename ALLOC>
1008  TypeInfoBase<ALLOC>(schemaName, schemaType, cppType)
1009 {}
1010 
1011 template <typename ALLOC>
1013 {
1015 }
1016 
1017 template <typename ALLOC>
1019 {
1021 }
1022 
1023 template <typename ALLOC>
1025 {
1027 }
1028 
1029 template <typename ALLOC>
1031 {
1033 }
1034 
1035 template <typename ALLOC>
1037 {
1039 }
1040 
1041 template <typename ALLOC>
1043 {
1045 }
1046 
1047 template <typename ALLOC>
1049 {
1051 }
1052 
1053 template <typename ALLOC>
1055 {
1057 }
1058 
1059 template <typename ALLOC>
1061 {
1063 }
1064 
1065 template <typename ALLOC>
1067 {
1068  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1069  makeStringView("varint16"), SchemaType::VARINT16, CppType::INT16};
1070  return typeInfo;
1071 }
1072 
1073 template <typename ALLOC>
1075 {
1076  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1077  makeStringView("varint32"), SchemaType::VARINT32, CppType::INT32};
1078  return typeInfo;
1079 }
1080 
1081 template <typename ALLOC>
1083 {
1084  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1085  makeStringView("varint64"), SchemaType::VARINT64, CppType::INT64};
1086  return typeInfo;
1087 }
1088 
1089 template <typename ALLOC>
1091 {
1092  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1093  makeStringView("varint"), SchemaType::VARINT, CppType::INT64};
1094  return typeInfo;
1095 }
1096 
1097 template <typename ALLOC>
1099 {
1100  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1101  makeStringView("varuint16"), SchemaType::VARUINT16, CppType::UINT16};
1102  return typeInfo;
1103 }
1104 
1105 template <typename ALLOC>
1107 {
1108  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1109  makeStringView("varuint32"), SchemaType::VARUINT32, CppType::UINT32};
1110  return typeInfo;
1111 }
1112 
1113 template <typename ALLOC>
1115 {
1116  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1117  makeStringView("varuint64"), SchemaType::VARUINT64, CppType::UINT64};
1118  return typeInfo;
1119 }
1120 
1121 template <typename ALLOC>
1123 {
1124  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1125  makeStringView("varuint"), SchemaType::VARUINT, CppType::UINT64};
1126  return typeInfo;
1127 }
1128 
1129 template <typename ALLOC>
1131 {
1132  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1133  makeStringView("varsize"), SchemaType::VARSIZE, CppType::UINT32};
1134  return typeInfo;
1135 }
1136 
1137 template <typename ALLOC>
1139 {
1141 }
1142 
1143 template <typename ALLOC>
1145 {
1147 }
1148 
1149 template <typename ALLOC>
1151 {
1153 }
1154 
1155 template <typename ALLOC>
1157 {
1158  static const BuiltinTypeInfo<ALLOC> typeInfo = {makeStringView("bytes"), SchemaType::BYTES, CppType::BYTES};
1159  return typeInfo;
1160 }
1161 
1162 template <typename ALLOC>
1164 {
1165  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1166  makeStringView("string"), SchemaType::STRING, CppType::STRING};
1167  return typeInfo;
1168 }
1169 
1170 template <typename ALLOC>
1172 {
1173  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1174  makeStringView("extern"), SchemaType::EXTERN, CppType::BIT_BUFFER};
1175  return typeInfo;
1176 }
1177 
1178 template <typename ALLOC>
1180 {
1182 }
1183 
1184 template <typename ALLOC>
1186 {
1188 }
1189 
1190 template <typename ALLOC>
1192 {
1193  if (maxBitSize == 0 || maxBitSize > 64)
1194  {
1195  throw CppRuntimeException("BuiltinTypeInfo::getDynamicSignedBitField: Invalid max bit size '")
1196  << maxBitSize << "'!";
1197  }
1198 
1199  if (maxBitSize <= 8)
1200  {
1201  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1202  "int<>"_sv, SchemaType::DYNAMIC_SIGNED_BITFIELD, CppType::INT8};
1203  return typeInfo;
1204  }
1205  else if (maxBitSize <= 16)
1206  {
1207  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1208  "int<>"_sv, SchemaType::DYNAMIC_SIGNED_BITFIELD, CppType::INT16};
1209  return typeInfo;
1210  }
1211  else if (maxBitSize <= 32)
1212  {
1213  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1214  "int<>"_sv, SchemaType::DYNAMIC_SIGNED_BITFIELD, CppType::INT32};
1215  return typeInfo;
1216  }
1217  else
1218  {
1219  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1220  "int<>"_sv, SchemaType::DYNAMIC_SIGNED_BITFIELD, CppType::INT64};
1221  return typeInfo;
1222  }
1223 }
1224 
1225 template <typename ALLOC>
1227 {
1228  if (maxBitSize == 0 || maxBitSize > 64)
1229  {
1230  throw CppRuntimeException("BuiltinTypeInfo::getDynamicUnsignedBitField: Invalid max bit size '")
1231  << maxBitSize << "'!";
1232  }
1233 
1234  if (maxBitSize <= 8)
1235  {
1236  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1237  "bit<>"_sv, SchemaType::DYNAMIC_UNSIGNED_BITFIELD, CppType::UINT8};
1238  return typeInfo;
1239  }
1240  else if (maxBitSize <= 16)
1241  {
1242  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1243  "bit<>"_sv, SchemaType::DYNAMIC_UNSIGNED_BITFIELD, CppType::UINT16};
1244  return typeInfo;
1245  }
1246  else if (maxBitSize <= 32)
1247  {
1248  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1249  "bit<>"_sv, SchemaType::DYNAMIC_UNSIGNED_BITFIELD, CppType::UINT32};
1250  return typeInfo;
1251  }
1252  else
1253  {
1254  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1255  "bit<>"_sv, SchemaType::DYNAMIC_UNSIGNED_BITFIELD, CppType::UINT64};
1256  return typeInfo;
1257  }
1258 }
1259 
1260 template <typename ALLOC>
1262  StringView schemaName, SchemaType schemaType, CppType cppType, uint8_t bitSize) :
1263  BuiltinTypeInfo<ALLOC>(schemaName, schemaType, cppType),
1264  m_bitSize(bitSize)
1265 {}
1266 
1267 template <typename ALLOC>
1269 {
1270  return m_bitSize;
1271 }
1272 
1273 template <typename ALLOC>
1275 {
1276  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1278  return typeInfo;
1279 }
1280 
1281 template <typename ALLOC>
1283 {
1284  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1286  return typeInfo;
1287 }
1288 
1289 template <typename ALLOC>
1291 {
1292  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1294  return typeInfo;
1295 }
1296 
1297 template <typename ALLOC>
1299 {
1300  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1302  return typeInfo;
1303 }
1304 
1305 template <typename ALLOC>
1307 {
1308  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1310  return typeInfo;
1311 }
1312 
1313 template <typename ALLOC>
1315 {
1316  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1318  return typeInfo;
1319 }
1320 
1321 template <typename ALLOC>
1323 {
1324  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1326  return typeInfo;
1327 }
1328 
1329 template <typename ALLOC>
1331 {
1332  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1334  return typeInfo;
1335 }
1336 
1337 template <typename ALLOC>
1339 {
1340  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1342  return typeInfo;
1343 }
1344 
1345 template <typename ALLOC>
1347 {
1348  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1350  return typeInfo;
1351 }
1352 
1353 template <typename ALLOC>
1355 {
1356  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1358  return typeInfo;
1359 }
1360 
1361 template <typename ALLOC>
1363 {
1364  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1366  return typeInfo;
1367 }
1368 
1369 template <typename ALLOC>
1371 {
1372  if (bitSize == 0 || bitSize > 64)
1373  {
1374  throw CppRuntimeException("FixedSizeBuiltinTypeInfo::getFixedSignedBitField: Invalid bit size '")
1375  << bitSize << "'!";
1376  }
1377 
1378  static const std::array<FixedSizeBuiltinTypeInfo<ALLOC>, 64> bitFieldTypeInfoArray = {
1442  {"int:64"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 64}}};
1443 
1444  return bitFieldTypeInfoArray[bitSize - 1U];
1445 }
1446 
1447 template <typename ALLOC>
1449 {
1450  if (bitSize == 0 || bitSize > 64)
1451  {
1452  throw CppRuntimeException("FixedSizeBuiltinTypeInfo::getFixedUnsignedBitField: Invalid bit size '")
1453  << bitSize << "'!";
1454  }
1455 
1456  static const std::array<FixedSizeBuiltinTypeInfo<ALLOC>, 64> bitFieldTypeInfoArray = {
1521 
1522  return bitFieldTypeInfoArray[static_cast<size_t>(bitSize - 1)];
1523 }
1524 
1525 template <typename ALLOC>
1527  CppType cppType, StringView templateName,
1528  Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments) :
1529  TypeInfoBase<ALLOC>(schemaName, schemaType, cppType),
1530  m_templateName(templateName),
1531  m_templateArguments(templateArguments)
1532 {}
1533 
1534 template <typename ALLOC>
1536 
1537 template <typename ALLOC>
1539 {
1540  return m_templateName;
1541 }
1542 
1543 template <typename ALLOC>
1545 {
1546  return m_templateArguments;
1547 }
1548 
1549 template <typename ALLOC>
1551  SchemaType schemaType, CppType cppType, StringView templateName,
1552  Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1553  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
1554  Span<const BasicFunctionInfo<ALLOC>> functions) :
1555  TemplatableTypeInfoBase<ALLOC>(schemaName, schemaType, cppType, templateName, templateArguments),
1556  m_createInstanceFunc(createInstanceFunc),
1557  m_fields(fields),
1558  m_parameters(parameters),
1559  m_functions(functions)
1560 {}
1561 
1562 template <typename ALLOC>
1564 
1565 template <typename ALLOC>
1567 {
1568  return m_fields;
1569 }
1570 
1571 template <typename ALLOC>
1573 {
1574  return m_parameters;
1575 }
1576 
1577 template <typename ALLOC>
1579 {
1580  return m_functions;
1581 }
1582 
1583 template <typename ALLOC>
1585 {
1586  if (!m_createInstanceFunc)
1587  {
1588  throw CppRuntimeException("Reflectable '")
1589  << getSchemaName() << "': Cannot create instance, "
1590  << "either '-withoutWriterCode' or '-withoutReflectionCode' zserio option is used!";
1591  }
1592  return m_createInstanceFunc(allocator);
1593 }
1594 
1595 template <typename ALLOC>
1597  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1598  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
1599  Span<const BasicFunctionInfo<ALLOC>> functions) :
1600  CompoundTypeInfoBase<ALLOC>(schemaName, createInstanceFunc, SchemaType::STRUCT, CppType::STRUCT,
1601  templateName, templateArguments, fields, parameters, functions)
1602 {}
1603 
1604 template <typename ALLOC>
1606  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1607  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
1608  Span<const BasicFunctionInfo<ALLOC>> functions) :
1609  CompoundTypeInfoBase<ALLOC>(schemaName, createInstanceFunc, SchemaType::UNION, CppType::UNION,
1610  templateName, templateArguments, fields, parameters, functions)
1611 {}
1612 
1613 template <typename ALLOC>
1615  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1616  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
1617  Span<const BasicFunctionInfo<ALLOC>> functions, StringView selector,
1618  Span<const BasicCaseInfo<ALLOC>> cases) :
1619  CompoundTypeInfoBase<ALLOC>(schemaName, createInstanceFunc, SchemaType::CHOICE, CppType::CHOICE,
1620  templateName, templateArguments, fields, parameters, functions),
1621  m_selector(selector),
1622  m_cases(cases)
1623 {}
1624 
1625 template <typename ALLOC>
1627 {
1628  return m_selector;
1629 }
1630 
1631 template <typename ALLOC>
1633 {
1634  return m_cases;
1635 }
1636 
1637 template <typename ALLOC>
1639  Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1640  Span<const BasicColumnInfo<ALLOC>> columns, StringView sqlConstraint, StringView virtualTableUsing,
1641  bool isWithoutRowId) :
1642  TemplatableTypeInfoBase<ALLOC>(
1643  schemaName, SchemaType::SQL_TABLE, CppType::SQL_TABLE, templateName, templateArguments),
1644  m_columns(columns),
1645  m_sqlConstraint(sqlConstraint),
1646  m_virtualTableUsing(virtualTableUsing),
1647  m_isWithoutRowId(isWithoutRowId)
1648 {}
1649 
1650 template <typename ALLOC>
1652 {
1653  return m_columns;
1654 }
1655 
1656 template <typename ALLOC>
1658 {
1659  return m_sqlConstraint;
1660 }
1661 
1662 template <typename ALLOC>
1664 {
1665  return m_virtualTableUsing;
1666 }
1667 
1668 template <typename ALLOC>
1670 {
1671  return m_isWithoutRowId;
1672 }
1673 
1674 template <typename ALLOC>
1676  StringView schemaName, Span<const BasicTableInfo<ALLOC>> tables) :
1677  TypeInfoBase<ALLOC>(schemaName, SchemaType::SQL_DATABASE, CppType::SQL_DATABASE),
1678  m_tables(tables)
1679 {}
1680 
1681 template <typename ALLOC>
1683 {
1684  return m_tables;
1685 }
1686 
1687 template <typename ALLOC>
1689  SchemaType schemaType, CppType cppType, const IBasicTypeInfo<ALLOC>& underlyingType,
1690  Span<const StringView> underlyingTypeArguments) :
1691  TypeInfoBase<ALLOC>(schemaName, schemaType, cppType),
1692  m_underlyingType(underlyingType),
1693  m_underlyingTypeArguments(underlyingTypeArguments)
1694 {}
1695 
1696 template <typename ALLOC>
1698 {
1699  return m_underlyingType;
1700 }
1701 
1702 template <typename ALLOC>
1704 {
1705  return m_underlyingTypeArguments;
1706 }
1707 
1708 template <typename ALLOC>
1710  Span<const StringView> underlyingTypeArguments, Span<const ItemInfo> enumItems) :
1712  schemaName, SchemaType::ENUM, CppType::ENUM, underlyingType, underlyingTypeArguments),
1713  m_enumItems(enumItems)
1714 {}
1715 
1716 template <typename ALLOC>
1718 {
1719  return m_enumItems;
1720 }
1721 
1722 template <typename ALLOC>
1724  Span<const StringView> underlyingTypeArguments, Span<const ItemInfo> bitmaskValues) :
1726  schemaName, SchemaType::BITMASK, CppType::BITMASK, underlyingType, underlyingTypeArguments),
1727  m_bitmaskValues(bitmaskValues)
1728 {}
1729 
1730 template <typename ALLOC>
1732 {
1733  return m_bitmaskValues;
1734 }
1735 
1736 template <typename ALLOC>
1738  TypeInfoBase<ALLOC>(schemaName, SchemaType::PUBSUB, CppType::PUBSUB),
1739  m_messages(messages)
1740 {}
1741 
1742 template <typename ALLOC>
1744 {
1745  return m_messages;
1746 }
1747 
1748 template <typename ALLOC>
1750  TypeInfoBase<ALLOC>(schemaName, SchemaType::SERVICE, CppType::SERVICE),
1751  m_methods(methods)
1752 {}
1753 
1754 template <typename ALLOC>
1756 {
1757  return m_methods;
1758 }
1759 
1760 template <typename ALLOC>
1762 {
1763  return m_typeInfoFunc().getSchemaName();
1764 }
1765 
1766 template <typename ALLOC>
1768 {
1769  return m_typeInfoFunc().getSchemaType();
1770 }
1771 
1772 template <typename ALLOC>
1774 {
1775  return m_typeInfoFunc().getCppType();
1776 }
1777 
1778 template <typename ALLOC>
1780 {
1781  return m_typeInfoFunc().getBitSize();
1782 }
1783 
1784 template <typename ALLOC>
1786 {
1787  return m_typeInfoFunc().getFields();
1788 }
1789 
1790 template <typename ALLOC>
1792 {
1793  return m_typeInfoFunc().getParameters();
1794 }
1795 
1796 template <typename ALLOC>
1798 {
1799  return m_typeInfoFunc().getFunctions();
1800 }
1801 
1802 template <typename ALLOC>
1804 {
1805  return m_typeInfoFunc().getSelector();
1806 }
1807 
1808 template <typename ALLOC>
1810 {
1811  return m_typeInfoFunc().getCases();
1812 }
1813 
1814 template <typename ALLOC>
1816 {
1817  return m_typeInfoFunc().getUnderlyingType();
1818 }
1819 
1820 template <typename ALLOC>
1822 {
1823  return m_typeInfoFunc().getUnderlyingTypeArguments();
1824 }
1825 
1826 template <typename ALLOC>
1828 {
1829  return m_typeInfoFunc().getEnumItems();
1830 }
1831 
1832 template <typename ALLOC>
1834 {
1835  return m_typeInfoFunc().getBitmaskValues();
1836 }
1837 
1838 template <typename ALLOC>
1840 {
1841  return m_typeInfoFunc().getColumns();
1842 }
1843 
1844 template <typename ALLOC>
1846 {
1847  return m_typeInfoFunc().getSqlConstraint();
1848 }
1849 
1850 template <typename ALLOC>
1852 {
1853  return m_typeInfoFunc().getVirtualTableUsing();
1854 }
1855 
1856 template <typename ALLOC>
1858 {
1859  return m_typeInfoFunc().isWithoutRowId();
1860 }
1861 
1862 template <typename ALLOC>
1864 {
1865  return m_typeInfoFunc().getTables();
1866 }
1867 
1868 template <typename ALLOC>
1870 {
1871  return m_typeInfoFunc().getTemplateName();
1872 }
1873 
1874 template <typename ALLOC>
1876 {
1877  return m_typeInfoFunc().getTemplateArguments();
1878 }
1879 
1880 template <typename ALLOC>
1882 {
1883  return m_typeInfoFunc().getMessages();
1884 }
1885 
1886 template <typename ALLOC>
1888 {
1889  return m_typeInfoFunc().getMethods();
1890 }
1891 
1892 template <typename ALLOC>
1894 {
1895  return m_typeInfoFunc().createInstance(allocator);
1896 }
1897 
1898 template <typename ALLOC>
1900 {
1901  return createInstance(ALLOC());
1902 }
1903 
1904 } // namespace zserio
1905 
1906 #endif // ZSERIO_TYPE_INFO_INC_H
Span< const ItemInfo > getBitmaskValues() const override
Definition: TypeInfo.h:1731
BitmaskTypeInfo(StringView schemaName, const IBasicTypeInfo< ALLOC > &underlyingType, Span< const StringView > underlyingTypeArguments, Span< const ItemInfo > bitmaskValues)
Definition: TypeInfo.h:1723
static const IBasicTypeInfo< ALLOC > & getDynamicUnsignedBitField(uint8_t maxBitSize)
Definition: TypeInfo.h:1226
static const IBasicTypeInfo< ALLOC > & getFloat32()
Definition: TypeInfo.h:1144
static const IBasicTypeInfo< ALLOC > & getVarUInt64()
Definition: TypeInfo.h:1114
static const IBasicTypeInfo< ALLOC > & getUInt32()
Definition: TypeInfo.h:1054
static const IBasicTypeInfo< ALLOC > & getBool()
Definition: TypeInfo.h:1012
static const IBasicTypeInfo< ALLOC > & getVarInt64()
Definition: TypeInfo.h:1082
static const IBasicTypeInfo< ALLOC > & getVarUInt()
Definition: TypeInfo.h:1122
static const IBasicTypeInfo< ALLOC > & getVarInt32()
Definition: TypeInfo.h:1074
static const IBasicTypeInfo< ALLOC > & getFixedUnsignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1185
static const IBasicTypeInfo< ALLOC > & getInt32()
Definition: TypeInfo.h:1030
static const IBasicTypeInfo< ALLOC > & getInt16()
Definition: TypeInfo.h:1024
static const IBasicTypeInfo< ALLOC > & getVarInt()
Definition: TypeInfo.h:1090
static const IBasicTypeInfo< ALLOC > & getString()
Definition: TypeInfo.h:1163
static const IBasicTypeInfo< ALLOC > & getInt8()
Definition: TypeInfo.h:1018
static const IBasicTypeInfo< ALLOC > & getVarInt16()
Definition: TypeInfo.h:1066
static const IBasicTypeInfo< ALLOC > & getUInt8()
Definition: TypeInfo.h:1042
static const IBasicTypeInfo< ALLOC > & getBitBuffer()
Definition: TypeInfo.h:1171
BuiltinTypeInfo(StringView schemaName, SchemaType schemaType, CppType cppType)
Definition: TypeInfo.h:1007
static const IBasicTypeInfo< ALLOC > & getUInt64()
Definition: TypeInfo.h:1060
static const IBasicTypeInfo< ALLOC > & getInt64()
Definition: TypeInfo.h:1036
static const IBasicTypeInfo< ALLOC > & getUInt16()
Definition: TypeInfo.h:1048
static const IBasicTypeInfo< ALLOC > & getVarSize()
Definition: TypeInfo.h:1130
static const IBasicTypeInfo< ALLOC > & getFloat16()
Definition: TypeInfo.h:1138
static const IBasicTypeInfo< ALLOC > & getVarUInt32()
Definition: TypeInfo.h:1106
static const IBasicTypeInfo< ALLOC > & getBytes()
Definition: TypeInfo.h:1156
static const IBasicTypeInfo< ALLOC > & getVarUInt16()
Definition: TypeInfo.h:1098
static const IBasicTypeInfo< ALLOC > & getDynamicSignedBitField(uint8_t maxBitSize)
Definition: TypeInfo.h:1191
static const IBasicTypeInfo< ALLOC > & getFixedSignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1179
static const IBasicTypeInfo< ALLOC > & getFloat64()
Definition: TypeInfo.h:1150
StringView getSelector() const override
Definition: TypeInfo.h:1626
Span< const BasicCaseInfo< ALLOC > > getCases() const override
Definition: TypeInfo.h:1632
ChoiceTypeInfo(StringView schemaName, CreateInstanceFunc createInstanceFunc, StringView templateName, Span< const BasicTemplateArgumentInfo< ALLOC >> templateArguments, Span< const BasicFieldInfo< ALLOC >> fields, Span< const BasicParameterInfo< ALLOC >> parameters, Span< const BasicFunctionInfo< ALLOC >> functions, StringView selector, Span< const BasicCaseInfo< ALLOC >> cases)
Definition: TypeInfo.h:1614
CompoundTypeInfoBase(const CompoundTypeInfoBase &)=default
Span< const BasicFunctionInfo< ALLOC > > getFunctions() const override
Definition: TypeInfo.h:1578
~CompoundTypeInfoBase() override=0
CompoundTypeInfoBase(CompoundTypeInfoBase &&)=default
IBasicReflectablePtr< ALLOC >(*)(const ALLOC &) CreateInstanceFunc
Definition: TypeInfo.h:481
CompoundTypeInfoBase & operator=(const CompoundTypeInfoBase &)=default
CompoundTypeInfoBase(StringView schemaName, CreateInstanceFunc createInstanceFunc, SchemaType schemaType, CppType cppType, StringView templateName, Span< const BasicTemplateArgumentInfo< ALLOC >> templateArguments, Span< const BasicFieldInfo< ALLOC >> fields, Span< const BasicParameterInfo< ALLOC >> parameters, Span< const BasicFunctionInfo< ALLOC >> functions)
Definition: TypeInfo.h:1550
Span< const BasicParameterInfo< ALLOC > > getParameters() const override
Definition: TypeInfo.h:1572
Span< const BasicFieldInfo< ALLOC > > getFields() const override
Definition: TypeInfo.h:1566
CompoundTypeInfoBase & operator=(CompoundTypeInfoBase &&)=default
Span< const ItemInfo > getEnumItems() const override
Definition: TypeInfo.h:1717
EnumTypeInfo(StringView schemaName, const IBasicTypeInfo< ALLOC > &underlyingType, Span< const StringView > underlyingTypeArguments, Span< const ItemInfo > enumItems)
Definition: TypeInfo.h:1709
static const IBasicTypeInfo< ALLOC > & getFloat64()
Definition: TypeInfo.h:1362
static const IBasicTypeInfo< ALLOC > & getUInt64()
Definition: TypeInfo.h:1338
static const IBasicTypeInfo< ALLOC > & getInt32()
Definition: TypeInfo.h:1298
static const IBasicTypeInfo< ALLOC > & getFloat32()
Definition: TypeInfo.h:1354
uint8_t getBitSize() const override
Definition: TypeInfo.h:1268
static const IBasicTypeInfo< ALLOC > & getUInt16()
Definition: TypeInfo.h:1322
static const IBasicTypeInfo< ALLOC > & getFixedSignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1370
static const IBasicTypeInfo< ALLOC > & getBool()
Definition: TypeInfo.h:1274
static const IBasicTypeInfo< ALLOC > & getInt64()
Definition: TypeInfo.h:1306
static const IBasicTypeInfo< ALLOC > & getFixedUnsignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1448
static const IBasicTypeInfo< ALLOC > & getUInt8()
Definition: TypeInfo.h:1314
static const IBasicTypeInfo< ALLOC > & getFloat16()
Definition: TypeInfo.h:1346
static const IBasicTypeInfo< ALLOC > & getInt8()
Definition: TypeInfo.h:1282
static const IBasicTypeInfo< ALLOC > & getUInt32()
Definition: TypeInfo.h:1330
static const IBasicTypeInfo< ALLOC > & getInt16()
Definition: TypeInfo.h:1290
FixedSizeBuiltinTypeInfo(StringView schemaName, SchemaType schemaType, CppType cppType, uint8_t bitSize)
Definition: TypeInfo.h:1261
virtual const IBasicTypeInfo< ALLOC > & getUnderlyingType() const =0
PubsubTypeInfo(StringView schemaName, Span< const BasicMessageInfo< ALLOC >> messages)
Definition: TypeInfo.h:1737
Span< const BasicMessageInfo< ALLOC > > getMessages() const override
Definition: TypeInfo.h:1743
Span< const BasicMethodInfo< ALLOC > > getMethods() const override
Definition: TypeInfo.h:1887
StringView getTemplateName() const override
Definition: TypeInfo.h:1869
Span< const BasicMessageInfo< ALLOC > > getMessages() const override
Definition: TypeInfo.h:1881
StringView getSqlConstraint() const override
Definition: TypeInfo.h:1845
Span< const BasicTableInfo< ALLOC > > getTables() const override
Definition: TypeInfo.h:1863
RecursiveTypeInfo(const RecursiveTypeInfo &)=delete
Span< const BasicFunctionInfo< ALLOC > > getFunctions() const override
Definition: TypeInfo.h:1797
RecursiveTypeInfo(const RecursiveTypeInfo &&)=delete
bool isWithoutRowId() const override
Definition: TypeInfo.h:1857
StringView getVirtualTableUsing() const override
Definition: TypeInfo.h:1851
uint8_t getBitSize() const override
Definition: TypeInfo.h:1779
IBasicReflectablePtr< ALLOC > createInstance() const override
Definition: TypeInfo.h:1899
StringView getSchemaName() const override
Definition: TypeInfo.h:1761
~RecursiveTypeInfo() override=default
Span< const ItemInfo > getEnumItems() const override
Definition: TypeInfo.h:1827
StringView getSelector() const override
Definition: TypeInfo.h:1803
Span< const BasicColumnInfo< ALLOC > > getColumns() const override
Definition: TypeInfo.h:1839
Span< const BasicCaseInfo< ALLOC > > getCases() const override
Definition: TypeInfo.h:1809
CppType getCppType() const override
Definition: TypeInfo.h:1773
RecursiveTypeInfo & operator=(const RecursiveTypeInfo &&)=delete
SchemaType getSchemaType() const override
Definition: TypeInfo.h:1767
const IBasicTypeInfo< ALLOC > & getUnderlyingType() const override
Definition: TypeInfo.h:1815
RecursiveTypeInfo & operator=(const RecursiveTypeInfo &)=delete
Span< const BasicFieldInfo< ALLOC > > getFields() const override
Definition: TypeInfo.h:1785
RecursiveTypeInfo(TypeInfoFunc typeInfoFunc)
Definition: TypeInfo.h:796
Span< const BasicTemplateArgumentInfo< ALLOC > > getTemplateArguments() const override
Definition: TypeInfo.h:1875
Span< const ItemInfo > getBitmaskValues() const override
Definition: TypeInfo.h:1833
Span< const StringView > getUnderlyingTypeArguments() const override
Definition: TypeInfo.h:1821
Span< const BasicParameterInfo< ALLOC > > getParameters() const override
Definition: TypeInfo.h:1791
Span< const BasicMethodInfo< ALLOC > > getMethods() const override
Definition: TypeInfo.h:1755
ServiceTypeInfo(StringView schemaName, Span< const BasicMethodInfo< ALLOC >> methods)
Definition: TypeInfo.h:1749
SqlDatabaseTypeInfo(StringView schemaName, Span< const BasicTableInfo< ALLOC >> tables)
Definition: TypeInfo.h:1675
Span< const BasicTableInfo< ALLOC > > getTables() const override
Definition: TypeInfo.h:1682
StringView getVirtualTableUsing() const override
Definition: TypeInfo.h:1663
bool isWithoutRowId() const override
Definition: TypeInfo.h:1669
SqlTableTypeInfo(StringView schemaName, StringView templateName, Span< const BasicTemplateArgumentInfo< ALLOC >> templateArguments, Span< const BasicColumnInfo< ALLOC >> columns, StringView sqlConstraint, StringView virtualTableUsing, bool isWithoutRowId)
Definition: TypeInfo.h:1638
Span< const BasicColumnInfo< ALLOC > > getColumns() const override
Definition: TypeInfo.h:1651
StringView getSqlConstraint() const override
Definition: TypeInfo.h:1657
StructTypeInfo(StringView schemaName, CreateInstanceFunc createInstanceFunc, StringView templateName, Span< const BasicTemplateArgumentInfo< ALLOC >> templateArguments, Span< const BasicFieldInfo< ALLOC >> fields, Span< const BasicParameterInfo< ALLOC >> parameters, Span< const BasicFunctionInfo< ALLOC >> functions)
Definition: TypeInfo.h:1596
TemplatableTypeInfoBase & operator=(TemplatableTypeInfoBase &&)=default
TemplatableTypeInfoBase(StringView schemaName, SchemaType schemaType, CppType cppType, StringView templateName, Span< const BasicTemplateArgumentInfo< ALLOC >> templateArguments)
Definition: TypeInfo.h:1526
Span< const BasicTemplateArgumentInfo< ALLOC > > getTemplateArguments() const override
Definition: TypeInfo.h:1544
TemplatableTypeInfoBase & operator=(const TemplatableTypeInfoBase &)=default
TemplatableTypeInfoBase(const TemplatableTypeInfoBase &)=default
TemplatableTypeInfoBase(TemplatableTypeInfoBase &&)=default
StringView getTemplateName() const override
Definition: TypeInfo.h:1538
CppType getCppType() const override
Definition: TypeInfo.h:875
Span< const BasicFieldInfo< ALLOC > > getFields() const override
Definition: TypeInfo.h:887
TypeInfoBase & operator=(const TypeInfoBase &&)=delete
const IBasicTypeInfo< ALLOC > & getUnderlyingType() const override
Definition: TypeInfo.h:917
Span< const BasicTableInfo< ALLOC > > getTables() const override
Definition: TypeInfo.h:965
bool isWithoutRowId() const override
Definition: TypeInfo.h:959
TypeInfoBase(const TypeInfoBase &&)=delete
Span< const BasicColumnInfo< ALLOC > > getColumns() const override
Definition: TypeInfo.h:941
StringView getSelector() const override
Definition: TypeInfo.h:905
IBasicReflectablePtr< ALLOC > createInstance(const ALLOC &allocator) const override
Definition: TypeInfo.h:995
Span< const StringView > getUnderlyingTypeArguments() const override
Definition: TypeInfo.h:923
StringView getVirtualTableUsing() const override
Definition: TypeInfo.h:953
Span< const BasicMethodInfo< ALLOC > > getMethods() const override
Definition: TypeInfo.h:989
Span< const ItemInfo > getBitmaskValues() const override
Definition: TypeInfo.h:935
StringView getSqlConstraint() const override
Definition: TypeInfo.h:947
StringView getTemplateName() const override
Definition: TypeInfo.h:971
~TypeInfoBase() override=0
Span< const BasicTemplateArgumentInfo< ALLOC > > getTemplateArguments() const override
Definition: TypeInfo.h:977
Span< const ItemInfo > getEnumItems() const override
Definition: TypeInfo.h:929
Span< const BasicMessageInfo< ALLOC > > getMessages() const override
Definition: TypeInfo.h:983
Span< const BasicCaseInfo< ALLOC > > getCases() const override
Definition: TypeInfo.h:911
SchemaType getSchemaType() const override
Definition: TypeInfo.h:869
TypeInfoBase(StringView schemaName, SchemaType schemaType, CppType cppType)
Definition: TypeInfo.h:853
uint8_t getBitSize() const override
Definition: TypeInfo.h:881
Span< const BasicParameterInfo< ALLOC > > getParameters() const override
Definition: TypeInfo.h:893
TypeInfoBase(const TypeInfoBase &)=delete
Span< const BasicFunctionInfo< ALLOC > > getFunctions() const override
Definition: TypeInfo.h:899
StringView getSchemaName() const override
Definition: TypeInfo.h:863
IBasicReflectablePtr< ALLOC > createInstance() const override
Definition: TypeInfo.h:1001
TypeInfoBase & operator=(const TypeInfoBase &)=delete
Span< const StringView > getUnderlyingTypeArguments() const override
Definition: TypeInfo.h:1703
TypeInfoWithUnderlyingTypeBase(StringView schemaName, SchemaType schemaType, CppType cppType, const IBasicTypeInfo< ALLOC > &underlyingType, Span< const StringView > underlyingTypeArguments)
Definition: TypeInfo.h:1688
const IBasicTypeInfo< ALLOC > & getUnderlyingType() const override
Definition: TypeInfo.h:1697
UnionTypeInfo(StringView schemaName, CreateInstanceFunc createInstanceFunc, StringView templateName, Span< const BasicTemplateArgumentInfo< ALLOC >> templateArguments, Span< const BasicFieldInfo< ALLOC >> fields, Span< const BasicParameterInfo< ALLOC >> parameters, Span< const BasicFunctionInfo< ALLOC >> functions)
Definition: TypeInfo.h:1605
SchemaType
Definition: ITypeInfo.h:42
constexpr BasicStringView< CharT > makeStringView(const CharT(&str)[N])
Definition: StringView.h:929
typename IBasicReflectable< ALLOC >::Ptr IBasicReflectablePtr
Definition: IReflectable.h:532