A SERVICE OF

logo

154 Chapter 7: Creating an Operation
Creating a New Data-Centric Operation iTool Developer’s Guide
the methods and properties available to classes that subclass from
IDLitDataOperation.
Example Class Structure Definition
The following is the class structure definition for the ExampleDataOp operation
class. This procedure should be the last procedure in a file named
exampledataop__define.pro.
PRO ExampleDataOp__Define
struct = { ExampleDataOp, $
INHERITS IDLitDataOperation, $
_byteTop: 0B $
}
END
Discussion
The purpose of the structure definition routine is to define a named IDL structure
with structure fields that will contain the operation object instance data. The structure
name should be the same as the operation’s class name — in this case,
ExampleDataOp.
Like many iTool operations that act on data,
ExampleDataOp is created as a
subclass of the IDLitDataOperation class. Operation classes that subclass from
IDLitDataOperation class inherit methods and properties that make it easy to perform
operations that affect data in an iTool.
The ExampleDataOp Operation class instance data includes a single property; a byte
value that is stored in the
_byteTop class structure field.
Note
This example is intended to demonstrate how simple it can be to create a new
operation class definition. While the class definition for an operation class with
significant extra functionality will likely define additional structure fields, and may
inherit from other iTool classes, the basic principles are the same.
Creating an Init Method
The operation class Init method handles any initialization required by the operation
object, and should do the following:
define the Init function method, using the keyword inheritance mechanism to
handle “extra” keywords