home *** CD-ROM | disk | FTP | other *** search
- #ifndef OBJECT_H
- #define OBJECT_H
-
- /* ==========================================================================
- **
- ** Object.h
- **
- ** Defines the basic struct from which all Precognition objects
- ** are defined.
- **
- ** ©1991 WILLISoft
- **
- ** ==========================================================================
- */
- #include <exec/types.h>
-
-
- typedef void Class;
-
-
- typedef struct Object
- {
- Class *isa; /* Points to the objects 'Class' structure. */
- char *ObjectName; /* Used by interface builder. */
- } Object;
-
- /* All 'objects' are derrived from this structrure, i.e. they have
- ** an 'isa' pointer as their first member. The 'isa' pointer points
- ** to the 'Class' structure for the object.
- **
- ** NOTE: Objects do NOT need to have an ObjectName associated with
- ** them. This field is used by the Application builder to attach
- ** a variable name.
- */
-
-
- /*
- ** All object methods must provide at least the following operations:
- */
-
-
- void CleanUp( Object *self );
-
- /* Deallocates all but the base storage for an object. e.g. given
- ** a structure like:
- **
- ** struct Abc
- ** {
- ** Class *isa;
- ** char *FirstName, *LastName;
- ** };
- **
- ** which once initialized, has FirstName & LastName pointing to
- ** 2 40 char buffers, 'CleanUp( Abc )' would deallocate the strings
- ** 'FirstName' & 'LastName', but not Abc itself.
- */
-
- void Object_Init( Object *self );
-
-
- const char *ClassName( const Object *self );
- /*
- ** Returns the name of the class to which the object belonds.
- ** (Useful for debugging.)
- */
-
- #endif
-