Deserializer

class ReflectExport(reflect) Deserializer

Defines the interface for deserialization.

Serialization and Deserialization convert between hierarchical, structured and tagged data and a linear stream of data.

See Also

Summary
DeserializerDefines the interface for deserialization.
Functions
BeginDeserializes an opening tag in the stream.
EndDeserializes an ending tag in the stream.
Deserialize(bool &)Reads a bool from the stream.
Deserialize(long &)Reads an integral number.
Deserialize(long &)Reads an unsigned integral number.
Deserialize(double &)Reads a floating point number.
Deserialize(Dynamic *&)Reads a Dynamic *, using a category.
ReferenceReferences a Dynamic *.
DeserializeTextChunkDeserializes text in chunks.
DeserializeDataDeserializes a block of data.
DeserializeEnum
DeserializePropertyWrites into the object using the Properties’ method.
~Deserializer

Functions

Begin

virtual bool Begin(SerializationTag &,  
 SerializationTag::TagType =  SerializationTag::UnknownTag) = 0

Deserializes an opening tag in the stream.  If it succeeds, End must be called to end the tag with the same SerializationTag object.

End

virtual bool End(SerializationTag &) = 0

Deserializes an ending tag in the stream.  Properly tagged streams can handle this method prematurely, skipping over any excess data until the end is reached.

Deserialize(bool &)

virtual bool Deserialize(bool &) = 0

Reads a bool from the stream.

Deserialize(long &)

virtual bool Deserialize(long &) = 0

Reads an integral number.

Deserialize(long &)

virtual bool Deserialize(unsigned long &) = 0

Reads an unsigned integral number.

Deserialize(double &)

virtual bool Deserialize(double &) = 0

Reads a floating point number.

Deserialize(Dynamic *&)

virtual bool Deserialize(Dynamic *&object) = 0

Reads a Dynamic *, using a category.

Reference

virtual bool Reference(Dynamic *object) = 0

References a Dynamic *.  The pattern of referencing must match the pattern durring serialization.

The reason that Reference is not implemented in <Serialize> is that when deserializing a pointer which contains (or references) a pointer to itself, it must have been Referenced to deserialize correctly.

See

  • <PersistentClass.DeserializePointer>

DeserializeTextChunk

virtual bool DeserializeTextChunk(char *text,
unsigned &max_bytes,
bool &complete) = 0

Deserializes text in chunks.

Parameters

textthe output buffer, if text is 0 then up to max_bytes text will be read and discarded.
max_bytesin/out in: the maximum number of bytes to write to text, out: the number of bytes actually written.
completeset to true when the end of the text is reached.

Once a text chunk read is started, clients must keep calling deserialize text chunk until complete is true.

DeserializeData

virtual bool DeserializeData(void *data,
unsigned nbytes) = 0

Deserializes a block of data.  The size of the data must be the same as what was written.  There is no requirement for the deserializer to validate that it is the correct size.  It is format specific whether serialized binary data concatenates/splits gracefully.

DeserializeEnum

virtual bool DeserializeEnum(int &value,
const EnumType *clazz) = 0

DeserializeProperty

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

Writes into the object using the Properties’ method.

~Deserializer

virtual ~Deserializer()
class ReflectExport(reflect) Deserializer
Defines the interface for deserialization.
virtual bool Begin(SerializationTag &,  
 SerializationTag::TagType =  SerializationTag::UnknownTag) = 0
Deserializes an opening tag in the stream.
virtual bool End(SerializationTag &) = 0
Deserializes an ending tag in the stream.
virtual bool Deserialize(bool &) = 0
Reads a bool from the stream.
virtual bool Deserialize(long &) = 0
Reads an integral number.
virtual bool Deserialize(double &) = 0
Reads a floating point number.
virtual bool Deserialize(Dynamic *&object) = 0
Reads a Dynamic *, using a category.
virtual bool Reference(Dynamic *object) = 0
References a Dynamic *.
virtual bool DeserializeTextChunk(char *text,
unsigned &max_bytes,
bool &complete) = 0
Deserializes text in chunks.
virtual bool DeserializeData(void *data,
unsigned nbytes) = 0
Deserializes a block of data.
virtual bool DeserializeEnum(int &value,
const EnumType *clazz) = 0
virtual bool DeserializeProperty(void *object,
const Property *prop) = 0
Writes into the object using the Properties’ method.
class ReflectExport(reflect) Property : public Dynamic
Properties represent data in a reflected type, and can be used to Serialize that data through a Reflector.
virtual ~Deserializer()
class ReflectExport(reflect) Serializer
Defines the interface for serialization.
class ReflectExport(reflect) SerializationTag
This class represents the begin/end tags in a Serializer/Deserializer stream.
Close