|
template<typename ValueType > |
| TSdlVector4 (std::string valueName, ValueType Owner::*const valuePtr) |
| Bind a Vector4 field to SDL.
|
|
std::string | valueAsString (const math::TVector4< Element > &vec4) const override |
|
SdlNativeData | ownedNativeData (Owner &owner) const override |
| Direct access to the field memory of an owner. Short-lived owner objects such as function parameter structs must be kept alive during during this call and any further usages of the returned native data.
|
|
| TSdlValue (std::string typeName, std::string valueName, T Owner::*valuePtr) |
|
| TSdlValue (std::string typeName, std::string valueName, std::string typeSignature, T Owner::*valuePtr) |
|
std::string | valueAsString (const T &value) const override=0 |
| Human-readable representation of the value.
|
|
void | setValue (Owner &owner, T value) const override |
| Store a value.
|
|
T * | getValue (Owner &owner) const override |
| Get a pointer to the stored value.
|
|
const T * | getConstValue (const Owner &owner) const override |
| Get a pointer to the stored value.
|
|
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, we are able to define default value on a per owner type basis.
|
|
const T * | getDefaultValue () const |
|
TSdlValue & | defaultTo (T defaultValue) |
|
TSdlValue & | noDefault () |
|
TSdlValue & | withImportance (EFieldImportance importance) |
|
TSdlValue & | description (std::string descriptionStr) |
|
TSdlValue & | optional () |
|
TSdlValue & | niceToHave () |
|
TSdlValue & | required () |
|
TSdlValue & | enableFallback (bool isFallbackEnabled) |
|
| TSdlAbstractValue (std::string typeName, std::string valueName) |
|
| TSdlAbstractValue (std::string typeName, std::string valueName, std::string typeSignature) |
|
std::string | valueToString (const Owner &owner) const override |
| Convert the value of the field to human-readable string.
|
|
void | ownedResources (const Owner &owner, std::vector< const ISdlResource * > &out_resources) const override |
| Get all SDL resources associated by owner .
|
|
| TSdlOwnedField (std::string typeName, std::string valueName) |
|
| TSdlOwnedField (std::string typeName, std::string valueName, std::string typeSignature) |
|
SdlNativeData | nativeData (SdlNonConstInstance instance) const override |
| Direct access to the field memory of a SDL instance. Note that this field may not necessarily be bound to a SDL resource type (e.g., may bound to any function parameter structs). Empty native data info will be returned in cases where this field is not owned by (or being part of) the input instance. Obtaining native data requires the input instance be valid during this call and any further usages of the returned native data.
|
|
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 policy. In addition, failed loading attempt may be recovered if needed.
|
|
void | toSdl (const Owner &owner, SdlOutputClause &out_clause, const SdlOutputContext &ctx) const |
|
| SdlField (std::string typeName, std::string fieldName) |
|
| SdlField (std::string typeName, std::string fieldName, std::string typeSignature) |
|
virtual | ~SdlField () |
|
std::string | genPrettyName () const |
|
std::string_view | getTypeName () const |
|
std::string_view | getFieldName () const |
|
std::string_view | getDescription () const |
|
std::string_view | getTypeSignature () const |
|
EFieldImportance | getImportance () const |
|
bool | isFallbackEnabled () const |
| Whether the field want to use built-in mechanism to handle I/O problems. An example of this is default field value. With fallback enabled, the field may set itself to the default value supplied (if available) on error. By default, fallback is enabled.
|
|
|
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 encouraged to throw SdlLoadError if the loading process is not successful. This will allow things such as automatic fallback to work according to field policies.
|
|
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 loaded value has been properly handled by the loading process already. In case of failure, throw SdlSaveError and provide detailed reason describing the event.
|
|
T & | valueRef (Owner &owner) const |
|
SdlField & | setDescription (std::string descriptionStr) |
|
SdlField & | setImportance (EFieldImportance importance) |
| Sets the importance of the field. Different importance affect the underlying policy used during the import and export of the field, e.g., whether warnings are emitted.
|
|
SdlField & | setEnableFallback (bool isFallbackEnabled) |
|
template<typename Owner , typename Element = real, typename SdlValueType = TSdlValue<math::TVector4<Element>, Owner>>
|
inlineoverrideprotectedvirtual |
Convert actual value back to SDL value. Saving a loaded value as SDL value should rarely fail–as loaded value has been properly handled by the loading process already. In case of failure, throw SdlSaveError and provide detailed reason describing the event.
- Parameters
-
owner | Instance that owns the field. |
out_clause | The SDL representation for the actual value. |
ctx | The context for saving. |
Implements ph::TSdlValue< T, Owner >.