StructureSerializer Class Reference


Detailed Description

Class handling the definition of the format for serialization of data structures.

The adsk::Data::Structure class manages structure definitions. They are persisted using a serialization format implemented through the adsk::Data::StructureSerializer hierarchy. The base class defines the interface and manages the list of available structure serialization formats.

#include <adskDataStructureSerializer.h>

Inheritance diagram for StructureSerializer:

List of all members.

Public Member Functions

 StructureSerializer ()
 Default constructor, does nothing.
virtual ~StructureSerializer ()
 Default destructor, does nothing.
virtual Structureread (std::istream &cSrc, std::string &errors) const =0
 Implement this to parse the serialized form of an adsk::Data::Structure object.
virtual int write (const Structure &dataToWrite, std::ostream &cDst) const =0
 Implement this to output the adsk::Data::Structure definition in your serialization format.
virtual void getFormatDescription (std::ostream &info) const =0
 Implement this to provide a description of your adsk::Data::Structure serialization format.

Member Function Documentation

Structure * read ( std::istream &  cSrc,
std::string &  errors 
) const [pure virtual]

Implement this to parse the serialized form of an adsk::Data::Structure object.

Given an input stream containing your serialization of an adsk::Data::Structure parse the data and create the adsk::Data::Structure it describes.

If there are any problems the detailed error information should be returned in the errors string.

Parameters:
[in]cSrcStream containing the serialization of the structure
[out]errorsString containing description of parse errors
Returns:
Newly created structure, NULL if creation failed

Implemented in StructureSerializerDebug.

int write ( const Structure dataToWrite,
std::ostream &  cDst 
) const [pure virtual]

Implement this to output the adsk::Data::Structure definition in your serialization format.

Given an adsk::Data::Structure object and an output stream as destination write out enough information so that you can recreate the adsk::Data::Structure from data in the output stream using your adsk::Data::StructureSerializer::read() method.

Parameters:
[in]dataToWriteadsk::Data::Structure to be serialized
[out]cDststream to which the object is to be serialized
Returns:
number of errors found during write, 0 means success

Implemented in StructureSerializerDebug.

void getFormatDescription ( std::ostream &  info) const [pure virtual]

Implement this to provide a description of your adsk::Data::Structure serialization format.

Output a textual description of your serialization format into the given stream.

Parameters:
[out]infostream in which to output your serialization format description

Implemented in StructureSerializerDebug.


StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer
StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer StructureSerializer