5#include <Common/assertion.h>
23template<
typename T,
typename Owner>
29 std::string valueName,
34 std::string valueName,
35 std::string typeSignature,
41 void setValue(Owner& owner, T value)
const override;
42 T*
getValue(Owner& owner)
const override;
71 T Owner::* m_valuePtr;
72 std::optional<T> m_defaultValue;
bool isFallbackEnabled() const
Whether the field want to use built-in mechanism to handle I/O problems. An example of this is defaul...
Definition SdlField.h:99
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
Definition SdlNativeData.h:88
Carries SDL representation of various data during the output process. Helps to write output data such...
Definition SdlOutputClause.h:14
Data that SDL output process can rely on.
Definition SdlOutputContext.h:19
General concept of a SDL value type.
Definition TSdlAbstractValue.h:17
Abstractions for a SDL value type.
Definition TSdlValue.h:25
void loadFromSdl(Owner &owner, const SdlInputClause &clause, const SdlInputContext &ctx) const override=0
Load SDL value to actual value and store it in the owner's field. Implementations are highly encourag...
void setValue(Owner &owner, T value) const override
Store a value.
Definition TSdlValue.ipp:38
TSdlValue & description(std::string descriptionStr)
Definition TSdlValue.ipp:95
const T * getConstValue(const Owner &owner) const override
Get a pointer to the stored value.
Definition TSdlValue.ipp:50
std::string valueAsString(const T &value) const override=0
Human-readable representation of the value.
TSdlValue(std::string typeName, std::string valueName, T Owner::*valuePtr)
Definition TSdlValue.ipp:11
const T * getDefaultValue() const
Definition TSdlValue.ipp:65
T * getValue(Owner &owner) const override
Get a pointer to the stored value.
Definition TSdlValue.ipp:44
TSdlValue & optional()
Definition TSdlValue.ipp:103
TSdlValue & defaultTo(T defaultValue)
Definition TSdlValue.ipp:71
T & valueRef(Owner &owner) const
Definition TSdlValue.ipp:132
void saveToSdl(const Owner &owner, SdlOutputClause &out_clause, const SdlOutputContext &ctx) const override=0
Convert actual value back to SDL value. Saving a loaded value as SDL value should rarely fail–as load...
TSdlValue & noDefault()
Definition TSdlValue.ipp:79
TSdlValue & enableFallback(bool isFallbackEnabled)
Definition TSdlValue.ipp:124
TSdlValue & withImportance(EFieldImportance importance)
Definition TSdlValue.ipp:87
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 TSdlValue.ipp:56
SdlNativeData ownedNativeData(Owner &owner) const override=0
Direct access to the field memory of an owner. Short-lived owner objects such as function parameter s...
TSdlValue & required()
Definition TSdlValue.ipp:117
TSdlValue & niceToHave()
Definition TSdlValue.ipp:110
The root for all renderer implementations.
Definition EEngineProject.h:6
EFieldImportance
Definition EFieldImportance.h:7