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.
Deserializer | Defines the interface for deserialization. |
Functions | |
Begin | Deserializes an opening tag in the stream. |
End | Deserializes 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. |
Reference | References a Dynamic *. |
DeserializeTextChunk | Deserializes text in chunks. |
DeserializeData | Deserializes a block of data. |
DeserializeEnum | |
DeserializeProperty | Writes into the object using the Properties’ method. |
~Deserializer |
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.
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.
virtual bool DeserializeTextChunk( char * text, unsigned & max_bytes, bool & complete ) = 0
Deserializes text in chunks.
text | the output buffer, if text is 0 then up to max_bytes text will be read and discarded. |
max_bytes | in/out in: the maximum number of bytes to write to text, out: the number of bytes actually written. |
complete | set 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.
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.
virtual bool DeserializeProperty( void * object, const Property * prop ) = 0
Writes into the object using the Properties’ method.
Defines the interface for deserialization.
class ReflectExport( reflect ) Deserializer
Deserializes an opening tag in the stream.
virtual bool Begin( SerializationTag & , SerializationTag::TagType = SerializationTag::UnknownTag ) = 0
Deserializes an ending tag in the stream.
virtual bool End( SerializationTag & ) = 0
Reads a bool from the stream.
virtual bool Deserialize( bool & ) = 0
Reads an integral number.
virtual bool Deserialize( long & ) = 0
Reads a floating point number.
virtual bool Deserialize( double & ) = 0
Reads a Dynamic *, using a category.
virtual bool Deserialize( Dynamic *& object ) = 0
References a Dynamic *.
virtual bool Reference( Dynamic * object ) = 0
Deserializes text in chunks.
virtual bool DeserializeTextChunk( char * text, unsigned & max_bytes, bool & complete ) = 0
Deserializes a block of data.
virtual bool DeserializeData( void * data, unsigned nbytes ) = 0
virtual bool DeserializeEnum( int & value, const EnumType * clazz ) = 0
Writes into the object using the Properties’ method.
virtual bool DeserializeProperty( void * object, const Property * prop ) = 0
Properties represent data in a reflected type, and can be used to Serialize that data through a Reflector.
class ReflectExport( reflect ) Property : public Dynamic
virtual ~Deserializer()
Defines the interface for serialization.
class ReflectExport( reflect ) Serializer
This class represents the begin/end tags in a Serializer/Deserializer stream.
class ReflectExport( reflect ) SerializationTag