16 struct TextureHandleTuple;
48 rhs.needsDeref =
false;
57 this->
size = rhs.size;
60 rhs.needsDeref =
false;
76 const void*
Get()
const
79 return this->needsDeref ? this->
mem :
reinterpret_cast<const void*
>(&this->
mem);
83 template <
typename T>
const T&
ConstGet()
const
85 return this->needsDeref ? *
reinterpret_cast<T*
>(this->
mem) :
reinterpret_cast<const T&
>(this->
mem);
89 template <
typename T> T&
Get()
91 return this->needsDeref ? *
reinterpret_cast<T*
>(this->
mem) :
reinterpret_cast<T&
>(this->
mem);
95 template <
typename T>
void Set(
const T& data,
void*
mem)
97 this->size =
sizeof(T);
99 this->needsDeref = this->size >
sizeof(
void*);
100 memcpy(this->needsDeref ? this->mem :
reinterpret_cast<void*
>(&this->mem), &data, this->size);
104 template <
typename T>
void Set(
void*
mem)
106 this->size =
sizeof(T);
108 this->needsDeref =
true;
Material special version of variant.
Definition material.cc:11
Compile time configuration options for the CoreGraphics subsystem.
Definition materialvariant.h:15
SizeT size
Definition materialvariant.h:73
void Set(const T &data, void *mem)
Set.
Definition materialvariant.h:95
const T & ConstGet() const
Const get.
Definition materialvariant.h:83
MaterialVariant()
Nullptr constructor.
Definition materialvariant.h:19
MaterialVariant(const MaterialVariant &rhs)
Copy constructor.
Definition materialvariant.h:26
void * mem
Definition materialvariant.h:72
void operator=(MaterialVariant &&rhs)
Move operator.
Definition materialvariant.h:53
MaterialVariant(MaterialVariant &&rhs)
Move constructor.
Definition materialvariant.h:42
bool needsDeref
Definition materialvariant.h:71
T & Get()
Mutable get.
Definition materialvariant.h:89
void operator=(const MaterialVariant &rhs)
Assign operator.
Definition materialvariant.h:34
const void * Get() const
Get pointer.
Definition materialvariant.h:76
void Set(void *mem)
Set from raw memory.
Definition materialvariant.h:104
MaterialVariant(std::nullptr_t)
Nullptr constructor.
Definition materialvariant.h:65
int SizeT
Definition types.h:49