Deserializer Class Reference

#include <Pt/Deserializer.h>

Deserializes a set of types.

Inherits NonCopyable.

Inherited by XmlDeserializer.

Public Member Functions

 Deserializer ()
 Default constructor.
 
virtual ~Deserializer ()
 Destructor.
 
bool advance ()
 Advances parsing of an object. More...
 
template<typename T >
void begin (T &t)
 Starts parsing of an object. More...
 
void clear ()
 Clears all content.
 
SerializationContextcontext ()
 Returns the used context.
 
void finish ()
 Finishes parsing of an object. More...
 
void fixup ()
 Fixes up references. More...
 
Formatterformatter ()
 Returns the used formatter to use.
 
void reset (SerializationContext *context)
 Clears and resets the context.
 
void setFormatter (Formatter &formatter)
 Sets the formatter.
 

Member Function Documentation

void begin ( T &  t)

This method will begin to parse the object t. The type t must be serializable. Parsing can be completed by calling advance() repeatedly, or by calling finish().

bool advance ( )

Returns true if the object passed to begin() could be parsed completely, otherwise false is returned. If false is returned, no further progress can be made, until more data becomes available. When parsing is complete, references can be fixed up by calling fixup().

void finish ( )

This method will finish parsing of the object started by begin(). After all objects have been parsed, references can be fixed up by calling fixup()

void fixup ( )

Weak references between the parsed objects can be fixed up calling this method. Fixup has to happen after all objects have been parsed so references can be forward and backward in the object stream.