Extensions.DataType.Structure

From emotive
Jump to navigation Jump to search

Classification

Name Structure
Short Description User-defined structure
Class Complex Data Type
Base Data Type ComplexType
Default Value Empty
Provide a Literal No
SpecifiedBy ISO 13209-3
Standard Compliant Yes

Description

A structure is a user-defined data type composed of elements that can have different data types. It is typically used to encapsulate small groups of related elements, such as the coordinates of a rectangle. Structures can contain elements of any OTX data type and also Structure itself in any depth.

To define the structure of a Structure the StructureSignature is used. A Structure itself has no literal and also has no init value.

To access structure elements only StepByName and not StepByIndex will be used.

Additionally, the StepByName element will contain only StringLiteral terms.

The deep change-monitoring will detect changing of items in a structure in any depth. Any changes of structure elements that support the eventplus:IsDeepMonitorChangeEvent will trigger an event as defined for the data type of the element.

Sample: If a structure contains a structure, which contains a list and an element of this list was added, removed or changed an eventplus:DeepMonitorChangeEventSource will fires an event.

Icons Note.png IMPORTANT — A Structure value can be persisted if all contained elements can be persisted, see Persistence extension.

Core Conversion

The following table shows the rules for conversion to another data type:

Conversion Result Sample
ToBoolean Undefined (should not be used)
ToInteger Undefined (should not be used)
ToFloat Undefined (should not be used)
ToString Undefined (should not be used)
ToByteField Undefined (should not be used)

Checker Rules

DataType_Chk001

Sample

package DataType.StructureSignature StructureSignature1(Boolean StructureElement1 = false, Integer StructureElement2, Float StructureElement3, String StructureElement4, ByteField StructureElement5);

/// Global Declarations

public procedure main()
{
	/// Local Declarations

	StructureSignature1 Structure1;
}