Go to the documentation of this file.
21 #ifndef __typeInfo_hpp__
22 #define __typeInfo_hpp__
29 #define has_static_member(name) \
30 template <typename, typename> \
31 struct has_static_member_##name; \
33 template <typename testType, typename Ret, typename... Args> \
34 struct has_static_member_##name<testType, Ret(Args...)> \
36 template <typename U, U> \
39 template <typename U> \
40 static std::true_type Test(Check<Ret (*)(Args...), &U::name> *); \
41 template <typename U> \
42 static std::false_type Test(...); \
43 static const bool value = decltype(Test<testType>(0))::value; \
66 char *realname = abi::__cxa_demangle(ti.name(),
nullptr,
nullptr, &status);
120 template <
typename T>
126 return T::TYPENAME();
130 return basicTypeName<T>();
134 template <
typename T>
140 return T::TYPENAME();
144 return basicTypeName<T>();
150 template <
typename Type1,
typename Type2>
153 return getTypeName<Type1>() ==
object->typeName();
156 template <
typename Type1,
typename Type2>
159 return getTypeName<Type1>() ==
object.typeName();
163 #define QuadrupleTypeInfoNV(T) \
164 inline static word TYPENAME() \
166 return getTypeName<T>()+"x4"; \
168 word typeName() const \
173 #define TripleTypeInfoNV(T) \
174 inline static word TYPENAME() \
176 return getTypeName<T>()+"x3"; \
178 word typeName() const \
183 #define ClassInfo(tName) \
184 inline static word TYPENAME() \
189 #define TypeInfo(tName) \
190 inline static word TYPENAME() \
194 virtual word typeName() const \
199 #define TypeInfoNV(tName) \
200 inline static word TYPENAME() \
204 word typeName() const \
209 #define TypeInfoTemplate11(tName, Type) \
210 inline static word TYPENAME() \
212 return word(tName) + "<" + getTypeName<Type>() + ">"; \
214 virtual word typeName() const \
219 #define TypeInfoTemplate12(tName, Type1, Type2) \
220 inline static word TYPENAME() \
222 return word(tName) + "<" + getTypeName<Type1>() + "," + \
223 getTypeName<Type2>() + ">"; \
225 virtual word typeName() const \
230 #define TypeInfoTemplate13(tName, Type1, Type2, Type3) \
231 inline static word TYPENAME() \
233 return word(tName) + "<" + getTypeName<Type1>() + "," + \
234 getTypeName<Type2>() + "," + getTypeName<Type3>() + ">"; \
236 virtual word typeName() const \
242 #define TypeInfoTemplateNV11(tName, Type) \
243 inline static word TYPENAME() \
245 return word(tName) + "<" + getTypeName<Type>() + ">"; \
247 inline word typeName() const \
252 #define TypeInfoTemplateNV111(tName, Type, tName2) \
253 inline static word TYPENAME() \
255 return word(tName) + "<" + getTypeName<Type>() + "," + word(tName2) + \
258 inline word typeName() const \
263 #define TypeInfoTemplate111(tName, Type, tName2) \
264 inline static word TYPENAME() \
266 return word(tName) + "<" + getTypeName<Type>() + "," + word(tName2) + \
269 virtual word typeName() const \
274 #define TypeInfoTemplate211(tBase, tName1, Type, tName3) \
275 inline static word TYPENAME() \
277 return word(tBase) + "<" + word(tName1) + "," + getTypeName<Type>() + \
278 "," + word(tName3) + ">"; \
280 virtual word typeName() const \
285 #define TypeInfoTemplate22(tBase, tName1, Type1, Type2) \
286 inline static word TYPENAME() \
288 return word(tBase) + "<" + word(tName1) + "," + getTypeName<Type1>() + \
289 "," + getTypeName<Type2>() + ">"; \
291 virtual word typeName() const \
word basicTypeName< uint8 >()
bool checkType(Type2 *object)
word basicTypeName< uint32 >()
word basicTypeName< uint64 >()
static constexpr bool hasMember()
#define has_static_member(name)
word basicTypeName< int8 >()
word basicTypeName< int64 >()
word basicTypeName< real >()
word basicTypeName< word >()
word basicTypeName< int32 >()