ITT Rule IDL Version 7.0 User Manual Page 167

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 166
Chapter 7: Creating an Operation 167
iTool Developer’s Guide Creating a New Generalized Operation
struct = { ExampleOp, INHERITS IDLitOperation}
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,
ExampleOp.
Like many iTool operations that act on data,
ExampleOp is created as a subclass of
the IDLitOperation class. The ExampleOp Operation class does not include any
instance data of its own.
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
call the Init methods of any superclasses, using the keyword inheritance
mechanism to pass “extra” keywords
register any properties of the operation, and set property attributes as necessary
perform other initialization steps as necessary
return the value 1 if the initialization steps are successful, or 0 otherwise
Definition of the Init Function
Begin by defining the argument and keyword list for your Init method. The argument
and keyword list defines positional parameters (arguments) accepted by your method,
defines any keywords that will be handled directly by your method, and specifies
whether keywords not explicitly handled by your method will be passed through to
other routines called by your method via IDLs keyword inheritance mechanism.
Page view 166
1 2 ... 162 163 164 165 166 167 168 169 170 171 172 ... 429 430

Comments to this Manuals

No comments