10 template<
typename T,
typename>
13 using DecayT = std::decay_t<T>;
15 if constexpr (std::is_base_of_v<Data, DecayT>)
18 as_object =
new DecayT(std::forward<T>(v));
28 using DecayT = std::decay_t<T>;
30 if constexpr (std::is_same_v<DecayT, bool>) {
32 }
else if constexpr (std::is_same_v<DecayT, int>) {
34 }
else if constexpr (std::is_same_v<DecayT, float>) {
36 }
else if constexpr (std::is_same_v<DecayT, double>) {
38 }
else if constexpr (std::is_base_of_v<Data, DecayT>) {
39 return _type ==
DATA ?
dynamic_cast<DecayT*
>(
as_object) :
nullptr;
41 if (_type !=
DATA)
return nullptr;
44 return &value_wrapper->get();
53 using DecayT = std::decay_t<T>;
55 if constexpr (std::is_same_v<DecayT, bool>) {
57 }
else if constexpr (std::is_same_v<DecayT, int>) {
59 }
else if constexpr (std::is_same_v<DecayT, float>) {
61 }
else if constexpr (std::is_same_v<DecayT, double>) {
63 }
else if constexpr (std::is_base_of_v<Data, DecayT>) {
64 return _type ==
DATA ?
dynamic_cast<const DecayT*
>(
as_object) :
nullptr;
66 if (_type !=
DATA)
return nullptr;
69 return &value_wrapper->get();
int as_int
Definition PropertyValue.hpp:30
@ DOUBLE
Definition PropertyValue.hpp:21
@ BOOL
Definition PropertyValue.hpp:18
@ FLOAT
Definition PropertyValue.hpp:20
@ DATA
Definition PropertyValue.hpp:22
@ INT
Definition PropertyValue.hpp:19
bool as_bool
Definition PropertyValue.hpp:29
float as_float
Definition PropertyValue.hpp:31
double as_double
Definition PropertyValue.hpp:32
Data * as_object
Definition PropertyValue.hpp:33
T * as()
Definition PropertyValue.inl:26
Template wrapper for primitive types to integrate with the Infinity type system.
Definition Value.hpp:89