Zserio C++ runtime library  1.0.0
Built for Zserio 2.13.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 
13 namespace zserio
14 {
15 
22 template <typename ALLOC>
23 class TypeInfoBase : public IBasicTypeInfo<ALLOC>
24 {
25 public:
33  TypeInfoBase(StringView schemaName, SchemaType schemaType, CppType cppType);
34 
39  TypeInfoBase(const TypeInfoBase&) = delete;
40  TypeInfoBase& operator=(const TypeInfoBase&) = delete;
41 
42  TypeInfoBase(const TypeInfoBase&&) = delete;
43  TypeInfoBase& operator=(const TypeInfoBase&&) = delete;
48  ~TypeInfoBase() override = 0;
49 
50  StringView getSchemaName() const override;
51  SchemaType getSchemaType() const override;
52  CppType getCppType() const override;
53  uint8_t getBitSize() const override;
54 
58 
59  StringView getSelector() const override;
60  Span<const BasicCaseInfo<ALLOC>> getCases() const override;
61 
62  const IBasicTypeInfo<ALLOC>& getUnderlyingType() const override;
64  Span<const ItemInfo> getEnumItems() const override;
65  Span<const ItemInfo> getBitmaskValues() const override;
66 
68  StringView getSqlConstraint() const override;
69  StringView getVirtualTableUsing() const override;
70  bool isWithoutRowId() const override;
71 
73 
74  StringView getTemplateName() const override;
76 
79 
80  IBasicReflectablePtr<ALLOC> createInstance(const ALLOC& allocator) const override;
82 
83 private:
84  StringView m_schemaName;
85  SchemaType m_schemaType;
86  CppType m_cppType;
87 };
88 
92 template <typename ALLOC = std::allocator<uint8_t>>
93 class BuiltinTypeInfo : public TypeInfoBase<ALLOC>
94 {
95 protected:
103  BuiltinTypeInfo(StringView schemaName, SchemaType schemaType, CppType cppType);
104 
105 public:
111  static const IBasicTypeInfo<ALLOC>& getBool();
112 
118  static const IBasicTypeInfo<ALLOC>& getInt8();
119 
125  static const IBasicTypeInfo<ALLOC>& getInt16();
126 
132  static const IBasicTypeInfo<ALLOC>& getInt32();
133 
139  static const IBasicTypeInfo<ALLOC>& getInt64();
140 
146  static const IBasicTypeInfo<ALLOC>& getUInt8();
147 
153  static const IBasicTypeInfo<ALLOC>& getUInt16();
154 
160  static const IBasicTypeInfo<ALLOC>& getUInt32();
161 
167  static const IBasicTypeInfo<ALLOC>& getUInt64();
168 
174  static const IBasicTypeInfo<ALLOC>& getVarInt16();
175 
181  static const IBasicTypeInfo<ALLOC>& getVarInt32();
182 
188  static const IBasicTypeInfo<ALLOC>& getVarInt64();
189 
195  static const IBasicTypeInfo<ALLOC>& getVarInt();
196 
202  static const IBasicTypeInfo<ALLOC>& getVarUInt16();
203 
209  static const IBasicTypeInfo<ALLOC>& getVarUInt32();
210 
216  static const IBasicTypeInfo<ALLOC>& getVarUInt64();
217 
223  static const IBasicTypeInfo<ALLOC>& getVarUInt();
224 
230  static const IBasicTypeInfo<ALLOC>& getVarSize();
231 
237  static const IBasicTypeInfo<ALLOC>& getFloat16();
238 
244  static const IBasicTypeInfo<ALLOC>& getFloat32();
245 
251  static const IBasicTypeInfo<ALLOC>& getFloat64();
252 
258  static const IBasicTypeInfo<ALLOC>& getBytes();
259 
265  static const IBasicTypeInfo<ALLOC>& getString();
266 
272  static const IBasicTypeInfo<ALLOC>& getBitBuffer();
273 
281  static const IBasicTypeInfo<ALLOC>& getFixedSignedBitField(uint8_t bitSize);
282 
290  static const IBasicTypeInfo<ALLOC>& getFixedUnsignedBitField(uint8_t bitSize);
291 
299  static const IBasicTypeInfo<ALLOC>& getDynamicSignedBitField(uint8_t maxBitSize);
300 
308  static const IBasicTypeInfo<ALLOC>& getDynamicUnsignedBitField(uint8_t maxBitSize);
309 };
310 
314 template <typename ALLOC>
316 {
317 protected:
326  FixedSizeBuiltinTypeInfo(StringView schemaName, SchemaType schemaType, CppType cppType,
327  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,
496  SchemaType schemaType, CppType cppType,
497  StringView templateName, 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 
503  CompoundTypeInfoBase(const CompoundTypeInfoBase&) = default;
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,
542  StringView templateName, 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,
567  StringView templateName, 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,
594  StringView templateName, 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,
701  StringView templateName, 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 
806  RecursiveTypeInfo(const RecursiveTypeInfo&) = delete;
808 
809  RecursiveTypeInfo(const RecursiveTypeInfo&&) = delete;
810  RecursiveTypeInfo& operator=(const RecursiveTypeInfo&&) = delete;
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), m_schemaType(schemaType), m_cppType(cppType)
855 {}
856 
857 template <typename ALLOC>
859 
860 template <typename ALLOC>
862 {
863  return m_schemaName;
864 }
865 
866 template <typename ALLOC>
868 {
869  return m_schemaType;
870 }
871 
872 template <typename ALLOC>
874 {
875  return m_cppType;
876 }
877 
878 template <typename ALLOC>
880 {
881  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a fixed size type!";
882 }
883 
884 template <typename ALLOC>
886 {
887  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a compound type!";
888 }
889 
890 template <typename ALLOC>
892 {
893  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a compound type!";
894 }
895 
896 template <typename ALLOC>
898 {
899  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a compound type!";
900 }
901 
902 template <typename ALLOC>
904 {
905  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a choice type!";
906 }
907 
908 template <typename ALLOC>
910 {
911  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a choice type!";
912 }
913 
914 template <typename ALLOC>
916 {
917  throw CppRuntimeException("Type '") << getSchemaName() << "' does not have underlying type!";
918 }
919 
920 template <typename ALLOC>
922 {
923  throw CppRuntimeException("Type '") << getSchemaName() << "' does not have underlying type!";
924 }
925 
926 template <typename ALLOC>
928 {
929  throw CppRuntimeException("Type '") << getSchemaName() << "' is not an enum type!";
930 }
931 
932 template <typename ALLOC>
934 {
935  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a bitmask type!";
936 }
937 
938 template <typename ALLOC>
940 {
941  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL table type!";
942 }
943 
944 template <typename ALLOC>
946 {
947  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL table type!";
948 }
949 
950 template <typename ALLOC>
952 {
953  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL table type!";
954 }
955 
956 template <typename ALLOC>
958 {
959  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL table type!";
960 }
961 
962 template <typename ALLOC>
964 {
965  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a SQL database type!";
966 }
967 
968 template <typename ALLOC>
970 {
971  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a templatable type!";
972 }
973 
974 template <typename ALLOC>
976 {
977  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a templatable type!";
978 }
979 
980 template <typename ALLOC>
982 {
983  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a pubsub type!";
984 }
985 
986 template <typename ALLOC>
988 {
989  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a service type!";
990 }
991 
992 template <typename ALLOC>
994 {
995  throw CppRuntimeException("Type '") << getSchemaName() << "' is not a compound type!";
996 }
997 
998 template <typename ALLOC>
1000 {
1001  return createInstance(ALLOC());
1002 }
1003 
1004 template <typename ALLOC>
1006  TypeInfoBase<ALLOC>(schemaName, schemaType, cppType)
1007 {}
1008 
1009 template <typename ALLOC>
1011 {
1013 }
1014 
1015 template <typename ALLOC>
1017 {
1019 }
1020 
1021 template <typename ALLOC>
1023 {
1025 }
1026 
1027 template <typename ALLOC>
1029 {
1031 }
1032 
1033 template <typename ALLOC>
1035 {
1037 }
1038 
1039 template <typename ALLOC>
1041 {
1043 }
1044 
1045 template <typename ALLOC>
1047 {
1049 }
1050 
1051 template <typename ALLOC>
1053 {
1055 }
1056 
1057 template <typename ALLOC>
1059 {
1061 }
1062 
1063 template <typename ALLOC>
1065 {
1066  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1068  };
1069  return typeInfo;
1070 }
1071 
1072 template <typename ALLOC>
1074 {
1075  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1077  };
1078  return typeInfo;
1079 }
1080 
1081 template <typename ALLOC>
1083 {
1084  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1086  };
1087  return typeInfo;
1088 }
1089 
1090 template <typename ALLOC>
1092 {
1093  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1095  };
1096  return typeInfo;
1097 }
1098 
1099 template <typename ALLOC>
1101 {
1102  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1104  };
1105  return typeInfo;
1106 }
1107 
1108 template <typename ALLOC>
1110 {
1111  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1113  };
1114  return typeInfo;
1115 }
1116 
1117 template <typename ALLOC>
1119 {
1120  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1122  };
1123  return typeInfo;
1124 }
1125 
1126 template <typename ALLOC>
1128 {
1129  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1131  };
1132  return typeInfo;
1133 }
1134 
1135 template <typename ALLOC>
1137 {
1138  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1140  };
1141  return typeInfo;
1142 }
1143 
1144 template <typename ALLOC>
1146 {
1148 }
1149 
1150 template <typename ALLOC>
1152 {
1154 }
1155 
1156 template <typename ALLOC>
1158 {
1160 }
1161 
1162 template <typename ALLOC>
1164 {
1165  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1167  };
1168  return typeInfo;
1169 }
1170 
1171 template <typename ALLOC>
1173 {
1174  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1176  };
1177  return typeInfo;
1178 }
1179 
1180 template <typename ALLOC>
1182 {
1183  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1185  };
1186  return typeInfo;
1187 }
1188 
1189 template <typename ALLOC>
1191 {
1193 }
1194 
1195 template <typename ALLOC>
1197 {
1199 }
1200 
1201 template <typename ALLOC>
1203 {
1204  if (maxBitSize == 0 || maxBitSize > 64)
1205  {
1206  throw CppRuntimeException("BuiltinTypeInfo::getDynamicSignedBitField: Invalid max bit size '") <<
1207  maxBitSize << "'!";
1208  }
1209 
1210  if (maxBitSize <= 8)
1211  {
1212  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1214  };
1215  return typeInfo;
1216  }
1217  else if (maxBitSize <= 16)
1218  {
1219  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1221  };
1222  return typeInfo;
1223  }
1224  else if (maxBitSize <= 32)
1225  {
1226  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1228  };
1229  return typeInfo;
1230  }
1231  else
1232  {
1233  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1235  };
1236  return typeInfo;
1237  }
1238 }
1239 
1240 template <typename ALLOC>
1242 {
1243  if (maxBitSize == 0 || maxBitSize > 64)
1244  {
1245  throw CppRuntimeException("BuiltinTypeInfo::getDynamicUnsignedBitField: Invalid max bit size '") <<
1246  maxBitSize << "'!";
1247  }
1248 
1249  if (maxBitSize <= 8)
1250  {
1251  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1253  };
1254  return typeInfo;
1255  }
1256  else if (maxBitSize <= 16)
1257  {
1258  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1260  };
1261  return typeInfo;
1262  }
1263  else if (maxBitSize <= 32)
1264  {
1265  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1267  };
1268  return typeInfo;
1269  }
1270  else
1271  {
1272  static const BuiltinTypeInfo<ALLOC> typeInfo = {
1274  };
1275  return typeInfo;
1276  }
1277 }
1278 
1279 template <typename ALLOC>
1281  CppType cppType, uint8_t bitSize) :
1282  BuiltinTypeInfo<ALLOC>(schemaName, schemaType, cppType), m_bitSize(bitSize)
1283 {}
1284 
1285 template <typename ALLOC>
1287 {
1288  return m_bitSize;
1289 }
1290 
1291 template <typename ALLOC>
1293 {
1294  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1296  };
1297  return typeInfo;
1298 }
1299 
1300 template <typename ALLOC>
1302 {
1303  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1305  };
1306  return typeInfo;
1307 }
1308 
1309 template <typename ALLOC>
1311 {
1312  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1314  };
1315  return typeInfo;
1316 }
1317 
1318 template <typename ALLOC>
1320 {
1321  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1323  };
1324  return typeInfo;
1325 }
1326 
1327 template <typename ALLOC>
1329 {
1330  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1332  };
1333  return typeInfo;
1334 }
1335 
1336 template <typename ALLOC>
1338 {
1339  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1341  };
1342  return typeInfo;
1343 }
1344 
1345 template <typename ALLOC>
1347 {
1348  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1350  };
1351  return typeInfo;
1352 }
1353 
1354 template <typename ALLOC>
1356 {
1357  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1359  };
1360  return typeInfo;
1361 }
1362 
1363 template <typename ALLOC>
1365 {
1366  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1368  };
1369  return typeInfo;
1370 }
1371 
1372 template <typename ALLOC>
1374 {
1375  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1377  };
1378  return typeInfo;
1379 }
1380 
1381 template <typename ALLOC>
1383 {
1384  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1386  };
1387  return typeInfo;
1388 }
1389 
1390 template <typename ALLOC>
1392 {
1393  static const FixedSizeBuiltinTypeInfo<ALLOC> typeInfo = {
1395  };
1396  return typeInfo;
1397 }
1398 
1399 template <typename ALLOC>
1401 {
1402  if (bitSize == 0 || bitSize > 64)
1403  {
1404  throw CppRuntimeException("FixedSizeBuiltinTypeInfo::getFixedSignedBitField: Invalid bit size '") <<
1405  bitSize << "'!";
1406  }
1407 
1408  static const std::array<FixedSizeBuiltinTypeInfo<ALLOC>, 64> bitFieldTypeInfoArray = {{
1418  { "int:10"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT16, 10 },
1419  { "int:11"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT16, 11 },
1420  { "int:12"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT16, 12 },
1421  { "int:13"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT16, 13 },
1422  { "int:14"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT16, 14 },
1423  { "int:15"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT16, 15 },
1424  { "int:16"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT16, 16 },
1425  { "int:17"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 17 },
1426  { "int:18"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 18 },
1427  { "int:19"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 19 },
1428  { "int:20"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 20 },
1429  { "int:21"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 21 },
1430  { "int:22"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 22 },
1431  { "int:23"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 23 },
1432  { "int:24"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 24 },
1433  { "int:25"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 25 },
1434  { "int:26"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 26 },
1435  { "int:27"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 27 },
1436  { "int:28"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 28 },
1437  { "int:29"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 29 },
1438  { "int:30"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 30 },
1439  { "int:31"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 31 },
1440  { "int:32"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT32, 32 },
1441  { "int:33"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 33 },
1442  { "int:34"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 34 },
1443  { "int:35"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 35 },
1444  { "int:36"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 36 },
1445  { "int:37"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 37 },
1446  { "int:38"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 38 },
1447  { "int:39"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 39 },
1448  { "int:40"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 40 },
1449  { "int:41"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 41 },
1450  { "int:42"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 42 },
1451  { "int:43"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 43 },
1452  { "int:44"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 44 },
1453  { "int:45"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 45 },
1454  { "int:46"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 46 },
1455  { "int:47"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 47 },
1456  { "int:48"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 48 },
1457  { "int:49"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 49 },
1458  { "int:50"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 50 },
1459  { "int:51"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 51 },
1460  { "int:52"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 52 },
1461  { "int:53"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 53 },
1462  { "int:54"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 54 },
1463  { "int:55"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 55 },
1464  { "int:56"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 56 },
1465  { "int:57"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 57 },
1466  { "int:58"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 58 },
1467  { "int:59"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 59 },
1468  { "int:60"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 60 },
1469  { "int:61"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 61 },
1470  { "int:62"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 62 },
1471  { "int:63"_sv, SchemaType::FIXED_SIGNED_BITFIELD, CppType::INT64, 63 },
1473  }};
1474 
1475  return bitFieldTypeInfoArray[bitSize - 1];
1476 }
1477 
1478 template <typename ALLOC>
1480 {
1481  if (bitSize == 0 || bitSize > 64)
1482  {
1483  throw CppRuntimeException("FixedSizeBuiltinTypeInfo::getFixedUnsignedBitField: Invalid bit size '") <<
1484  bitSize << "'!";
1485  }
1486 
1487  static const std::array<FixedSizeBuiltinTypeInfo<ALLOC>, 64> bitFieldTypeInfoArray = {{
1552  }};
1553 
1554  return bitFieldTypeInfoArray[bitSize - 1];
1555 }
1556 
1557 template <typename ALLOC>
1559  SchemaType schemaType, CppType cppType,
1560  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments) :
1561  TypeInfoBase<ALLOC>(schemaName, schemaType, cppType),
1562  m_templateName(templateName), m_templateArguments(templateArguments)
1563 {}
1564 
1565 template <typename ALLOC>
1567 
1568 template <typename ALLOC>
1570 {
1571  return m_templateName;
1572 }
1573 
1574 template <typename ALLOC>
1576 {
1577  return m_templateArguments;
1578 }
1579 
1580 template <typename ALLOC>
1582  SchemaType schemaType, CppType cppType,
1583  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1584  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
1585  Span<const BasicFunctionInfo<ALLOC>> functions) :
1586  TemplatableTypeInfoBase<ALLOC>(schemaName, schemaType, cppType, templateName, templateArguments),
1587  m_createInstanceFunc(createInstanceFunc),
1588  m_fields(fields), m_parameters(parameters), m_functions(functions)
1589 {}
1590 
1591 template <typename ALLOC>
1593 
1594 template <typename ALLOC>
1596 {
1597  return m_fields;
1598 }
1599 
1600 template <typename ALLOC>
1602 {
1603  return m_parameters;
1604 }
1605 
1606 template <typename ALLOC>
1608 {
1609  return m_functions;
1610 }
1611 
1612 template <typename ALLOC>
1614 {
1615  if (!m_createInstanceFunc)
1616  {
1617  throw CppRuntimeException("Reflectable '") << getSchemaName() << "': Cannot create instance, " <<
1618  "either '-withoutWriterCode' or '-withoutReflectionCode' zserio option is used!";
1619  }
1620  return m_createInstanceFunc(allocator);
1621 }
1622 
1623 template <typename ALLOC>
1625  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1626  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
1627  Span<const BasicFunctionInfo<ALLOC>> functions) :
1628  CompoundTypeInfoBase<ALLOC>(schemaName, createInstanceFunc, SchemaType::STRUCT, CppType::STRUCT,
1629  templateName, templateArguments, fields, parameters, functions)
1630 {}
1631 
1632 template <typename ALLOC>
1634  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1635  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
1636  Span<const BasicFunctionInfo<ALLOC>> functions) :
1637  CompoundTypeInfoBase<ALLOC>(schemaName, createInstanceFunc, SchemaType::UNION, CppType::UNION,
1638  templateName, templateArguments, fields, parameters, functions)
1639 {}
1640 
1641 template <typename ALLOC>
1643  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1644  Span<const BasicFieldInfo<ALLOC>> fields, Span<const BasicParameterInfo<ALLOC>> parameters,
1645  Span<const BasicFunctionInfo<ALLOC>> functions,
1646  StringView selector, Span<const BasicCaseInfo<ALLOC>> cases) :
1647  CompoundTypeInfoBase<ALLOC>(schemaName, createInstanceFunc, SchemaType::CHOICE, CppType::CHOICE,
1648  templateName, templateArguments, fields, parameters, functions),
1649  m_selector(selector), m_cases(cases)
1650 {}
1651 
1652 template <typename ALLOC>
1654 {
1655  return m_selector;
1656 }
1657 
1658 template <typename ALLOC>
1660 {
1661  return m_cases;
1662 }
1663 
1664 template <typename ALLOC>
1666  StringView templateName, Span<const BasicTemplateArgumentInfo<ALLOC>> templateArguments,
1667  Span<const BasicColumnInfo<ALLOC>> columns, StringView sqlConstraint, StringView virtualTableUsing,
1668  bool isWithoutRowId) :
1670  templateName, templateArguments),
1671  m_columns(columns), m_sqlConstraint(sqlConstraint), m_virtualTableUsing(virtualTableUsing),
1672  m_isWithoutRowId(isWithoutRowId)
1673 {}
1674 
1675 template <typename ALLOC>
1677 {
1678  return m_columns;
1679 }
1680 
1681 template <typename ALLOC>
1683 {
1684  return m_sqlConstraint;
1685 }
1686 
1687 template <typename ALLOC>
1689 {
1690  return m_virtualTableUsing;
1691 }
1692 
1693 template <typename ALLOC>
1695 {
1696  return m_isWithoutRowId;
1697 }
1698 
1699 template <typename ALLOC>
1701  Span<const BasicTableInfo<ALLOC>> tables) :
1702  TypeInfoBase<ALLOC>(schemaName, SchemaType::SQL_DATABASE, CppType::SQL_DATABASE),
1703  m_tables(tables)
1704 {}
1705 
1706 template <typename ALLOC>
1708 {
1709  return m_tables;
1710 }
1711 
1712 template <typename ALLOC>
1714  StringView schemaName, SchemaType schemaType, CppType cppType,
1715  const IBasicTypeInfo<ALLOC>& underlyingType, Span<const StringView> underlyingTypeArguments) :
1716  TypeInfoBase<ALLOC>(schemaName, schemaType, cppType),
1717  m_underlyingType(underlyingType), m_underlyingTypeArguments(underlyingTypeArguments)
1718 {}
1719 
1720 template <typename ALLOC>
1722 {
1723  return m_underlyingType;
1724 }
1725 
1726 template <typename ALLOC>
1728 {
1729  return m_underlyingTypeArguments;
1730 }
1731 
1732 template <typename ALLOC>
1734  Span<const StringView> underlyingTypeArguments, Span<const ItemInfo> enumItems) :
1736  underlyingType, underlyingTypeArguments),
1737  m_enumItems(enumItems)
1738 {}
1739 
1740 template <typename ALLOC>
1742 {
1743  return m_enumItems;
1744 }
1745 
1746 template <typename ALLOC>
1748  Span<const StringView> underlyingTypeArguments, Span<const ItemInfo> bitmaskValues) :
1750  underlyingType, underlyingTypeArguments),
1751  m_bitmaskValues(bitmaskValues)
1752 {}
1753 
1754 template <typename ALLOC>
1756 {
1757  return m_bitmaskValues;
1758 }
1759 
1760 template <typename ALLOC>
1762  TypeInfoBase<ALLOC>(schemaName, SchemaType::PUBSUB, CppType::PUBSUB), m_messages(messages)
1763 {}
1764 
1765 template <typename ALLOC>
1767 {
1768  return m_messages;
1769 }
1770 
1771 template <typename ALLOC>
1773  TypeInfoBase<ALLOC>(schemaName, SchemaType::SERVICE, CppType::SERVICE), m_methods(methods)
1774 {}
1775 
1776 template <typename ALLOC>
1778 {
1779  return m_methods;
1780 }
1781 
1782 template <typename ALLOC>
1784 {
1785  return m_typeInfoFunc().getSchemaName();
1786 }
1787 
1788 template <typename ALLOC>
1790 {
1791  return m_typeInfoFunc().getSchemaType();
1792 }
1793 
1794 template <typename ALLOC>
1796 {
1797  return m_typeInfoFunc().getCppType();
1798 }
1799 
1800 template <typename ALLOC>
1802 {
1803  return m_typeInfoFunc().getBitSize();
1804 }
1805 
1806 template <typename ALLOC>
1808 {
1809  return m_typeInfoFunc().getFields();
1810 }
1811 
1812 template <typename ALLOC>
1814 {
1815  return m_typeInfoFunc().getParameters();
1816 }
1817 
1818 template <typename ALLOC>
1820 {
1821  return m_typeInfoFunc().getFunctions();
1822 }
1823 
1824 template <typename ALLOC>
1826 {
1827  return m_typeInfoFunc().getSelector();
1828 }
1829 
1830 template <typename ALLOC>
1832 {
1833  return m_typeInfoFunc().getCases();
1834 }
1835 
1836 template <typename ALLOC>
1838 {
1839  return m_typeInfoFunc().getUnderlyingType();
1840 }
1841 
1842 template <typename ALLOC>
1844 {
1845  return m_typeInfoFunc().getUnderlyingTypeArguments();
1846 }
1847 
1848 template <typename ALLOC>
1850 {
1851  return m_typeInfoFunc().getEnumItems();
1852 }
1853 
1854 template <typename ALLOC>
1856 {
1857  return m_typeInfoFunc().getBitmaskValues();
1858 }
1859 
1860 template <typename ALLOC>
1862 {
1863  return m_typeInfoFunc().getColumns();
1864 }
1865 
1866 template <typename ALLOC>
1868 {
1869  return m_typeInfoFunc().getSqlConstraint();
1870 }
1871 
1872 template <typename ALLOC>
1874 {
1875  return m_typeInfoFunc().getVirtualTableUsing();
1876 }
1877 
1878 template <typename ALLOC>
1880 {
1881  return m_typeInfoFunc().isWithoutRowId();
1882 }
1883 
1884 template <typename ALLOC>
1886 {
1887  return m_typeInfoFunc().getTables();
1888 }
1889 
1890 template <typename ALLOC>
1892 {
1893  return m_typeInfoFunc().getTemplateName();
1894 }
1895 
1896 template <typename ALLOC>
1898 {
1899  return m_typeInfoFunc().getTemplateArguments();
1900 }
1901 
1902 template <typename ALLOC>
1904 {
1905  return m_typeInfoFunc().getMessages();
1906 }
1907 
1908 template <typename ALLOC>
1910 {
1911  return m_typeInfoFunc().getMethods();
1912 }
1913 
1914 template <typename ALLOC>
1916 {
1917  return m_typeInfoFunc().createInstance(allocator);
1918 }
1919 
1920 template <typename ALLOC>
1922 {
1923  return createInstance(ALLOC());
1924 }
1925 
1926 } // namespace zserio
1927 
1928 #endif // ZSERIO_TYPE_INFO_INC_H
PubsubTypeInfo(StringView schemaName, Span< const BasicMessageInfo< ALLOC >> messages)
Definition: TypeInfo.h:1761
constexpr BasicStringView< CharT > makeStringView(const CharT(&str)[N])
Definition: StringView.h:894
static const IBasicTypeInfo< ALLOC > & getBool()
Definition: TypeInfo.h:1010
static const IBasicTypeInfo< ALLOC > & getVarInt16()
Definition: TypeInfo.h:1064
Span< const BasicFieldInfo< ALLOC > > getFields() const override
Definition: TypeInfo.h:1595
const IBasicTypeInfo< ALLOC > & getUnderlyingType() const override
Definition: TypeInfo.h:1837
StringView getTemplateName() const override
Definition: TypeInfo.h:1569
static const IBasicTypeInfo< ALLOC > & getInt32()
Definition: TypeInfo.h:1028
Span< const BasicColumnInfo< ALLOC > > getColumns() const override
Definition: TypeInfo.h:1676
StringView getSelector() const override
Definition: TypeInfo.h:1653
typename IBasicReflectable< ALLOC >::Ptr IBasicReflectablePtr
Definition: IReflectable.h:516
StringView getVirtualTableUsing() const override
Definition: TypeInfo.h:1688
Span< const BasicMethodInfo< ALLOC > > getMethods() const override
Definition: TypeInfo.h:1909
TypeInfoBase & operator=(const TypeInfoBase &)=delete
Span< const BasicMessageInfo< ALLOC > > getMessages() const override
Definition: TypeInfo.h:1903
StringView getSqlConstraint() const override
Definition: TypeInfo.h:945
static const IBasicTypeInfo< ALLOC > & getFixedUnsignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1479
Span< const ItemInfo > getEnumItems() const override
Definition: TypeInfo.h:927
EnumTypeInfo(StringView schemaName, const IBasicTypeInfo< ALLOC > &underlyingType, Span< const StringView > underlyingTypeArguments, Span< const ItemInfo > enumItems)
Definition: TypeInfo.h:1733
SchemaType
Definition: ITypeInfo.h:40
Span< const ItemInfo > getEnumItems() const override
Definition: TypeInfo.h:1741
StringView getSchemaName() const override
Definition: TypeInfo.h:861
static const IBasicTypeInfo< ALLOC > & getVarUInt16()
Definition: TypeInfo.h:1100
static const IBasicTypeInfo< ALLOC > & getInt32()
Definition: TypeInfo.h:1319
StringView getVirtualTableUsing() const override
Definition: TypeInfo.h:951
bool isWithoutRowId() const override
Definition: TypeInfo.h:957
Span< const BasicColumnInfo< ALLOC > > getColumns() const override
Definition: TypeInfo.h:1861
Span< const BasicFunctionInfo< ALLOC > > getFunctions() const override
Definition: TypeInfo.h:1607
Span< const BasicTableInfo< ALLOC > > getTables() const override
Definition: TypeInfo.h:1885
const IBasicTypeInfo< ALLOC > & getUnderlyingType() const override
Definition: TypeInfo.h:1721
static const IBasicTypeInfo< ALLOC > & getUInt64()
Definition: TypeInfo.h:1058
Span< const StringView > getUnderlyingTypeArguments() const override
Definition: TypeInfo.h:1727
~TypeInfoBase() override=0
Span< const StringView > getUnderlyingTypeArguments() const override
Definition: TypeInfo.h:921
static const IBasicTypeInfo< ALLOC > & getFloat64()
Definition: TypeInfo.h:1391
static const IBasicTypeInfo< ALLOC > & getFloat16()
Definition: TypeInfo.h:1145
StringView getVirtualTableUsing() const override
Definition: TypeInfo.h:1873
static const IBasicTypeInfo< ALLOC > & getInt16()
Definition: TypeInfo.h:1310
Span< const BasicParameterInfo< ALLOC > > getParameters() const override
Definition: TypeInfo.h:891
static const IBasicTypeInfo< ALLOC > & getUInt8()
Definition: TypeInfo.h:1337
CppType getCppType() const override
Definition: TypeInfo.h:1795
Span< const BasicParameterInfo< ALLOC > > getParameters() const override
Definition: TypeInfo.h:1813
FixedSizeBuiltinTypeInfo(StringView schemaName, SchemaType schemaType, CppType cppType, uint8_t bitSize)
Definition: TypeInfo.h:1280
static const IBasicTypeInfo< ALLOC > & getBytes()
Definition: TypeInfo.h:1163
Span< const BasicColumnInfo< ALLOC > > getColumns() const override
Definition: TypeInfo.h:939
SqlTableTypeInfo(StringView schemaName, StringView templateName, Span< const BasicTemplateArgumentInfo< ALLOC >> templateArguments, Span< const BasicColumnInfo< ALLOC >> columns, StringView sqlConstraint, StringView virtualTableUsing, bool isWithoutRowId)
Definition: TypeInfo.h:1665
static const IBasicTypeInfo< ALLOC > & getUInt64()
Definition: TypeInfo.h:1364
Span< const ItemInfo > getBitmaskValues() const override
Definition: TypeInfo.h:1755
static const IBasicTypeInfo< ALLOC > & getUInt32()
Definition: TypeInfo.h:1355
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:1642
Span< const BasicTemplateArgumentInfo< ALLOC > > getTemplateArguments() const override
Definition: TypeInfo.h:1897
uint8_t getBitSize() const override
Definition: TypeInfo.h:1286
static const IBasicTypeInfo< ALLOC > & getFixedUnsignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1196
StringView getSqlConstraint() const override
Definition: TypeInfo.h:1682
StringView getSelector() const override
Definition: TypeInfo.h:1825
static const IBasicTypeInfo< ALLOC > & getDynamicSignedBitField(uint8_t maxBitSize)
Definition: TypeInfo.h:1202
static const IBasicTypeInfo< ALLOC > & getFloat64()
Definition: TypeInfo.h:1157
uint8_t getBitSize() const override
Definition: TypeInfo.h:879
static const IBasicTypeInfo< ALLOC > & getFloat32()
Definition: TypeInfo.h:1382
StringView getTemplateName() const override
Definition: TypeInfo.h:969
Span< const BasicTemplateArgumentInfo< ALLOC > > getTemplateArguments() const override
Definition: TypeInfo.h:1575
BitmaskTypeInfo(StringView schemaName, const IBasicTypeInfo< ALLOC > &underlyingType, Span< const StringView > underlyingTypeArguments, Span< const ItemInfo > bitmaskValues)
Definition: TypeInfo.h:1747
TemplatableTypeInfoBase(StringView schemaName, SchemaType schemaType, CppType cppType, StringView templateName, Span< const BasicTemplateArgumentInfo< ALLOC >> templateArguments)
Definition: TypeInfo.h:1558
Span< const BasicParameterInfo< ALLOC > > getParameters() const override
Definition: TypeInfo.h:1601
CppType getCppType() const override
Definition: TypeInfo.h:873
TypeInfoWithUnderlyingTypeBase(StringView schemaName, SchemaType schemaType, CppType cppType, const IBasicTypeInfo< ALLOC > &underlyingType, Span< const StringView > underlyingTypeArguments)
Definition: TypeInfo.h:1713
static const IBasicTypeInfo< ALLOC > & getInt16()
Definition: TypeInfo.h:1022
Span< const BasicFunctionInfo< ALLOC > > getFunctions() const override
Definition: TypeInfo.h:1819
Span< const StringView > getUnderlyingTypeArguments() const override
Definition: TypeInfo.h:1843
static const IBasicTypeInfo< ALLOC > & getInt64()
Definition: TypeInfo.h:1034
static const IBasicTypeInfo< ALLOC > & getVarUInt()
Definition: TypeInfo.h:1127
static const IBasicTypeInfo< ALLOC > & getFixedSignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1400
RecursiveTypeInfo(TypeInfoFunc typeInfoFunc)
Definition: TypeInfo.h:796
Span< const BasicTemplateArgumentInfo< ALLOC > > getTemplateArguments() const override
Definition: TypeInfo.h:975
static const IBasicTypeInfo< ALLOC > & getVarInt64()
Definition: TypeInfo.h:1082
static const IBasicTypeInfo< ALLOC > & getFloat32()
Definition: TypeInfo.h:1151
bool isWithoutRowId() const override
Definition: TypeInfo.h:1879
StringView getSchemaName() const override
Definition: TypeInfo.h:1783
Span< const BasicMethodInfo< ALLOC > > getMethods() const override
Definition: TypeInfo.h:987
Span< const BasicFieldInfo< ALLOC > > getFields() const override
Definition: TypeInfo.h:885
static const IBasicTypeInfo< ALLOC > & getVarInt()
Definition: TypeInfo.h:1091
static const IBasicTypeInfo< ALLOC > & getDynamicUnsignedBitField(uint8_t maxBitSize)
Definition: TypeInfo.h:1241
Span< const ItemInfo > getBitmaskValues() const override
Definition: TypeInfo.h:1855
Span< const BasicCaseInfo< ALLOC > > getCases() const override
Definition: TypeInfo.h:909
StringView getTemplateName() const override
Definition: TypeInfo.h:1891
SqlDatabaseTypeInfo(StringView schemaName, Span< const BasicTableInfo< ALLOC >> tables)
Definition: TypeInfo.h:1700
Span< const BasicTableInfo< ALLOC > > getTables() const override
Definition: TypeInfo.h:1707
Span< const BasicTableInfo< ALLOC > > getTables() const override
Definition: TypeInfo.h:963
Span< const BasicCaseInfo< ALLOC > > getCases() const override
Definition: TypeInfo.h:1831
static const IBasicTypeInfo< ALLOC > & getVarSize()
Definition: TypeInfo.h:1136
Span< const BasicFunctionInfo< ALLOC > > getFunctions() const override
Definition: TypeInfo.h:897
IBasicReflectablePtr< ALLOC > createInstance() const override
Definition: TypeInfo.h:1921
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:1581
static const IBasicTypeInfo< ALLOC > & getString()
Definition: TypeInfo.h:1172
Span< const BasicMethodInfo< ALLOC > > getMethods() const override
Definition: TypeInfo.h:1777
static const IBasicTypeInfo< ALLOC > & getUInt8()
Definition: TypeInfo.h:1040
static const IBasicTypeInfo< ALLOC > & getUInt16()
Definition: TypeInfo.h:1046
Span< const BasicMessageInfo< ALLOC > > getMessages() const override
Definition: TypeInfo.h:981
static const IBasicTypeInfo< ALLOC > & getBool()
Definition: TypeInfo.h:1292
static const IBasicTypeInfo< ALLOC > & getInt8()
Definition: TypeInfo.h:1301
Span< const ItemInfo > getBitmaskValues() const override
Definition: TypeInfo.h:933
static const IBasicTypeInfo< ALLOC > & getVarUInt32()
Definition: TypeInfo.h:1109
SchemaType getSchemaType() const override
Definition: TypeInfo.h:867
static const IBasicTypeInfo< ALLOC > & getUInt16()
Definition: TypeInfo.h:1346
ServiceTypeInfo(StringView schemaName, Span< const BasicMethodInfo< ALLOC >> methods)
Definition: TypeInfo.h:1772
SchemaType getSchemaType() const override
Definition: TypeInfo.h:1789
StringView getSqlConstraint() const override
Definition: TypeInfo.h:1867
static const IBasicTypeInfo< ALLOC > & getUInt32()
Definition: TypeInfo.h:1052
IBasicReflectablePtr< ALLOC > createInstance() const override
Definition: TypeInfo.h:999
~CompoundTypeInfoBase() override=0
TypeInfoBase(StringView schemaName, SchemaType schemaType, CppType cppType)
Definition: TypeInfo.h:853
Span< const BasicMessageInfo< ALLOC > > getMessages() const override
Definition: TypeInfo.h:1766
static const IBasicTypeInfo< ALLOC > & getInt8()
Definition: TypeInfo.h:1016
static const IBasicTypeInfo< ALLOC > & getBitBuffer()
Definition: TypeInfo.h:1181
Span< const BasicFieldInfo< ALLOC > > getFields() const override
Definition: TypeInfo.h:1807
bool isWithoutRowId() const override
Definition: TypeInfo.h:1694
const IBasicTypeInfo< ALLOC > & getUnderlyingType() const override
Definition: TypeInfo.h:915
StringView getSelector() const override
Definition: TypeInfo.h:903
static const IBasicTypeInfo< ALLOC > & getInt64()
Definition: TypeInfo.h:1328
IBasicReflectablePtr< ALLOC >(*)(const ALLOC &) CreateInstanceFunc
Definition: TypeInfo.h:481
static const IBasicTypeInfo< ALLOC > & getVarInt32()
Definition: TypeInfo.h:1073
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:1633
static const IBasicTypeInfo< ALLOC > & getFixedSignedBitField(uint8_t bitSize)
Definition: TypeInfo.h:1190
Span< const ItemInfo > getEnumItems() const override
Definition: TypeInfo.h:1849
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:1624
Span< const BasicCaseInfo< ALLOC > > getCases() const override
Definition: TypeInfo.h:1659
static const IBasicTypeInfo< ALLOC > & getVarUInt64()
Definition: TypeInfo.h:1118
BuiltinTypeInfo(StringView schemaName, SchemaType schemaType, CppType cppType)
Definition: TypeInfo.h:1005
uint8_t getBitSize() const override
Definition: TypeInfo.h:1801
static const IBasicTypeInfo< ALLOC > & getFloat16()
Definition: TypeInfo.h:1373