Nameless Engine
|
#include <GlmVecFieldSerializer.h>
Public Member Functions | |
virtual bool | isFieldTypeSupported (const rfk::Field *pField) override |
virtual std::optional< Error > | serializeField (toml::value *pTomlData, Serializable *pFieldOwner, const rfk::Field *pField, const std::string &sSectionName, const std::string &sEntityId, size_t &iSubEntityId, Serializable *pOriginalObject=nullptr) override |
virtual std::optional< Error > | deserializeField (const toml::value *pTomlDocument, const toml::value *pTomlValue, Serializable *pFieldOwner, const rfk::Field *pField, const std::string &sOwnerSectionName, const std::string &sEntityId, std::unordered_map< std::string, std::string > &customAttributes) override |
virtual std::optional< Error > | cloneField (Serializable *pFromInstance, const rfk::Field *pFromField, Serializable *pToInstance, const rfk::Field *pToField) override |
virtual bool | isFieldValueEqual (Serializable *pFieldAOwner, const rfk::Field *pFieldA, Serializable *pFieldBOwner, const rfk::Field *pFieldB) override |
virtual bool | isFieldTypeSupported (const rfk::Field *pField)=0 |
virtual std::optional< Error > | serializeField (toml::value *pTomlData, Serializable *pFieldOwner, const rfk::Field *pField, const std::string &sSectionName, const std::string &sEntityId, size_t &iSubEntityId, Serializable *pOriginalObject=nullptr)=0 |
virtual std::optional< Error > | deserializeField (const toml::value *pTomlDocument, const toml::value *pTomlValue, Serializable *pFieldOwner, const rfk::Field *pField, const std::string &sOwnerSectionName, const std::string &sEntityId, std::unordered_map< std::string, std::string > &customAttributes)=0 |
virtual std::optional< Error > | cloneField (Serializable *pFromInstance, const rfk::Field *pFromField, Serializable *pToInstance, const rfk::Field *pToField)=0 |
virtual bool | isFieldValueEqual (Serializable *pFieldAOwner, const rfk::Field *pFieldA, Serializable *pFieldBOwner, const rfk::Field *pFieldB)=0 |
Static Private Attributes | |
static const std::string | sVec2CanonicalTypeName1 = "glm::vec<2, float>" |
static const std::string | sVec2CanonicalTypeName2 = "glm::vec<2, float, glm::packed_highp>" |
static const std::string | sVec3CanonicalTypeName1 = "glm::vec<3, float>" |
static const std::string | sVec3CanonicalTypeName2 = "glm::vec<3, float, glm::packed_highp>" |
static const std::string | sVec4CanonicalTypeName1 = "glm::vec<4, float>" |
static const std::string | sVec4CanonicalTypeName2 = "glm::vec<4, float, glm::packed_highp>" |
static const float | floatEpsilon = 0.00001f |
Serializer for glm::vec2
, glm::vec3
and glm::vec4
field types.
|
overridevirtual |
Clones field's data from one object to another.
pFromInstance | Instance to copy the field from. |
pFromField | Field to copy. |
pToInstance | Instance to copy to. |
pToField | Field to copy to. |
Implements ne::IFieldSerializer.
|
overridevirtual |
Deserializes field from a TOML value.
pTomlDocument | TOML document that contains a value to deserialize. |
pTomlValue | TOML value to deserialize the field from. |
pFieldOwner | Field's owner. |
pField | Field to deserialize TOML value to. |
sOwnerSectionName | Name of the TOML section where is field was found. |
sEntityId | Current ID string of the entity (field owner) that we are deserializing. |
customAttributes | Pairs of values that were found with this object in TOML data. Only found when deserializing a field of type that derives from Serializable. |
Implements ne::IFieldSerializer.
|
overridevirtual |
Tests if this serializer supports serialization/deserialization of this field.
pField | Field to test for serialization/deserialization support. |
true
if this serializer can be used to serialize this field, false
otherwise. Implements ne::IFieldSerializer.
|
overridevirtual |
Checks if the specified fields' values are equal or not.
pFieldAOwner | Owner of the field A. |
pFieldA | Field A to compare. |
pFieldBOwner | Owner of the field B. |
pFieldB | Field B to compare. |
false
if some field is unsupported by this serializer or if fields' values are not equal, true
otherwise. Implements ne::IFieldSerializer.
|
overridevirtual |
Serializes field into a TOML value.
pTomlData | TOML value to serialize the field to. |
pFieldOwner | Field's owner. |
pField | Field to serialize. |
sSectionName | Name of the section (for TOML value) to use for this field. |
sEntityId | Current ID string of the entity (field owner) that we are serializing. Only used when serializing a field of type that derives from Serializable. |
iSubEntityId | Current ID of the sub entity (sub entity of the field owner). Only used when serializing a field of type that derives from Serializable. |
pOriginalObject | Optional. Original object of the same type as the object being serialized, this object is a deserialized version of the object being serialized, used to compare serializable fields' values and only serialize changed values. Only used when serializing a field of type that derives from Serializable. |
Implements ne::IFieldSerializer.
|
inlinestaticprivate |
Delta used when comparing floats.
|
inlinestaticprivate |
Canonical type name for glm::vec2
fields. Variant 1.
|
inlinestaticprivate |
Canonical type name for glm::vec2
fields. Variant 2.
|
inlinestaticprivate |
Canonical type name for glm::vec3
fields. Variant 1.
|
inlinestaticprivate |
Canonical type name for glm::vec3
fields. Variant 2.
|
inlinestaticprivate |
Canonical type name for glm::vec4
fields. Variant 1.
|
inlinestaticprivate |
Canonical type name for glm::vec4
fields. Variant 2.