ITT Rule IDL Version 7.0 User Manual Page 171

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 170
Chapter 7: Creating an Operation 171
iTool Developer’s Guide Creating a New Generalized Operation
keyword values to be handled explicitly in the Init method, but we do use the
keyword inheritance mechanism to pass keyword values through to methods called
within the Init method. The
ExampleOp Init method does the following things:
1. Calls the Init method of the superclass, IDLitOperation. We use the TYPES
keyword to specify that our operation works on data that has the iTool data
type
'IDLARRAY2D', provide a Name for the object instance, and provide an
icon. Finally, we use the _EXTRA keyword inheritance mechanism to pass
through any keywords provided when the
ExampleOp Init method is called.
2. Returns the integer 1, indicating successful initialization.
Creating a Cleanup Method
The operation class Cleanup method handles any cleanup required by the operation
object, and should do the following:
destroy any pointers or objects created by the operation
call the superclass’ Cleanup method
Calling the superclass’ cleanup method will destroy any objects created when the
superclass was initialized.
Note
If your operation class is based on the IDLitOperation class, and does not create any
pointers or objects of its own, the Cleanup method is not strictly required. It is
always safest, however, to create a Cleanup method that calls the superclass’
Cleanup method.
See “IDLitOperation::Cleanup” (IDL Reference Guide) for additional details.
Example Cleanup Method
The following example code shows a very simple Cleanup method for the
ExampleOp operation:
PRO ExampleOp::Cleanup
; Clean up superclass
self->IDLitOperation::Cleanup
END
Page view 170
1 2 ... 166 167 168 169 170 171 172 173 174 175 176 ... 429 430

Comments to this Manuals

No comments