tsc_DatabaseCustomXml

Available in SC version 2.10 and higher.

This class is used to return a custom record that has been located in the database.  It represents a custom sub-record that has been attached to some existing entity such as a line or point. This class may be used to populate a type subclass from the record's XML data.

Also see tsc_CustomRecordArray, a class which holds an array of custom xml sub-records, which are tsc_DatabaseCustomXml instances.

An introduction to the subject of custom data can be found on the page Adding custom data to the job database.

Public constructors

tsc_DatabaseCustomXml ();
The default constructor creates an empty instance.

tsc_DatabaseCustomXml (const class tsc_DatabaseCustomXml& from);
The copy constructor makes a reference to the original object.

Public methods

bool IsType (tsc_DatabaseCustomType& type);
Tests if the custom record is of the same type as type. The comparison is by name and GUID.  Types with the same name and GUID but different versions are considered equal. It is irrelevant what else type contains (such as data variables); only its Type() and Guid() methods are called.

void Read (tsc_DatabaseCustomType& type);
Reads the XML of the record from the database and passes it to the type's DeSerialize method. The original type (including the version of the type used to write the record) is also passed to DeSerialize. After the Read has completed, the supplied type should have been updated with the record's contents, although what actually occurs is dependent on the overridden DeSerialize method.

int RecordId ();
Returns the record ID for the record.  For entity sub-records, this ID may be used to replace or remove the sub-record from the entity.

Warning: Avoid storing the record ID persistently, since the user's database may be converted to XML and back again in various situations, such as a General Survey version upgrade.  In almost every case, the ID of the records in the database will change, rendering any stored record IDs useless.  The ID will remain valid while the job is open.

tsc_Entity Parent ();
Returns the entity to which this sub-record is attached.