Serializer

class ReflectExport(reflect) Serializer

Defines the interface for serialization.

Summary
SerializerDefines the interface for serialization.
Functions
BeginStarts a group, annotated by the tag’s type and text.
EndEnds a group started by the tag with Begin.
Serialize(bool)Emits a bool.
Serialize(long)Emits an integer.
Serialize(unsigned long)Emits an integer, maybe in hex.
Serialize(double)Emits a float/double.
Serialize(const Dynamic *)The object is serialized using its <Category> (see <Category.SerializeDynamic>), or, if the object has been <Reference>d, then the serializer should emit a backreference instead.
ReferenceAdds the object to the list of objects known to this serializer.
SerializeTextEmits a string.
SerializeTextEmits arbitrary data.
SerializeEnumEmits an enum value or string.
SerializeProperty
~Serializer

Functions

Begin

virtual bool Begin(const SerializationTag &) = 0

Starts a group, annotated by the tag’s type and text.  If Begin returns true, then it is the callers responsibility to call End with the same reference later.

End

virtual bool End(const SerializationTag &) = 0

Ends a group started by the tag with Begin.

Serialize(bool)

virtual bool Serialize(bool) = 0

Emits a bool.

Serialize(long)

virtual bool Serialize(long) = 0

Emits an integer.

Serialize(unsigned long)

virtual bool Serialize(unsigned long) = 0

Emits an integer, maybe in hex.

Serialize(double)

virtual bool Serialize(double) = 0

Emits a float/double.

Serialize(const Dynamic *)

virtual bool Serialize(const Dynamic *object) = 0

The object is serialized using its <Category> (see <Category.SerializeDynamic>), or, if the object has been <Reference>d, then the serializer should emit a backreference instead.

Shallow serialization could emit the pointer value (as an integer) for immediate deserialization.

Reference

virtual bool Reference(const Dynamic *object) = 0

Adds the object to the list of objects known to this serializer.

Reference should be called in the Class.SerializePointer method for classes that construct new, unshared, objects when deserializing (as opposed to flyweights like Type pointers).

See Also

SerializeText

virtual bool SerializeText(const char *text,
unsigned nbytes) = 0

Emits a string.

SerializeText

Emits arbitrary data.

SerializeEnum

virtual bool SerializeEnum(int value,
const EnumType *type) = 0

Emits an enum value or string.

SerializeProperty

virtual bool SerializeProperty(const void *object,
const Property *prop) = 0

~Serializer

virtual ~Serializer()
class ReflectExport(reflect) Serializer
Defines the interface for serialization.
virtual bool Begin(const SerializationTag &) = 0
Starts a group, annotated by the tag’s type and text.
virtual bool End(const SerializationTag &) = 0
Ends a group started by the tag with Begin.
virtual bool Serialize(bool) = 0
Emits a bool.
virtual bool Serialize(long) = 0
Emits an integer.
virtual bool Serialize(unsigned long) = 0
Emits an integer, maybe in hex.
virtual bool Serialize(double) = 0
Emits a float/double.
virtual bool Serialize(const Dynamic *object) = 0
The object is serialized using its Category (see <Category.SerializeDynamic>), or, if the object has been <Reference>d, then the serializer should emit a backreference instead.
virtual bool Reference(const Dynamic *object) = 0
Adds the object to the list of objects known to this serializer.
virtual bool SerializeText(const char *text,
unsigned nbytes) = 0
Emits a string.
virtual bool SerializeEnum(int value,
const EnumType *type) = 0
Emits an enum value or string.
virtual bool SerializeProperty(const void *object,
const Property *prop) = 0
virtual ~Serializer()
virtual void SerializePointer(const Dynamic *in,
Reflector &reflector) const
class ReflectExport(reflect) Type : public Dynamic
virtual bool Reference(Dynamic *object) = 0
References a Dynamic *.
Close