iTool Data Objects
Each item of data used by an iTool must be encapsulated in an IDLitData object. Data objects can be grouped into collections using the IDLitDataContainer class or its subclass, IDLitParameterSet.
Data Objects
IDLitData objects can hold data items of any IDL data type. The IDLitData class provides iTool data typing and data change notification functionality, and when coupled with the IDLitDataContainer object forms the base element for the construction of composite data types.
IDLitData objects implement the iTools notifier interface, which provides a mechanism by which observers of a data item can be alerted when the state of the information contained in the data object changes. See Data Update Mechanism for details on the notification system.
Data objects are created using standard IDL object-creation syntax. For example, to create a data object that contains a vector of data:
; Create a data vector containing 10 random values myData = RANDOMU(seed, 10) ; Create a new data object from the vector. oData = OBJ_NEW('IDLitDataIDLVector', myData)
The IDLitDataIDLVector class is a subclass of IDLitData designed to hold vector data. See "IDLitData" (IDL Reference Guide) for a complete description of the data object, its methods, and its properties.
Data Containers
IDLitDataContainer objects can hold any number of IDLitData or IDLitDataContainer objects. This ability to organize data into object hierarchies allows for the creation of composite data types.
Data container objects are created using standard IDL object-creation syntax, and individual data objects are included in the data container via a call to the IDLitContainer::Add method. For example, the following statements create a new data container and add the data object created in the previous section:
; Create a data container oDataContainer = OBJ_NEW('IDLitDataContainer') ; Add a data object. oDataContainer->Add, oData
In this example we do not specify an iTool data type for the data container object itself.
Tip
Often, you will organize data using a subclass of the IDLitDataContainer class: the IDLitParameterSet.
See "IDLitDataContainer" (IDL Reference Guide) for a complete description of the data container object, its methods, and its properties.
Parameter Sets
The IDLitParameterSet class is a specialized subclass of the IDLitDataContainer class that provides the ability to associate parameters with the contained IDLitData and IDLitDataContainer objects. This association allows the iTool developer to package a set of data parameters in a single container, which is then provided to the iTools system for processing and display. See "IDLitParameterSet" (IDL Reference Guide) for a complete description of the parameter set object, its methods, and its properties.
Note
Do not confuse parameter sets, which are containers for data objects, with parameters, which define how data is used by a visualization object. Parameters are described in Parameters.
Using a parameter set object is very similar to using a data container object. The parameter set itself is created using standard IDL object-creation syntax. The parameter set object allows for the association of a parameter with each added data object. For example, the following statements create a new parameter set and add the data object created in the previous section, assigning a parameter:
; Create a parameter set object oParameterSet = OBJ_NEW('IDLitParameterSet') ; Add a data object, assigning a parameter oParameterSet->Add, oData, PARAMETER_NAME = 'Y data'