- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# StructureSerializer Class Reference

Search for all occurrences

## 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:
[legend]

List of all members.

## Public Member Functions
| StructureSerializer ()
| Default constructor, does nothing.
virtual | ~StructureSerializer ()
| Default destructor, does nothing.
virtual Structure * | read (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]`

Search for all occurrences

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] | cSrc | Stream containing the serialization of the structure
  [out] | errors | String 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]`

Search for all occurrences

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] | dataToWrite | adsk::Data::Structure to be serialized
  [out] | cDst | stream 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]`

Search for all occurrences

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] | info | stream 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