A SERVICE OF

logo

240 Chapter 9: Creating a File Reader
Creating a New File Reader iTool Developer’s Guide
2. Returns the integer 1, indicating successful initialization.
Creating a Cleanup Method
The file reader class Cleanup method handles any cleanup required by the file reader
object, and should do the following:
destroy any pointers or objects created by the file reader
call the superclass’ Cleanup method
Calling the superclass’ cleanup method will destroy any objects created when the
superclass was initialized.
Note
If your file reader class is based on the IDLitReader 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 “IDLitReader::Cleanup” (IDL Reference Guide) for additional details.
Example Cleanup Method
PRO ExampleReader::Cleanup
; Clean up superclass
self->IDLitReader::Cleanup
END
Discussion
Since our file reader 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 reader class GetProperty method retrieves property values from the file
reader object instance or from instance data of other associated objects. It should
retrieve the requested property value, either from the file reader object’s instance data
or by calling another class’ GetProperty method.