home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 594b.lha / Precognition_rel1 / Object.h < prev    next >
C/C++ Source or Header  |  1991-12-12  |  2KB  |  68 lines

  1. #ifndef OBJECT_H
  2. #define OBJECT_H
  3.  
  4. /* ==========================================================================
  5. **
  6. **                               Object.h
  7. **
  8. **      Defines the basic struct from which all Precognition objects
  9. **      are defined.
  10. **
  11. **   ©1991 WILLISoft
  12. **
  13. ** ==========================================================================
  14. */
  15. #include <exec/types.h>
  16.  
  17.  
  18. typedef void Class;
  19.  
  20.  
  21. typedef struct Object
  22.    {
  23.       Class *isa;        /* Points to the objects 'Class' structure. */
  24.       char  *ObjectName; /* Used by interface builder. */
  25.    } Object;
  26.  
  27. /* All 'objects' are derrived from this structrure, i.e. they have
  28. ** an 'isa' pointer as their first member.  The 'isa' pointer points
  29. ** to the 'Class' structure for the object.
  30. **
  31. ** NOTE: Objects do NOT need to have an ObjectName associated with
  32. ** them.  This field is used by the Application builder to attach
  33. ** a variable name.
  34. */
  35.  
  36.  
  37. /*
  38. ** All object methods must provide at least the following operations:
  39. */
  40.  
  41.  
  42. void  CleanUp( Object *self );
  43.  
  44. /* Deallocates all but the base storage for an object.  e.g. given
  45. ** a structure like:
  46. **
  47. **    struct Abc
  48. **       {
  49. **          Class *isa;
  50. **          char *FirstName, *LastName;
  51. **       };
  52. **
  53. ** which once initialized, has FirstName & LastName pointing to
  54. ** 2 40 char buffers, 'CleanUp( Abc )' would deallocate the strings
  55. ** 'FirstName' & 'LastName', but not Abc itself.
  56. */
  57.  
  58. void Object_Init( Object *self );
  59.  
  60.  
  61. const char *ClassName( const Object *self );
  62.    /*
  63.    ** Returns the name of the class to which the object belonds.
  64.    ** (Useful for debugging.)
  65.    */
  66.  
  67. #endif
  68.