13#include <Common/assertion.h>
20template<
typename Owner>
23 std::string valueName)
30template<
typename Owner>
33 std::string valueName,
34 std::string typeSignature)
39 std::move(typeSignature))
42template<
typename Owner>
47 Owner*
const owner = instance.
get<Owner>();
54 return ownedNativeData(*owner);
56 catch(
const SdlException& )
63template<
typename Owner>
71 loadFromSdl(owner, clause, ctx);
75 if(isFallbackEnabled())
77 ownedValueToDefault(owner);
83 PH_LOG(
SdlField, Warning,
"load error from {} -> {}; value defaults to {}",
86 valueToString(owner));
94 " -> " + e.whatStr() +
"; " +
95 "value left uninitialized");
100template<
typename Owner>
108 saveToSdl(owner, out_clause, ctx);
116 " -> " + e.whatStr());
General exception thrown on error related to SDL.
Definition sdl_exceptions.h:13
const SdlClass * getSrcClass() const
The SDL class that is involved in the I/O process.
Definition SdlIOContext.h:90
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
Error on the SDL input process.
Definition sdl_exceptions.h:22
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
Error on the SDL output process.
Definition sdl_exceptions.h:30
References a SDL object. This is a lightweight utility for referencing SDL objects....
Definition TSdlAnyInstance.h:20
auto * get() const
Definition TSdlAnyInstance.ipp:82
void toSdl(const Owner &owner, SdlOutputClause &out_clause, const SdlOutputContext &ctx) const
Definition TSdlOwnedField.ipp:101
void fromSdl(Owner &owner, const SdlInputClause &clause, const SdlInputContext &ctx) const
Acquire value and store in the owner's field. The loading process will follow a series of preset poli...
Definition TSdlOwnedField.ipp:64
TSdlOwnedField(std::string typeName, std::string valueName)
Definition TSdlOwnedField.ipp:21
SdlNativeData nativeData(SdlNonConstInstance instance) const override
Direct access to the field memory of a SDL instance. Note that this field may not necessarily be boun...
Definition TSdlOwnedField.ipp:43
std::string gen_pretty_name(const SdlClass *const clazz)
Generate a human-readable name for the SDL types. These helpers allow input types to be null.
Definition sdl_helpers.cpp:24
The root for all renderer implementations.
Definition EEngineProject.h:6
Low-level helpers for SDL. Helpers are in an additional sdl namespace.