ezEngine  Milestone 9
Variant_inl.h
1 
2 EZ_ALWAYS_INLINE ezVariant::ezVariant()
3 {
4  m_Type = Type::Invalid;
5  m_bIsShared = false;
6 }
7 
8 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVariant& other)
9 {
10  CopyFrom(other);
11 }
12 
13 EZ_ALWAYS_INLINE ezVariant::ezVariant(ezVariant&& other)
14 {
15  MoveFrom(std::move(other));
16 }
17 
18 EZ_ALWAYS_INLINE ezVariant::ezVariant(const bool& value)
19 {
20  InitInplace(value);
21 }
22 
23 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezInt8& value)
24 {
25  InitInplace(value);
26 }
27 
28 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezUInt8& value)
29 {
30  InitInplace(value);
31 }
32 
33 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezInt16& value)
34 {
35  InitInplace(value);
36 }
37 
38 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezUInt16& value)
39 {
40  InitInplace(value);
41 }
42 
43 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezInt32& value)
44 {
45  InitInplace(value);
46 }
47 
48 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezUInt32& value)
49 {
50  InitInplace(value);
51 }
52 
53 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezInt64& value)
54 {
55  InitInplace(value);
56 }
57 
58 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezUInt64& value)
59 {
60  InitInplace(value);
61 }
62 
63 EZ_ALWAYS_INLINE ezVariant::ezVariant(const float& value)
64 {
65  InitInplace(value);
66 }
67 
68 EZ_ALWAYS_INLINE ezVariant::ezVariant(const double& value)
69 {
70  InitInplace(value);
71 }
72 
73 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezColor& value)
74 {
75  InitInplace(value);
76 }
77 
78 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVec2& value)
79 {
80  InitInplace(value);
81 }
82 
83 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVec3& value)
84 {
85  InitInplace(value);
86 }
87 
88 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVec4& value)
89 {
90  InitInplace(value);
91 }
92 
93 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVec2I32& value)
94 {
95  InitInplace(value);
96 }
97 
98 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVec3I32& value)
99 {
100  InitInplace(value);
101 }
102 
103 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVec4I32& value)
104 {
105  InitInplace(value);
106 }
107 
108 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVec2U32& value)
109 {
110  InitInplace(value);
111 }
112 
113 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVec3U32& value)
114 {
115  InitInplace(value);
116 }
117 
118 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezVec4U32& value)
119 {
120  InitInplace(value);
121 }
122 
123 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezQuat& value)
124 {
125  InitInplace(value);
126 }
127 
128 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezStringView& value)
129 {
130  InitInplace(value);
131 }
132 
133 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezTime& value)
134 {
135  InitInplace(value);
136 }
137 
138 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezUuid& value)
139 {
140  InitInplace(value);
141 }
142 
143 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezAngle& value)
144 {
145  InitInplace(value);
146 }
147 
148 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezColorGammaUB& value)
149 {
150  InitInplace(value);
151 }
152 
153 EZ_ALWAYS_INLINE ezVariant::ezVariant(ezReflectedClass* value)
154 {
155  InitInplace(value);
156 }
157 
158 EZ_ALWAYS_INLINE ezVariant::ezVariant(const ezReflectedClass* value)
159 {
160  InitInplace(value);
161 }
162 
163 EZ_ALWAYS_INLINE ezVariant::ezVariant(void* value)
164 {
165  InitInplace(value);
166 }
167 
168 EZ_ALWAYS_INLINE ezVariant::ezVariant(const void* value)
169 {
170  InitInplace(value);
171 }
172 
173 EZ_ALWAYS_INLINE ezVariant::~ezVariant()
174 {
175  Release();
176 }
177 
178 EZ_ALWAYS_INLINE void ezVariant::operator=(const ezVariant& other)
179 {
180  if (this != &other)
181  {
182  Release();
183  CopyFrom(other);
184  }
185 }
186 
187 EZ_ALWAYS_INLINE void ezVariant::operator=(ezVariant&& other)
188 {
189  if (this != &other)
190  {
191  Release();
192  MoveFrom(std::move(other));
193  }
194 }
195 
196 template <typename T>
197 EZ_ALWAYS_INLINE void ezVariant::operator=(const T& value)
198 {
199  *this = ezVariant(value);
200 }
201 
202 EZ_ALWAYS_INLINE bool ezVariant::operator!=(const ezVariant& other) const
203 {
204  return !(*this == other);
205 }
206 
207 template <typename T>
208 EZ_FORCE_INLINE bool ezVariant::operator==(const T& other) const
209 {
210  using StorageType = typename TypeDeduction<T>::StorageType;
211  struct TypeInfo
212  {
213  enum
214  {
215  isNumber = TypeDeduction<T>::value > Type::Invalid&& TypeDeduction<T>::value <= Type::Double
216  };
217  };
218 
219  if (IsFloatingPoint())
220  {
221  return ezVariantHelper::CompareFloat(*this, other, ezTraitInt<TypeInfo::isNumber>());
222  }
223  else if (IsNumber())
224  {
225  return ezVariantHelper::CompareNumber(*this, other, ezTraitInt<TypeInfo::isNumber>());
226  }
227 
228  EZ_ASSERT_DEV(IsA<StorageType>(), "Stored type '{0}' does not match comparison type '{1}'", m_Type, TypeDeduction<T>::value);
229  return Cast<StorageType>() == other;
230 }
231 
232 template <typename T>
233 EZ_ALWAYS_INLINE bool ezVariant::operator!=(const T& other) const
234 {
235  return !(*this == other);
236 }
237 
238 EZ_ALWAYS_INLINE bool ezVariant::IsValid() const
239 {
240  return m_Type != Type::Invalid;
241 }
242 
243 EZ_ALWAYS_INLINE bool ezVariant::IsNumber() const
244 {
245  return IsNumberStatic(m_Type);
246 }
247 
248 EZ_ALWAYS_INLINE bool ezVariant::IsFloatingPoint() const
249 {
250  return IsFloatingPointStatic(m_Type);
251 }
252 
253 template <typename T>
254 EZ_ALWAYS_INLINE bool ezVariant::IsA() const
255 {
256  return m_Type == TypeDeduction<T>::value;
257 }
258 
260 {
261  return static_cast<Type::Enum>(m_Type);
262 }
263 
264 template <typename T>
265 EZ_ALWAYS_INLINE const T& ezVariant::Get() const
266 {
267  EZ_ASSERT_DEV(IsA<T>(), "Stored type '{0}' does not match requested type '{1}'", m_Type, TypeDeduction<T>::value);
268  return Cast<T>();
269 }
270 
271 EZ_ALWAYS_INLINE void* ezVariant::GetData()
272 {
273  return m_bIsShared ? m_Data.shared->m_Ptr : &m_Data;
274 }
275 
276 EZ_ALWAYS_INLINE const void* ezVariant::GetData() const
277 {
278  return m_bIsShared ? m_Data.shared->m_Ptr : &m_Data;
279 }
280 
281 template <typename T>
282 EZ_ALWAYS_INLINE bool ezVariant::CanConvertTo() const
283 {
284  return CanConvertTo(static_cast<Type::Enum>(TypeDeduction<T>::value));
285 }
286 
287 template <typename T>
288 T ezVariant::ConvertTo(ezResult* out_pConversionStatus /* = nullptr*/) const
289 {
290  if (!CanConvertTo<T>())
291  {
292  if (out_pConversionStatus != nullptr)
293  *out_pConversionStatus = EZ_FAILURE;
294 
295  return T();
296  }
297 
298  if (m_Type == TypeDeduction<T>::value)
299  {
300  if (out_pConversionStatus != nullptr)
301  *out_pConversionStatus = EZ_SUCCESS;
302 
303  return Cast<T>();
304  }
305 
306  T result;
307  bool bSuccessful = true;
308  ezVariantHelper::To(*this, result, bSuccessful);
309 
310  if (out_pConversionStatus != nullptr)
311  *out_pConversionStatus = bSuccessful ? EZ_SUCCESS : EZ_FAILURE;
312 
313  return result;
314 }
315 
316 // for some reason MSVC does not accept the template keyword here
317 #if EZ_ENABLED(EZ_COMPILER_MSVC_PURE)
318 # define CALL_FUNCTOR(functor, type) functor.operator()<type>()
319 #else
320 # define CALL_FUNCTOR(functor, type) functor.template operator()<type>()
321 #endif
322 
323 template <typename Functor>
324 void ezVariant::DispatchTo(Functor& functor, Type::Enum type)
325 {
326  switch (type)
327  {
328  case Type::Bool:
329  CALL_FUNCTOR(functor, bool);
330  break;
331 
332  case Type::Int8:
333  CALL_FUNCTOR(functor, ezInt8);
334  break;
335 
336  case Type::UInt8:
337  CALL_FUNCTOR(functor, ezUInt8);
338  break;
339 
340  case Type::Int16:
341  CALL_FUNCTOR(functor, ezInt16);
342  break;
343 
344  case Type::UInt16:
345  CALL_FUNCTOR(functor, ezUInt16);
346  break;
347 
348  case Type::Int32:
349  CALL_FUNCTOR(functor, ezInt32);
350  break;
351 
352  case Type::UInt32:
353  CALL_FUNCTOR(functor, ezUInt32);
354  break;
355 
356  case Type::Int64:
357  CALL_FUNCTOR(functor, ezInt64);
358  break;
359 
360  case Type::UInt64:
361  CALL_FUNCTOR(functor, ezUInt64);
362  break;
363 
364  case Type::Float:
365  CALL_FUNCTOR(functor, float);
366  break;
367 
368  case Type::Double:
369  CALL_FUNCTOR(functor, double);
370  break;
371 
372  case Type::Color:
373  CALL_FUNCTOR(functor, ezColor);
374  break;
375 
376  case Type::ColorGamma:
377  CALL_FUNCTOR(functor, ezColorGammaUB);
378  break;
379 
380  case Type::Vector2:
381  CALL_FUNCTOR(functor, ezVec2);
382  break;
383 
384  case Type::Vector3:
385  CALL_FUNCTOR(functor, ezVec3);
386  break;
387 
388  case Type::Vector4:
389  CALL_FUNCTOR(functor, ezVec4);
390  break;
391 
392  case Type::Vector2I:
393  CALL_FUNCTOR(functor, ezVec2I32);
394  break;
395 
396  case Type::Vector3I:
397  CALL_FUNCTOR(functor, ezVec3I32);
398  break;
399 
400  case Type::Vector4I:
401  CALL_FUNCTOR(functor, ezVec4I32);
402  break;
403 
404  case Type::Vector2U:
405  CALL_FUNCTOR(functor, ezVec2U32);
406  break;
407 
408  case Type::Vector3U:
409  CALL_FUNCTOR(functor, ezVec3U32);
410  break;
411 
412  case Type::Vector4U:
413  CALL_FUNCTOR(functor, ezVec4U32);
414  break;
415 
416  case Type::Quaternion:
417  CALL_FUNCTOR(functor, ezQuat);
418  break;
419 
420  case Type::Matrix3:
421  CALL_FUNCTOR(functor, ezMat3);
422  break;
423 
424  case Type::Matrix4:
425  CALL_FUNCTOR(functor, ezMat4);
426  break;
427 
428  case Type::Transform:
429  CALL_FUNCTOR(functor, ezTransform);
430  break;
431 
432  case Type::String:
433  CALL_FUNCTOR(functor, ezString);
434  break;
435 
436  case Type::StringView:
437  CALL_FUNCTOR(functor, ezStringView);
438  break;
439 
440  case Type::DataBuffer:
441  CALL_FUNCTOR(functor, ezDataBuffer);
442  break;
443 
444  case Type::Time:
445  CALL_FUNCTOR(functor, ezTime);
446  break;
447 
448  case Type::Uuid:
449  CALL_FUNCTOR(functor, ezUuid);
450  break;
451 
452  case Type::Angle:
453  CALL_FUNCTOR(functor, ezAngle);
454  break;
455 
456  case Type::VariantArray:
457  CALL_FUNCTOR(functor, ezVariantArray);
458  break;
459 
461  CALL_FUNCTOR(functor, ezVariantDictionary);
462  break;
463 
465  CALL_FUNCTOR(functor, ezReflectedClass*);
466  break;
467 
468  case Type::VoidPointer:
469  CALL_FUNCTOR(functor, void*);
470  break;
471 
472  default:
473  EZ_REPORT_FAILURE("Could not dispatch type '{0}'", type);
474  break;
475  }
476 }
477 
478 #undef CALL_FUNCTOR
479 
481 
482 template <typename T>
483 EZ_FORCE_INLINE void ezVariant::InitInplace(const T& value)
484 {
485  EZ_CHECK_AT_COMPILETIME_MSG(TypeDeduction<T>::value != Type::Invalid, "value of this type cannot be stored in a Variant");
486  EZ_CHECK_AT_COMPILETIME_MSG(ezIsPodType<T>::value, "in place data needs to be POD");
487  ezMemoryUtils::CopyConstruct(reinterpret_cast<T*>(&m_Data), value, 1);
488 
489  m_Type = TypeDeduction<T>::value;
490  m_bIsShared = false;
491 }
492 
493 inline void ezVariant::Release()
494 {
495  if (m_bIsShared)
496  {
497  if (m_Data.shared->m_uiRef.Decrement() == 0)
498  {
499  EZ_DEFAULT_DELETE(m_Data.shared);
500  }
501  }
502 }
503 
504 inline void ezVariant::CopyFrom(const ezVariant& other)
505 {
506  m_Type = other.m_Type;
507  m_bIsShared = other.m_bIsShared;
508 
509  if (m_bIsShared)
510  {
511  m_Data.shared = other.m_Data.shared;
512  m_Data.shared->m_uiRef.Increment();
513  }
514  else if (other.IsValid())
515  {
516  m_Data = other.m_Data;
517  }
518 }
519 
520 EZ_ALWAYS_INLINE void ezVariant::MoveFrom(ezVariant&& other)
521 {
522  m_Type = other.m_Type;
523  m_bIsShared = other.m_bIsShared;
524  m_Data = other.m_Data;
525 
526  other.m_Type = Type::Invalid;
527  other.m_bIsShared = false;
528  other.m_Data.shared = nullptr;
529 }
530 
531 template <typename T>
532 EZ_FORCE_INLINE T& ezVariant::Cast()
533 {
534  EZ_CHECK_AT_COMPILETIME_MSG(TypeDeduction<T>::value != Type::Invalid, "Value of this type cannot be compared against a Variant");
535  const bool validType = ezConversionTest<T, typename TypeDeduction<T>::StorageType>::sameType;
536  EZ_CHECK_AT_COMPILETIME_MSG(validType, "Invalid Cast, can only cast to storage type");
537 
538  return (sizeof(T) > sizeof(Data) || TypeDeduction<T>::forceSharing) ? *static_cast<T*>(m_Data.shared->m_Ptr)
539  : *reinterpret_cast<T*>(&m_Data);
540 }
541 
542 template <typename T>
543 EZ_FORCE_INLINE const T& ezVariant::Cast() const
544 {
545  EZ_CHECK_AT_COMPILETIME_MSG(TypeDeduction<T>::value != Type::Invalid, "Value of this type cannot be compared against a Variant");
546  const bool validType = ezConversionTest<T, typename TypeDeduction<T>::StorageType>::sameType;
547  EZ_CHECK_AT_COMPILETIME_MSG(validType, "Invalid Cast, can only cast to storage type");
548 
549  return (sizeof(T) > sizeof(Data) || TypeDeduction<T>::forceSharing) ? *static_cast<const T*>(m_Data.shared->m_Ptr)
550  : *reinterpret_cast<const T*>(&m_Data);
551 }
552 
553 EZ_ALWAYS_INLINE bool ezVariant::IsNumberStatic(ezUInt32 type)
554 {
555  return type > Type::Invalid && type <= Type::Double;
556 }
557 
558 EZ_ALWAYS_INLINE bool ezVariant::IsFloatingPointStatic(ezUInt32 type)
559 {
560  return type == Type::Float || type == Type::Double;
561 }
562 
563 template <typename T>
564 T ezVariant::ConvertNumber() const
565 {
566  switch (m_Type)
567  {
568  case Type::Bool:
569  return static_cast<T>(Cast<bool>());
570  case Type::Int8:
571  return static_cast<T>(Cast<ezInt8>());
572  case Type::UInt8:
573  return static_cast<T>(Cast<ezUInt8>());
574  case Type::Int16:
575  return static_cast<T>(Cast<ezInt16>());
576  case Type::UInt16:
577  return static_cast<T>(Cast<ezUInt16>());
578  case Type::Int32:
579  return static_cast<T>(Cast<ezInt32>());
580  case Type::UInt32:
581  return static_cast<T>(Cast<ezUInt32>());
582  case Type::Int64:
583  return static_cast<T>(Cast<ezInt64>());
584  case Type::UInt64:
585  return static_cast<T>(Cast<ezUInt64>());
586  case Type::Float:
587  return static_cast<T>(Cast<float>());
588  case Type::Double:
589  return static_cast<T>(Cast<double>());
590  }
591 
592  EZ_REPORT_FAILURE("Variant is not a number");
593  return T(0);
594 }
595 
596 template <>
598 {
599  EZ_ALWAYS_INLINE static ezUInt32 Hash(const ezVariant& value)
600  {
601  ezUInt64 uiHash = value.ComputeHash(0);
602  return (ezUInt32)uiHash;
603  }
604 
605  EZ_ALWAYS_INLINE static bool Equal(const ezVariant& a, const ezVariant& b) { return a == b; }
606 };
bool operator!=(const ezVariant &other) const
Same as operator== (with a twist!)
Definition: Variant_inl.h:202
The variant stores an ezMat3. A heap allocation is required to store this data type.
Definition: Variant.h:66
The variant stores a void pointer.
Definition: Variant.h:85
The variant stores an ezVec3.
Definition: Variant.h:57
The variant stores an ezMat4. A heap allocation is required to store this data type.
Definition: Variant.h:67
The variant stores an ezVec3U32.
Definition: Variant.h:63
The variant stores an array of ezVariant&#39;s. A heap allocation is required to store this data type...
Definition: Variant.h:81
#define EZ_REPORT_FAILURE(szErrorMsg,...)
Macro to report a failure when that code is reached. This will ALWAYS be executed, even in release builds, therefore might crash the application (or trigger a debug break).
Definition: Assert.h:52
A 3-component vector class.
Definition: Declarations.h:74
ezColor represents and RGBA color in linear color space. Values are stored as float, allowing HDR values and full precision color modifications.
Definition: Color.h:42
Enum
This enum describes the type of data that is currently stored inside the variant. Note that changes t...
Definition: Variant.h:38
The variant stores an ezColor.
Definition: Variant.h:55
bool IsNumber() const
Returns whether the stored type is numerical type either integer or floating point.
Definition: Variant_inl.h:243
bool IsFloatingPoint() const
Returns whether the stored type is floating point.
Definition: Variant_inl.h:248
The variant stores an ezVec4I32.
Definition: Variant.h:61
Definition: Variant.h:71
The variant stores an ezVec4U32.
Definition: Variant.h:64
Type::Enum GetType() const
Returns the exact ezVariant::Type value.
Definition: Variant_inl.h:259
static void DispatchTo(Functor &functor, Type::Enum type)
This will call the overloaded operator() (function call operator) of the provided functor...
Definition: Variant_inl.h:324
The variant stores an ezVec2I32.
Definition: Variant.h:59
The variant stores an ezUInt64.
Definition: Variant.h:52
The variant stores an ezAngle value.
Definition: Variant.h:75
The variant stores an ezStringView.
Definition: Variant.h:70
All classes that should be dynamically reflectable, need to be derived from this base class...
Definition: DynamicRTTI.h:67
The variant stores an ezColorGammaUB value.
Definition: Variant.h:76
static void CopyConstruct(Destination *pDestination, const Source &copy, size_t uiCount)
Constructs uiCount objects of type T in a raw buffer at pDestination, by creating uiCount copies of c...
Helper struct to calculate the Hash of different types.
Definition: HashingUtils.h:47
#define EZ_ASSERT_DEV(bCondition, szErrorMsg,...)
Macro to raise an error, if a condition is not met.
Definition: Assert.h:116
Type traits.
Definition: TypeTraits.h:9
The time class encapsulates a double value storing the time in seconds.
Definition: Time.h:10
The variant stores a bool.
Definition: Variant.h:44
bool IsA() const
Returns whether the stored type is exactly the given type.
The variant stores an ezUInt32.
Definition: Variant.h:50
void operator=(const ezVariant &other)
Copies the data from the other variant into this one.
Definition: Variant_inl.h:178
#define EZ_DEFAULT_DELETE(ptr)
deletes the instance stored in ptr using the default allocator and sets ptr to nullptr ...
Definition: AllocatorBase.h:95
Static Conversion Test.
Definition: TypeTraits.h:61
A 2-component vector class.
Definition: Declarations.h:66
T ConvertTo(ezResult *out_pConversionStatus=nullptr) const
Tries to convert the stored value to the given type. The optional status parameter can be used to che...
Definition: Variant_inl.h:288
A 4-component vector class.
Definition: Declarations.h:82
ezStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition: StringView.h:18
The variant stores an ezVec2U32.
Definition: Variant.h:62
The variant stores an ezTransform. A heap allocation is required to store this data type...
Definition: Variant.h:68
The variant stores an ezInt8.
Definition: Variant.h:45
The variant stores a double.
Definition: Variant.h:54
The variant stores a string. A heap allocation is required to store this data type.
Definition: Variant.h:69
The variant stores an ezUuid value.
Definition: Variant.h:74
Quaternions can be used to represent rotations in 3D space.
Definition: Declarations.h:108
Definition: Variant.h:82
If there is an % operator which takes a TypeIsPod and returns a CompileTimeTrueType T is Pod...
Definition: TypeTraits.h:30
ezUInt64 ComputeHash(ezUInt64 uiSeed=0) const
Computes the hash value of the stored data. Returns uiSeed (unchanged) for an invalid Variant...
Definition: Variant.cpp:374
The variant stores an ezVec4.
Definition: Variant.h:58
The variant stores an ezVec2.
Definition: Variant.h:56
const T & Get() const
Returns the variants value as the provided type.
The variant stores an ezInt64.
Definition: Variant.h:51
The variant stores an ezInt16.
Definition: Variant.h:47
The variant stores a pointer to a dynamically reflected object.
Definition: Variant.h:84
The variant stores a float.
Definition: Variant.h:53
The variant stores an ezUInt8.
Definition: Variant.h:46
void * GetData()
Returns a void* to the internal data.
Definition: Variant_inl.h:271
The variant stores an ezVec3I32.
Definition: Variant.h:60
ezVariant is a class that can store different types of variables, which is useful in situations where...
Definition: Variant.h:28
The variant stores an ezTime value.
Definition: Variant.h:73
bool operator==(const ezVariant &other) const
Will compare the value of this variant to that of other.
Definition: Variant.cpp:228
Float wrapper struct for a safe usage and conversions of angles.
Definition: Angle.h:8
The variant stores no (valid) data at the moment.
Definition: Variant.h:40
The variant stores an ezQuat.
Definition: Variant.h:65
ezVariant()
Initializes the variant to be &#39;Invalid&#39;.
Definition: Variant_inl.h:2
~ezVariant()
If necessary, this will deallocate any heap memory that is not in use any more.
Definition: Variant_inl.h:173
The variant stores an ezUInt16.
Definition: Variant.h:48
bool IsValid() const
Returns whether this variant stores any other type than &#39;Invalid&#39;.
Definition: Variant_inl.h:238
A 8bit per channel unsigned normalized (values interpreted as 0-1) color storage format that represen...
Definition: Color8UNorm.h:69
Default enum for returning failure or success, instead of using a bool.
Definition: Types.h:51
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
The variant stores an ezInt32.
Definition: Variant.h:49
bool CanConvertTo() const
Returns whether the stored type can generally be converted to the desired type.
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition: Uuid.h:10