C4 Engine
C4 Engine API Documentation

Structure::ValidateSubstructure

Defined in:  TSOpenDDL.h
Determines the validity of a substructure.
Prototype

virtual bool ValidateSubstructure(const DataDescription *dataDescription, const Structure *structure) const;

Parameters
dataDescription The data description object to which the structure belongs.
structure The substructure to validate.
Description
The ValidateSubstructure function is called for the Structure object representing the enclosing data structure each time a new substructure is created to determine whether the new substructure can legally be contained in the data of the Structure object. An overriding implementation should examine the structure specified by the structure parameter and return true if it can legally appear as a direct subnode of the Structure object for which the ValidateSubstructure function is called. Otherwise, the function should return false.

An implementation would typically call the Structure::GetStructureType function to make its decision, but other information such as the base structure type or the primitive subarray size may also be taken into account. At the time that the ValidateSubstructure function is called, no data belonging to the structure is available, so the data itself cannot be used to validate any substructures.

The default implementation of the ValidateSubstructure function always returns true.
See Also

Structure::ValidateProperty

Structure::GetStructureType

Structure::GetBaseStructureType

PrimitiveStructure::GetArraySize

DataDescription::ValidateTopLevelStructure