ITT Rule IDL Version 7.0 User Manual Page 163

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 162
Chapter 7: Creating an Operation 163
iTool Developer’s Guide Creating a New Data-Centric Operation
property value, either by storing the value directly in the operation object’s instance
data or by calling another class’ SetProperty method.
Note
Any property registered with a call to the RegisterProperty method must be listed as
a keyword to the SetProperty method either of the operation class or one of its
superclasses.
See “IDLitDataOperation::SetProperty” (IDL Reference Guide) for additional details.
Example SetProperty Method
The following example code shows a very simple SetProperty method for the
ExampleDataOp operation:
PRO ExampleDataOp::SetProperty, BYTETOP = byteTop, $
_REF_EXTRA = _extra
If (N_ELEMENTS(byteTop) GT 0) THEN BEGIN
self._byteTop = byteTop
ENDIF
IF (N_ELEMENTS(_extra) GT 0) THEN $
self->IDLitDataOperation::SetProperty, _EXTRA = _extra
END
Discussion
The SetProperty method first defines the keywords it will accept. There must be a
keyword for each property of the operation. The keyword inheritance mechanism
allows properties to be set on the
ExampleDataOp class’ superclasses without
knowing the names of the properties.
Using the N_ELEMENTS function, we check to see whether a value was specified
for each keyword. If a value is detected, we set the value of the associated property.
In this example, only one property (ByteTop) is specific to the
ExampleDataOp
object. We set the value of the ExampleProperty directly in the
ExampleDataOp
object’s instance data.
Finally, we call the superclass’ SetProperty method, passing in all of the keywords
stored in the
_extra structure.
Page view 162
1 2 ... 158 159 160 161 162 163 164 165 166 167 168 ... 429 430

Comments to this Manuals

No comments