10#include <Common/assertion.h>
26template<
typename Owner,
bool IS_SRI = true,
typename SdlValueType = TSdlValue<ResourceIdentifier, Owner>>
29 static_assert(std::is_base_of_v<TSdlAbstractValue<ResourceIdentifier, Owner>, SdlValueType>,
30 "SdlValueType should be a subclass of TSdlAbstractValue.");
33 template<
typename ValueType>
35 SdlValueType(
"PRI",
std::move(valueName), valuePtr)
68 throw_formatted<SdlLoadError>(
69 "failed loading SRI -> cannot resolve {}", sri.
getIdentifier());
105 "failed saving SRI -> no valid information provided");
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
bool isEmpty() const
Definition Path.h:165
An general identifier that points to some resource. This is the most general form of a resource ident...
Definition ResourceIdentifier.h:20
const std::string & getIdentifier() const
Definition ResourceIdentifier.cpp:55
Path getPath() const
Definition ResourceIdentifier.cpp:60
std::string toString() const
Definition ResourceIdentifier.cpp:79
bool resolve(IResourceIdentifierResolver &resolver)
Work out the resource the identifier points to.
Definition ResourceIdentifier.cpp:19
bool hasIdentifier() const
Whether there is an identifier. An identifier may not exist in the following situations:
Definition ResourceIdentifier.cpp:50
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
Definition SdlNativeData.h:88
static SdlNativeData fromSingleElement(ElementType *elementPtr, ESdlDataFormat elementContainer, ESdlDataType elementType, bool canSet=false, bool canDirectAccess=false)
Creates native data for a single element pointer.
Definition SdlNativeData.ipp:86
Carries SDL representation of various data during the output process. Helps to write output data such...
Definition SdlOutputClause.h:14
std::string value
Stores stringified data of a clause. As the output clause generator knows best how its data look like...
Definition SdlOutputClause.h:29
Data that SDL output process can rely on.
Definition SdlOutputContext.h:19
Definition SdlResourceLocator.h:25
ResourceIdentifier toExternalIdentifier(const Path &path) const
Get an identifier representing the path.
Definition SdlResourceLocator.cpp:160
Error on the SDL output process.
Definition sdl_exceptions.h:30
A field class that binds a resource identifier member. Though the member type that is binded by defau...
Definition TSdlResourceIdentifier.h:28
std::string valueAsString(const ResourceIdentifier &pri) const override
Definition TSdlResourceIdentifier.h:38
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 TSdlResourceIdentifier.h:43
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 TSdlResourceIdentifier.h:51
TSdlResourceIdentifier(std::string valueName, ValueType Owner::*const valuePtr)
Definition TSdlResourceIdentifier.h:34
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 TSdlResourceIdentifier.h:80
void setValue(Owner &owner, T value) const override
Store a value.
Definition TSdlValue.ipp:38
const T * getConstValue(const Owner &owner) const override
Get a pointer to the stored value.
Definition TSdlValue.ipp:50
T * getValue(Owner &owner) const override
Get a pointer to the stored value.
Definition TSdlValue.ipp:44
The root for all renderer implementations.
Definition EEngineProject.h:6
Low-level helpers for SDL. Helpers are in an additional sdl namespace.