13template<
typename Struct,
typename Owner>
16 static_assert(!std::is_same_v<Struct, Owner>,
17 "`Struct` and `Owner` is not allowed to be the same type (for reducing the risk of "
18 "cyclic references and infinite recursion on initialization).");
21 TSdlStructArray(std::string valueName, std::vector<Struct> Owner::*
const valuePtr);
31 std::vector<const ISdlResource*>& out_resources)
const override;
35 void setValueVec(Owner& owner, std::vector<Struct> value)
const;
36 const std::vector<Struct>&
getValueVec(
const Owner& owner)
const;
60 std::string_view packetName,
64 static std::string getStructTypeName();
66 std::vector<Struct> 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
Definition TSdlStructArray.h:15
static Struct loadStruct(std::string_view packetName, const SdlInputContext &ctx)
Definition TSdlStructArray.ipp:220
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 TSdlStructArray.ipp:130
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 TSdlStructArray.ipp:113
void ownedValueToDefault(Owner &owner) const override
By default, default value of the array is empty.
Definition TSdlStructArray.ipp:38
TSdlStructArray(std::string valueName, std::vector< Struct > Owner::*const valuePtr)
Definition TSdlStructArray.ipp:23
const std::vector< Struct > & getValueVec(const Owner &owner) const
Definition TSdlStructArray.ipp:107
TSdlStructArray & niceToHave()
Definition TSdlStructArray.ipp:285
TSdlStructArray & required()
Definition TSdlStructArray.ipp:292
TSdlStructArray & optional()
Definition TSdlStructArray.ipp:278
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 TSdlStructArray.ipp:72
static std::vector< Struct > loadStructArray(const SdlInputClause &clause, const SdlInputContext &ctx)
Definition TSdlStructArray.ipp:175
TSdlStructArray & withImportance(EFieldImportance importance)
Definition TSdlStructArray.ipp:262
std::string valueToString(const Owner &owner) const override
Convert the value of the field to human-readable string.
Definition TSdlStructArray.ipp:45
TSdlStructArray & description(std::string descriptionStr)
Definition TSdlStructArray.ipp:270
void setValueVec(Owner &owner, std::vector< Struct > value) const
Definition TSdlStructArray.ipp:101
void ownedResources(const Owner &owner, std::vector< const ISdlResource * > &out_resources) const override
Get all SDL resources associated by owner.
Definition TSdlStructArray.ipp:55
The root for all renderer implementations.
Definition EEngineProject.h:6
EFieldImportance
Definition EFieldImportance.h:7