19template<
typename T,
typename Owner>
23 TSdlReference(std::string valueName, std::shared_ptr<T> Owner::* valuePtr);
33 std::vector<const ISdlResource*>& out_resources)
const override;
37 void setValueRef(Owner& owner, std::shared_ptr<T> value)
const;
38 const std::shared_ptr<T>&
getValueRef(
const Owner& owner)
const;
46 template<
typename ResourceType = T>
51 template<
typename ResourceType = T>
53 std::string_view referenceName,
68 std::shared_ptr<T> Owner::* m_valuePtr;
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
Abstraction for a value that is owned by some owner type. Governs how a field should be initialized o...
Definition TSdlOwnedField.h:15
A value that points to a SDL resource.
Definition TSdlReference.h:21
TSdlReference & optional()
Definition TSdlReference.ipp:214
void ownedValueToDefault(Owner &owner) const override
By default, default value of a SDL reference is empty.
Definition TSdlReference.ipp:36
static std::shared_ptr< ResourceType > loadReference(const SdlInputClause &clause, const SdlInputContext &ctx)
Definition TSdlReference.ipp:155
void loadFromSdl(Owner &owner, const SdlInputClause &clause, const SdlInputContext &ctx) const override
Load SDL value to actual value and store it in the owner's field. Implementations are highly encourag...
Definition TSdlReference.ipp:96
TSdlReference & required()
Definition TSdlReference.ipp:228
SdlNativeData ownedNativeData(Owner &owner) const override
Direct access to the field memory of an owner. Short-lived owner objects such as function parameter s...
Definition TSdlReference.ipp:63
std::string valueToString(const Owner &owner) const override
Convert the value of the field to human-readable string.
Definition TSdlReference.ipp:43
const std::shared_ptr< T > & getValueRef(const Owner &owner) const
Definition TSdlReference.ipp:90
TSdlReference(std::string valueName, std::shared_ptr< T > Owner::*valuePtr)
Definition TSdlReference.ipp:19
TSdlReference & description(std::string descriptionStr)
Definition TSdlReference.ipp:206
TSdlReference & niceToHave()
Definition TSdlReference.ipp:221
TSdlReference & withImportance(EFieldImportance importance)
Definition TSdlReference.ipp:198
void ownedResources(const Owner &owner, std::vector< const ISdlResource * > &out_resources) const override
Get all SDL resources associated by owner.
Definition TSdlReference.ipp:51
void setValueRef(Owner &owner, std::shared_ptr< T > value) const
Definition TSdlReference.ipp:84
void saveToSdl(const Owner &owner, SdlOutputClause &out_clause, const SdlOutputContext &ctx) const override
Convert actual value back to SDL value. Saving a loaded value as SDL value should rarely fail–as load...
Definition TSdlReference.ipp:113
The root for all renderer implementations.
Definition EEngineProject.h:6
EFieldImportance
Definition EFieldImportance.h:7