10template<
typename T,
typename Owner>
13 std::string valueName,
14 std::optional<T> Owner::* valuePtr)
19template<
typename T,
typename Owner>
22 std::string valueName,
23 std::string typeSignature,
24 std::optional<T> Owner::* valuePtr)
29 std::move(typeSignature))
31 , m_valuePtr(valuePtr)
33 PH_ASSERT(m_valuePtr);
38template<
typename T,
typename Owner>
42 this->setDescription(std::move(descriptionStr));
46template<
typename T,
typename Owner>
49 owner.*m_valuePtr = std::move(value);
52template<
typename T,
typename Owner>
55 std::optional<T>& optValue = owner.*m_valuePtr;
56 return optValue.has_value() ? &optValue.value() :
nullptr;
59template<
typename T,
typename Owner>
62 const std::optional<T>& optValue = owner.*m_valuePtr;
63 return optValue.has_value() ? &optValue.value() :
nullptr;
66template<
typename T,
typename Owner>
69 owner.*m_valuePtr = std::nullopt;
72template<
typename T,
typename Owner>
75 return owner.*m_valuePtr;
SdlField & setImportance(EFieldImportance importance)
Sets the importance of the field. Different importance affect the underlying policy used during the i...
Definition SdlField.h:111
General concept of a SDL value type.
Definition TSdlAbstractValue.h:17
Abstractions for a SDL value type that can be empty.
Definition TSdlOptionalValue.h:22
TSdlOptionalValue(std::string typeName, std::string valueName, std::optional< T > Owner::*valuePtr)
Definition TSdlOptionalValue.ipp:11
void ownedValueToDefault(Owner &owner) const override
Set the value of the field to a default one. Since the field class is templatized by Owner type,...
Definition TSdlOptionalValue.ipp:67
std::optional< T > & valueRef(Owner &owner) const
Definition TSdlOptionalValue.ipp:73
TSdlOptionalValue & description(std::string descriptionStr)
Definition TSdlOptionalValue.ipp:39
void setValue(Owner &owner, T value) const override
Store a value.
Definition TSdlOptionalValue.ipp:47
T * getValue(Owner &owner) const override
Get a pointer to the stored value.
Definition TSdlOptionalValue.ipp:53
const T * getConstValue(const Owner &owner) const override
Get a pointer to the stored value.
Definition TSdlOptionalValue.ipp:60
The root for all renderer implementations.
Definition EEngineProject.h:6