Serializable Class Reference

Converts data into formats that can be read from and saved to disk. More...

#include <Serializable.h>

Inheritance diagram for Serializable:

Inheritance graph

List of all members.

Public Member Functions

virtual bool toXml (XMLWriter *pXml) const =0
virtual bool fromXml (DOMNode *pDocument, unsigned int version)=0

Protected Member Functions

virtual ~Serializable ()


Detailed Description

Converts data into formats that can be read from and saved to disk.

Objects that can save/restore themselves from a file inherit this interface. Each class that ultimately derives from Serializable must implement an override of these interfaces, even if an intermediate parent already has an implementation.

The structure of the serialized output generally has the form of a string with the class name, followed by the data comprising the object plus any data in the object's inherited parent(s).

Definition at line 30 of file Serializable.h.


Constructor & Destructor Documentation

virtual Serializable::~Serializable (  )  [protected, virtual]

This should not be deleted directly.

It should be deleted according to the instructions provided for the relevant subclass.

Definition at line 74 of file Serializable.h.


Member Function Documentation

virtual bool Serializable::toXml ( XMLWriter pXml  )  const [pure virtual]

Converts the contents of this object to XML data.

Parameters:
pXml Pointer to an XMLWriter object in which the object's contents are written.
Exceptions:
XmlBase::XmlException This exception (or a subclass) is thrown if there is a problem serializing the object.
Returns:
Returns true if the object was successfully converted to XML data. Returns false if the object cannot be represented in XML format.

virtual bool Serializable::fromXml ( DOMNode *  pDocument,
unsigned int  version 
) [pure virtual]

Sets the contents of this object from given XML data.

Parameters:
pDocument The Xerces DOM node.
version This is the version of the XML which is being deserialized.
Exceptions:
XmlBase::XmlException This exception (or a subclass) is thrown if there is a problem deserializing the object.
Returns:
Returns true if the object's data values were successfully set from the given XML data. Returns false if the object cannot be represented in XML format.


Software Development Kit - Opticks 4.9.0 Build 16218