Tombstone Engine

Facebook Twitter YouTube IndieDB

Structure::ProcessData

Defined in:  TSOpenDDL.h
Performs custom processing of the structure data.
Prototype

virtual DataResult ProcessData(DataDescription *dataDescription);

Parameters
dataDescription The DataDescription object to which the structure belongs.
Description
The ProcessData function can be overridden by a subclass to perform any custom processing of the data contained in a structure. This function is called for all direct subnodes of the root structure of a data file when the DataDescription::ProcessText function is called. (These correspond to the top-level data structures in the file itself.) The implementation may examine the structure's subtree and take whatever action is appropriate to process the data.

The dataDescription parameter points to the DataDescription object to which the structure belongs. An implementation of the ProcessData function may call the DataDescription::FindStructure function to find referenced structures.

If no error occurs, then the ProcessData function should return kDataOkay. Otherwise, an error code should be returned. An implementation may return a custom error code or one of the following standard error codes.
kDataMissingSubstructure A structure is missing a substructure of a required type.
kDataExtraneousSubstructure A structure contains too many substructures of a legal type.
kDataInvalidDataFormat The primitive data contained in a structure uses an invalid format (type or subarray size).
kDataBrokenRef The target of a reference does not exist.
The default implementation calls the ProcessData function for each of the direct subnodes of a data structure. If an error is returned by any of these calls, then this function stops iterating through its subnodes and returns the error code immediately.

An overriding implementation of the ProcessData function is not required to call the base class implementation, but if it does, it must pass the value of the dataDescription parameter through to the base class.
See Also

DataDescription::ProcessText