Справочник Пользователя для ITT Rule IDL Version 7.0

Скачать
Страница из 430
56
Chapter 3: Data Management
iTool Data Objects
iTool Developer’s Guide
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 
page 65 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 
 (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