#include <rtti/writer.h>
Public Member Functions | |
virtual bool | start (const ObjectList &rootObjects)=0 |
virtual bool | finish ()=0 |
virtual bool | startRootObject (const rtti::TypeInfo &type)=0 |
virtual bool | finishRootObject ()=0 |
virtual bool | startCompound (const rtti::TypeInfo &type)=0 |
virtual bool | finishCompound ()=0 |
virtual bool | startArray (int length)=0 |
virtual bool | finishArray ()=0 |
virtual bool | writeProperty (const std::string &propertyName)=0 |
virtual bool | writePointer (const std::string &pointeeID)=0 |
virtual bool | writePrimitive (const rtti::TypeInfo &type, const rtti::Variant &value)=0 |
virtual bool | supportsEmbeddedPointers () const =0 |
This is the interface used by serializeObjects to serialize RTTI objects. Having this interface allows the object hierarchy traversal logic to remain separate from the actual writing logic. This in turn means that the same interface (serializeObjects) can be used to write to a variety of formats (JSON, binary, BSON, etc).
|
pure virtual |
Called when serialization is finished, after everything has been written (i.e. end of 'document')
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called when an array has been completely written
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called when a compound has been completely written
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called when a root object has been completely written
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called when serialization starts, but before any objects have been written (i.e. start of 'document')
rootObjects | The list of root objects that will be written to the writer |
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called when an array of the specified length is about to be written. Note that the elements are written in a separate call (writePointer or writePrimitive)
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called when a compound (i.e. struct nested inside a root object) of the specified type is about to be written
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called when a root object of the specified type is about to be written
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called to determine if this writer supports writing pointers nested in the object pointing to them (embedded pointers)
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called to write a pointer to an object with the specified ID
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called to write a primitive type with the specified value
Implemented in JSONWriter, and BinaryWriter.
|
pure virtual |
Called to write a property of the specified name. Note that the value for the property is written in a separate call (writePointer or writePrimitive)
Implemented in JSONWriter, and BinaryWriter.