ezEngine  Milestone 9
StaticRTTI.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <Foundation/Basics.h>
7 #include <Foundation/Types/Variant.h>
8 #include <type_traits>
9 
10 class ezRTTI;
11 class ezReflectedClass;
12 
15 {
16  typedef ezUInt8 StorageType;
17 
18  enum Enum
19  {
21  IsEnum = EZ_BIT(1),
23  Class = EZ_BIT(3),
24 
26  Phantom = EZ_BIT(5),
27  Minimal = EZ_BIT(6),
28  Default = 0
29  };
30 
31  struct Bits
32  {
33  StorageType StandardType : 1;
34  StorageType IsEnum : 1;
35  StorageType Bitflags : 1;
36  StorageType Class : 1;
37  StorageType Abstract : 1;
38  StorageType Phantom : 1;
39  };
40 };
41 
43 
44 
45 // ****************************************************
46 // ***** Templates for accessing static RTTI data *****
47 
48 namespace ezInternal
49 {
51  template <typename T>
52  struct ezStaticRTTI
53  {
54  };
55 
56  // Special implementation for types that have no base
57  template <>
59  {
60  static const ezRTTI* GetRTTI() { return nullptr; }
61  };
62 
63  // Special implementation for void to make function reflection compile void return values without further specialization.
64  template <>
65  struct ezStaticRTTI<void>
66  {
67  static const ezRTTI* GetRTTI() { return nullptr; }
68  };
69 
70  template <typename T>
71  EZ_ALWAYS_INLINE const ezRTTI* GetStaticRTTI(ezTraitInt<1>) // class derived from ezReflectedClass
72  {
73  return T::GetStaticRTTI();
74  }
75 
76  template <typename T>
77  EZ_ALWAYS_INLINE const ezRTTI* GetStaticRTTI(ezTraitInt<0>) // static rtti
78  {
79  // Since this is pure C++ and no preprocessor macro, calling it with types such as 'int' and 'ezInt32' will
80  // actually return the same RTTI object, which would not be possible with a purely macro based solution
81 
82  return ezStaticRTTI<T>::GetRTTI();
83  }
84 
85  template <typename Type>
86  ezBitflags<ezTypeFlags> DetermineTypeFlags()
87  {
91  if ((type >= ezVariant::Type::FirstStandardType && type <= ezVariant::Type::LastStandardType) || EZ_IS_SAME_TYPE(ezVariant, Type))
93  else
94  flags.Add(ezTypeFlags::Class);
95 
96  if (std::is_abstract<Type>::value)
98 
99  return flags;
100  }
101 
102  template <>
103  EZ_ALWAYS_INLINE ezBitflags<ezTypeFlags> DetermineTypeFlags<ezVariant>()
104  {
106  }
107 }
108 
110 template <typename T>
111 EZ_ALWAYS_INLINE const ezRTTI* ezGetStaticRTTI()
112 {
113  return ezInternal::GetStaticRTTI<T>(ezTraitInt<EZ_IS_DERIVED_FROM_STATIC(ezReflectedClass, T)>());
114 }
115 
116  // **************************************************
117  // ***** Macros for declaring types reflectable *****
118 
119 #define EZ_NO_LINKAGE
120 
123 #define EZ_DECLARE_REFLECTABLE_TYPE(Linkage, TYPE) \
124  namespace ezInternal \
125  { \
126  struct Linkage ezStaticRTTIWrapper_##TYPE \
127  { \
128  static ezRTTI s_RTTI; \
129  }; \
130  \
131  /* This specialization calls the function to get the RTTI data */ \
132  /* This code might get duplicated in different DLLs, but all */ \
133  /* will call the same function, so the RTTI object is unique */ \
134  template <> \
135  struct ezStaticRTTI<TYPE> \
136  { \
137  EZ_ALWAYS_INLINE static const ezRTTI* GetRTTI() { return &ezStaticRTTIWrapper_##TYPE::s_RTTI; } \
138  }; \
139  }
140 
143 #define EZ_ALLOW_PRIVATE_PROPERTIES(SELF) friend struct ezRTTInfo_##SELF
144 
146 // internal helper macro
147 #define EZ_RTTIINFO_DECL(Type, BaseType, Version) \
148  struct ezRTTInfo_##Type \
149  { \
150  static const char* GetTypeName() { return #Type; } \
151  static ezUInt32 GetTypeVersion() { return Version; } \
152  \
153  typedef Type OwnType; \
154  typedef BaseType OwnBaseType; \
155  \
156  static ezRTTI GetRTTI(); \
157  };
158 
159 // internal helper macro
160 #define EZ_RTTIINFO_GETRTTI_IMPL_BEGIN(Type, AllocatorType) \
161  ezRTTI ezRTTInfo_##Type::GetRTTI() \
162  { \
163  static AllocatorType Allocator; \
164  static ezBitflags<ezTypeFlags> flags = ezInternal::DetermineTypeFlags<Type>(); \
165  static ezArrayPtr<ezAbstractProperty*> Properties; \
166  static ezArrayPtr<ezAbstractFunctionProperty*> Functions; \
167  static ezArrayPtr<ezPropertyAttribute*> Attributes; \
168  static ezArrayPtr<ezAbstractMessageHandler*> MessageHandlers; \
169  static ezArrayPtr<ezMessageSenderInfo> MessageSenders;
170 
172 
186 #define EZ_BEGIN_STATIC_REFLECTED_TYPE(Type, BaseType, Version, AllocatorType) \
187  EZ_RTTIINFO_DECL(Type, BaseType, Version) \
188  ezRTTI ezInternal::ezStaticRTTIWrapper_##Type::s_RTTI = ezRTTInfo_##Type::GetRTTI(); \
189  EZ_RTTIINFO_GETRTTI_IMPL_BEGIN(Type, AllocatorType)
190 
191 
193 #define EZ_END_STATIC_REFLECTED_TYPE \
194  ; \
195  return ezRTTI(GetTypeName(), ezGetStaticRTTI<OwnBaseType>(), sizeof(OwnType), GetTypeVersion(), \
196  ezVariant::TypeDeduction<OwnType>::value, flags, &Allocator, Properties, Functions, Attributes, MessageHandlers, \
197  MessageSenders, nullptr); \
198  }
199 
200 
202 #define EZ_BEGIN_PROPERTIES static ezAbstractProperty* PropertyList[] =
203 
204 
205 
207 #define EZ_END_PROPERTIES \
208  ; \
209  Properties = PropertyList
210 
212 #define EZ_BEGIN_FUNCTIONS static ezAbstractFunctionProperty* FunctionList[] =
213 
214 
215 
217 #define EZ_END_FUNCTIONS \
218  ; \
219  Functions = FunctionList
220 
222 #define EZ_BEGIN_ATTRIBUTES static ezPropertyAttribute* AttributeList[] =
223 
224 
225 
227 #define EZ_END_ATTRIBUTES \
228  ; \
229  Attributes = AttributeList
230 
236 #define EZ_FUNCTION_PROPERTY(Function) (new ezFunctionProperty<decltype(&OwnType::Function)>(EZ_STRINGIZE(Function), &OwnType::Function))
237 
246 #define EZ_FUNCTION_PROPERTY_EX(PropertyName, Function) (new ezFunctionProperty<decltype(&Function)>(PropertyName, &Function))
247 
248 
253 #define EZ_CONSTRUCTOR_PROPERTY(...) (new ezConstructorFunctionProperty<OwnType, ##__VA_ARGS__>())
254 
255 
256 // [internal] Helper macro to get the return type of a getter function.
257 #define EZ_GETTER_TYPE(Class, GetterFunc) decltype(((Class*)nullptr)->GetterFunc())
258 
270 #define EZ_ACCESSOR_PROPERTY(PropertyName, Getter, Setter) \
271  (new ezAccessorProperty<OwnType, EZ_GETTER_TYPE(OwnType, OwnType::Getter)>(PropertyName, &OwnType::Getter, &OwnType::Setter))
272 
274 #define EZ_ACCESSOR_PROPERTY_READ_ONLY(PropertyName, Getter) \
275  (new ezAccessorProperty<OwnType, EZ_GETTER_TYPE(OwnType, OwnType::Getter)>(PropertyName, &OwnType::Getter, nullptr))
276 
277 // [internal] Helper macro to get the return type of a array getter function.
278 #define EZ_ARRAY_GETTER_TYPE(Class, GetterFunc) decltype(((Class*)nullptr)->GetterFunc(0))
279 
294 #define EZ_ARRAY_ACCESSOR_PROPERTY(PropertyName, GetCount, Getter, Setter, Insert, Remove) \
295  (new ezAccessorArrayProperty<OwnType, EZ_ARRAY_GETTER_TYPE(OwnType, OwnType::Getter)>( \
296  PropertyName, &OwnType::GetCount, &OwnType::Getter, &OwnType::Setter, &OwnType::Insert, &OwnType::Remove))
297 
299 #define EZ_ARRAY_ACCESSOR_PROPERTY_READ_ONLY(PropertyName, GetCount, Getter) \
300  (new ezAccessorArrayProperty<OwnType, EZ_ARRAY_GETTER_TYPE(OwnType, OwnType::Getter)>(PropertyName, &OwnType::GetCount, \
301  &OwnType::Getter, nullptr, nullptr, nullptr))
302 
303 #define EZ_SET_CONTAINER_TYPE(Class, GetterFunc) decltype(((Class*)nullptr)->GetterFunc())
304 
305 #define EZ_SET_CONTAINER_SUB_TYPE(Class, GetterFunc) \
306  ezContainerSubTypeResolver<ezTypeTraits<decltype(((Class*)nullptr)->GetterFunc())>::NonConstReferenceType>::Type
307 
320 #define EZ_SET_ACCESSOR_PROPERTY(PropertyName, GetValues, Insert, Remove) \
321  (new ezAccessorSetProperty<OwnType, ezFunctionParameterTypeResolver<0, decltype(&OwnType::Insert)>::ParameterType, \
322  EZ_SET_CONTAINER_TYPE(OwnType, GetValues)>(PropertyName, &OwnType::GetValues, &OwnType::Insert, \
323  &OwnType::Remove))
324 
326 #define EZ_SET_ACCESSOR_PROPERTY_READ_ONLY(PropertyName, GetValues) \
327  (new ezAccessorSetProperty<OwnType, EZ_SET_CONTAINER_SUB_TYPE(OwnType, GetValues), EZ_SET_CONTAINER_TYPE(OwnType, GetValues)>( \
328  PropertyName, &OwnType::GetValues, nullptr, nullptr))
329 
344 #define EZ_MAP_WRITE_ACCESSOR_PROPERTY(PropertyName, GetContainer, Insert, Remove) \
345  (new ezWriteAccessorMapProperty<OwnType, ezFunctionParameterTypeResolver<1, decltype(&OwnType::Insert)>::ParameterType, \
346  EZ_SET_CONTAINER_TYPE(OwnType, GetContainer)>(PropertyName, &OwnType::GetContainer, &OwnType::Insert, \
347  &OwnType::Remove))
348 
368 #define EZ_MAP_ACCESSOR_PROPERTY(PropertyName, GetKeyRange, GetValue, Insert, Remove) \
369  (new ezAccessorMapProperty<OwnType, ezFunctionParameterTypeResolver<1, decltype(&OwnType::Insert)>::ParameterType, \
370  EZ_SET_CONTAINER_TYPE(OwnType, GetKeyRange)>(PropertyName, &OwnType::GetKeyRange, &OwnType::GetValue, \
371  &OwnType::Insert, &OwnType::Remove))
372 
374 #define EZ_MAP_ACCESSOR_PROPERTY_READ_ONLY(PropertyName, GetKeyRange, GetValue) \
375  (new ezAccessorMapProperty< \
376  OwnType, ezTypeTraits<ezFunctionParameterTypeResolver<1, decltype(&OwnType::GetValue)>::ParameterType>::NonConstReferenceType, \
377  EZ_SET_CONTAINER_TYPE(OwnType, GetKeyRange)>(PropertyName, &OwnType::GetKeyRange, &OwnType::GetValue, nullptr, nullptr))
378 
379 
380 
391 #define EZ_ENUM_ACCESSOR_PROPERTY(PropertyName, EnumType, Getter, Setter) \
392  (new ezEnumAccessorProperty<OwnType, EnumType, EZ_GETTER_TYPE(OwnType, OwnType::Getter)>(PropertyName, &OwnType::Getter, \
393  &OwnType::Setter))
394 
396 #define EZ_ENUM_ACCESSOR_PROPERTY_READ_ONLY(PropertyName, EnumType, Getter) \
397  (new ezEnumAccessorProperty<OwnType, EnumType, EZ_GETTER_TYPE(OwnType, OwnType::Getter)>(PropertyName, &OwnType::Getter, nullptr))
398 
400 #define EZ_BITFLAGS_ACCESSOR_PROPERTY(PropertyName, BitflagsType, Getter, Setter) \
401  (new ezBitflagsAccessorProperty<OwnType, BitflagsType, EZ_GETTER_TYPE(OwnType, OwnType::Getter)>(PropertyName, &OwnType::Getter, \
402  &OwnType::Setter))
403 
405 #define EZ_BITFLAGS_ACCESSOR_PROPERTY_READ_ONLY(PropertyName, BitflagsType, Getter) \
406  (new ezBitflagsAccessorProperty<OwnType, BitflagsType, EZ_GETTER_TYPE(OwnType, OwnType::Getter)>(PropertyName, &OwnType::Getter, nullptr))
407 
408 
409 // [internal] Helper macro to get the type of a class member.
410 #define EZ_MEMBER_TYPE(Class, Member) decltype(((Class*)nullptr)->Member)
411 
412 #define EZ_MEMBER_CONTAINER_SUB_TYPE(Class, Member) \
413  ezContainerSubTypeResolver<ezTypeTraits<decltype(((Class*)nullptr)->Member)>::NonConstReferenceType>::Type
414 
425 #define EZ_MEMBER_PROPERTY(PropertyName, MemberName) \
426  (new ezMemberProperty<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName)>( \
427  PropertyName, &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetValue, \
428  &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::SetValue, \
429  &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetPropertyPointer))
430 
432 #define EZ_MEMBER_PROPERTY_READ_ONLY(PropertyName, MemberName) \
433  (new ezMemberProperty<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName)>( \
434  PropertyName, &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetValue, nullptr, \
435  &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetPropertyPointer))
436 
438 #define EZ_ARRAY_MEMBER_PROPERTY(PropertyName, MemberName) \
439  (new ezMemberArrayProperty<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), EZ_MEMBER_CONTAINER_SUB_TYPE(OwnType, MemberName)>( \
440  PropertyName, &ezArrayPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetConstContainer, \
441  &ezArrayPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetContainer))
442 
444 #define EZ_ARRAY_MEMBER_PROPERTY_READ_ONLY(PropertyName, MemberName) \
445  (new ezMemberArrayProperty<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), EZ_MEMBER_CONTAINER_SUB_TYPE(OwnType, MemberName)>( \
446  PropertyName, &ezArrayPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetConstContainer, \
447  nullptr))
448 
450 #define EZ_SET_MEMBER_PROPERTY(PropertyName, MemberName) \
451  (new ezMemberSetProperty<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), EZ_MEMBER_CONTAINER_SUB_TYPE(OwnType, MemberName)>( \
452  PropertyName, &ezSetPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetConstContainer, \
453  &ezSetPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetContainer))
454 
456 #define EZ_SET_MEMBER_PROPERTY_READ_ONLY(PropertyName, MemberName) \
457  (new ezMemberSetProperty<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), EZ_MEMBER_CONTAINER_SUB_TYPE(OwnType, MemberName)>( \
458  PropertyName, &ezSetPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetConstContainer, \
459  nullptr))
460 
462 #define EZ_MAP_MEMBER_PROPERTY(PropertyName, MemberName) \
463  (new ezMemberMapProperty<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), EZ_MEMBER_CONTAINER_SUB_TYPE(OwnType, MemberName)>( \
464  PropertyName, &ezMapPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetConstContainer, \
465  &ezMapPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetContainer))
466 
468 #define EZ_MAP_MEMBER_PROPERTY_READ_ONLY(PropertyName, MemberName) \
469  (new ezMemberMapProperty<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), EZ_MEMBER_CONTAINER_SUB_TYPE(OwnType, MemberName)>( \
470  PropertyName, &ezMapPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetConstContainer, \
471  nullptr))
472 
485 #define EZ_ENUM_MEMBER_PROPERTY(PropertyName, EnumType, MemberName) \
486  (new ezEnumMemberProperty<OwnType, EnumType, EZ_MEMBER_TYPE(OwnType, MemberName)>( \
487  PropertyName, &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetValue, \
488  &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::SetValue, \
489  &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetPropertyPointer))
490 
492 #define EZ_ENUM_MEMBER_PROPERTY_READ_ONLY(PropertyName, EnumType, MemberName) \
493  (new ezEnumMemberProperty<OwnType, EnumType, EZ_MEMBER_TYPE(OwnType, MemberName)>( \
494  PropertyName, &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetValue, nullptr, \
495  &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetPropertyPointer))
496 
498 #define EZ_BITFLAGS_MEMBER_PROPERTY(PropertyName, BitflagsType, MemberName) \
499  (new ezBitflagsMemberProperty<OwnType, BitflagsType, EZ_MEMBER_TYPE(OwnType, MemberName)>( \
500  PropertyName, &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetValue, \
501  &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::SetValue, \
502  &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetPropertyPointer))
503 
505 #define EZ_BITFLAGS_MEMBER_PROPERTY_READ_ONLY(PropertyName, BitflagsType, MemberName) \
506  (new ezBitflagsMemberProperty<OwnType, BitflagsType, EZ_MEMBER_TYPE(OwnType, MemberName)>( \
507  PropertyName, &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetValue, nullptr, \
508  &ezPropertyAccessor<OwnType, EZ_MEMBER_TYPE(OwnType, MemberName), &OwnType::MemberName>::GetPropertyPointer))
509 
510 
511 
518 #define EZ_CONSTANT_PROPERTY(PropertyName, Value) (new ezConstantProperty<decltype(Value)>(PropertyName, Value))
519 
520 
521 
522 // [internal] Helper macro
523 #define EZ_ENUM_VALUE_TO_CONSTANT_PROPERTY(name) EZ_CONSTANT_PROPERTY(EZ_STRINGIZE(name), (Storage)name),
524 
527 #define EZ_ENUM_CONSTANTS(...) EZ_EXPAND_ARGS(EZ_ENUM_VALUE_TO_CONSTANT_PROPERTY, ##__VA_ARGS__)
528 
531 #define EZ_ENUM_CONSTANT(Value) EZ_CONSTANT_PROPERTY(EZ_STRINGIZE(Value), (Storage)Value)
532 
535 #define EZ_BITFLAGS_CONSTANTS(...) EZ_EXPAND_ARGS(EZ_ENUM_VALUE_TO_CONSTANT_PROPERTY, ##__VA_ARGS__)
536 
539 #define EZ_BITFLAGS_CONSTANT(Value) EZ_CONSTANT_PROPERTY(EZ_STRINGIZE(Value), (Storage)Value)
540 
541 
542 
549 #define EZ_BEGIN_STATIC_REFLECTED_ENUM(Type, Version) \
550  EZ_BEGIN_STATIC_REFLECTED_TYPE(Type, ezEnumBase, Version, ezRTTINoAllocator); \
551  typedef Type::StorageType Storage; \
552  EZ_BEGIN_PROPERTIES \
553  { \
554  EZ_CONSTANT_PROPERTY(EZ_STRINGIZE(Type::Default), (Storage)Type::Default),
555 
556 #define EZ_END_STATIC_REFLECTED_ENUM \
557  } \
558  EZ_END_PROPERTIES; \
559  flags |= ezTypeFlags::IsEnum; \
560  flags.Remove(ezTypeFlags::Class); \
561  EZ_END_STATIC_REFLECTED_TYPE
562 
563 
570 #define EZ_BEGIN_STATIC_REFLECTED_BITFLAGS(Type, Version) \
571  EZ_BEGIN_STATIC_REFLECTED_TYPE(Type, ezBitflagsBase, Version, ezRTTINoAllocator); \
572  typedef Type::StorageType Storage; \
573  EZ_BEGIN_PROPERTIES \
574  { \
575  EZ_CONSTANT_PROPERTY(EZ_STRINGIZE(Type::Default), (Storage)Type::Default),
576 
577 #define EZ_END_STATIC_REFLECTED_BITFLAGS \
578  } \
579  EZ_END_PROPERTIES; \
580  flags |= ezTypeFlags::Bitflags; \
581  flags.Remove(ezTypeFlags::Class); \
582  EZ_END_STATIC_REFLECTED_TYPE
583 
584 
585 
588 #define EZ_BEGIN_MESSAGEHANDLERS static ezAbstractMessageHandler* HandlerList[] =
589 
590 
592 #define EZ_END_MESSAGEHANDLERS \
593  ; \
594  MessageHandlers = HandlerList
595 
596 
605 #define EZ_MESSAGE_HANDLER(MessageType, FunctionName) \
606  new ezInternal::MessageHandler<EZ_IS_CONST_MESSAGE_HANDLER( \
607  OwnType, MessageType, &OwnType::FunctionName)>::Impl<OwnType, MessageType, &OwnType::FunctionName>()
608 
609 
612 #define EZ_BEGIN_MESSAGESENDERS static ezMessageSenderInfo SenderList[] =
613 
614 
616 #define EZ_END_MESSAGESENDERS \
617  ; \
618  MessageSenders = SenderList;
619 
626 #define EZ_MESSAGE_SENDER(MemberName) \
627  { \
628  #MemberName, ezGetStaticRTTI < EZ_MEMBER_TYPE(OwnType, MemberName)::MessageType > () \
629  }
630 
Dummy type to pass to templates and macros that expect a base type for a class that has no base...
Definition: Types.h:107
Type is abstract.
Definition: StaticRTTI.h:25
Enum
Definition: StaticRTTI.h:18
#define EZ_IS_SAME_TYPE(TypeA, TypeB)
Checks whether A and B are the same type.
Definition: TypeTraits.h:181
Enum
This enum describes the type of data that is currently stored inside the variant. Note that changes t...
Definition: Variant.h:38
[internal] Helper struct for accessing static RTTI data.
Definition: StaticRTTI.h:52
#define EZ_BIT(n)
Creates a bit mask with only the n-th Bit set. Useful when creating enum values for flags...
Definition: PreprocessorUtils.h:23
This enumerable class holds information about reflected types. Each instance represents one type that...
Definition: RTTI.h:30
EZ_ALWAYS_INLINE void Add(const ezBitflags< T > &rhs)
Sets the given flag.
Definition: Bitflags.h:140
All classes that should be dynamically reflectable, need to be derived from this base class...
Definition: DynamicRTTI.h:67
Type traits.
Definition: TypeTraits.h:9
#define EZ_DECLARE_FLAGS_OPERATORS(FlagsType)
This macro will define the operator| and operator& function that is required for class FlagsType to w...
Definition: Bitflags.h:214
*** Types that are flagged as &#39;StandardTypes&#39; (see DetermineTypeFlags) ***
Definition: Variant.h:43
De-serialized type information that cannot be created on this process.
Definition: StaticRTTI.h:26
EZ_ALWAYS_INLINE const ezRTTI * ezGetStaticRTTI()
Use this function, specialized with the type that you are interested in, to get the static RTTI data ...
Definition: StaticRTTI.h:111
Anything that can be stored inside an ezVariant except for pointers and containers.
Definition: StaticRTTI.h:20
A class or struct. The above flags are mutually exclusive.
Definition: StaticRTTI.h:23
Flags that describe a reflected type.
Definition: StaticRTTI.h:14
enum struct used for ezEnum.
Definition: StaticRTTI.h:21
Does not contain any property, function or attribute information. Used only for versioning.
Definition: StaticRTTI.h:27
ezVariant is a class that can store different types of variables, which is useful in situations where...
Definition: Variant.h:28
Definition: EventMessage.h:27
bitflags struct used for ezBitflags.
Definition: StaticRTTI.h:22
A helper struct to convert the C++ type, which is passed as the template argument, into one of the ezVariant::Type enum values.
Definition: Variant.h:95
Definition: StaticRTTI.h:31