Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Object Class Reference
[Data classes]

Base class for all classes representing packable data objects. More...

#include <Object.h>

Inheritance diagram for Object:

Referenced BaseType List of all members.

Public Methods

 Object ()
virtual ~Object ()
virtual Object * _new () const
 Create a new instance of the class.

virtual void serialize (Archive &archive)
 Serialize an object to or from a data archive.

virtual std::string asString () const
 Get a string representation of the object.

virtual std::string typeString () const
 Return a string representation of the type.

hasht getPath () const
 Get the path hash from which the object was instantiated.

virtual void parseXML (const char *cdata)
 Parse cdata from within the XML tags for this object.

virtual void convertXML ()
 Convert XML data to internal format prior to serialization.


Static Public Methods

hasht _getHash (const char *c)
 Hash function for converting data archive paths to path hashes.


Protected Methods

virtual void postCreate ()
 Initialize an object after deserialization.


Friends

class DataArchive
class LinkBase

Detailed Description

Base class for all classes representing packable data objects.

Derived classes must include the SIMDATA_OBJECT(classname, major, minor) macro in their class definition and the SIMDATA_REGISTER(classname) macro in their implementation.

The following methods must be extended in derived classes:

Objects should never be copied or handled directly by user code. Use Ref<> handles to manipulate them by reference, and Link<> member variables to load them from data archives. Objects set as 'static' are singletons managed by the DataArchive.

Author:
Mark Rose <mrose@stm.lbl.gov>


Constructor & Destructor Documentation

Object::Object   [explicit]
 

Object::~Object   [virtual]
 


Member Function Documentation

hasht Object::_getHash const char *    c [static]
 

Hash function for converting data archive paths to path hashes.

virtual Object* Object::_new   const [inline, virtual]
 

Create a new instance of the class.

The method is automatically overridden by the SIMDATA_OBJECT macro, so you should never need to extend it manually.

std::string Object::asString   [virtual]
 

Get a string representation of the object.

This method is also used for writing to ostreams using operator<<().

Implements BaseType.

void BaseType::convertXML   [virtual, inherited]
 

Convert XML data to internal format prior to serialization.

This method is currently only called by the XML parser for Object classes. If another BaseType class requires this method, a call must be added to the appropriate XML handler in the parser.

hasht Object::getPath  
 

Get the path hash from which the object was instantiated.

Given the source DataArchive, this path hash can be converted back to a path string using getPathString().

void BaseType::parseXML const char *    cdata [virtual, inherited]
 

Parse cdata from within the XML tags for this object.

Reimplemented in SimDate, EnumLink, GeoPos, LLA, UTM, Matrix3, Quat, Real, and Vector3.

virtual void Object::postCreate   [inline, protected, virtual]
 

Initialize an object after deserialization.

Called after the newly created object has been deserialized.

Extend this method to do any initial processing of the external data.

NAMESPACE_SIMDATA void Object::serialize Archive   archive [virtual]
 

Serialize an object to or from a data archive.

Extend this method to serialize member variables to and from data archives. Call the base class method first, then apply the archive functor to each archived variable. Any additional processing of the data following retrieval should be done in the postCreate() method.

Reimplemented from BaseType.

virtual std::string Object::typeString   const [inline, virtual]
 

Return a string representation of the type.

The type string for classes derived from Object is just the classname. The implementation in Object returns the true classname using getClassName(), so this method should not be overridden in derived classes.

Implements BaseType.


Friends And Related Function Documentation

friend class DataArchive [friend]
 

friend class LinkBase [friend]
 


The documentation for this class was generated from the following files:
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage.

Generated on Tue Oct 14 12:06:41 2003, using Doxygen 1.2.18.

[SF.net]