A SERVICE OF

logo

264 Chapter 10: Creating a File Writer
Creating a New File Writer iTool Developer’s Guide
inheritance mechanism to pass through any keywords provided when the
ExampleWriter Init method is called.
2. Returns the integer 1, indicating successful initialization.
Creating a Cleanup Method
The file writer class Cleanup method handles any cleanup required by the file writer
object, and should do the following:
destroy any pointers or objects created by the file writer
call the superclass’ Cleanup method
Calling the superclass’ cleanup method will destroy any objects created when the
superclass was initialized.
Note
If your file writer class is based on the IDLitWriter 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 “IDLitWriter::Cleanup” (IDL Reference Guide) for additional details.
Example Cleanup Method
PRO ExampleWriter::Cleanup
; Clean up superclass
self->IDLitWriter::Cleanup
END
Discussion
Since our file writer object does not have any instance data of its own, the Cleanup
method simply calls the superclass Cleanup method.
Creating a GetProperty Method
The file writer class GetProperty method retrieves property values from the file writer
object instance or from instance data of other associated objects. It should retrieve the
requested property value, either from the file writer object’s instance data or by
calling another class’ GetProperty method.