home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / FM2LIB30.ZIP / LIB / OBJECTS.DEF < prev    next >
Encoding:
Modula Definition  |  1992-09-24  |  1.2 KB  |  48 lines

  1. DEFINITION MODULE Objects;
  2.  
  3. (* (C) Copyright 1992 Fitted Software Tools. All rights reserved. *)
  4.  
  5. (*
  6.     Please read the chapter "Classes" in the user documentation
  7.     for information about this module.
  8. *)
  9.  
  10. FROM SYSTEM IMPORT ADDRESS;
  11.  
  12. TYPE
  13.     Class = POINTER TO ClassPtr;
  14.     ClassPtr = POINTER TO ClassHeader;
  15.     ClassHeader = RECORD
  16.         parent      :Class;
  17.         size        :CARDINAL;
  18.         filler      :CARDINAL;
  19.         InitProc    :PROCEDURE( ADDRESS );
  20.         DestroyProc :PROCEDURE( ADDRESS );
  21.     END;
  22.  
  23.     ObjPtr = POINTER TO RECORD
  24.         class :ClassPtr
  25.         (* data *)
  26.     END;
  27.  
  28.  
  29. PROCEDURE ALLOCATEOBJECT( VAR op :ObjPtr; cp :ClassPtr );
  30. (*
  31.     Allocates storage (calling Storage.ALLOCATE) for an object
  32.     of class cp, places the object's address (handle) in op
  33.     and invokes the INIT methods defined for class cp.
  34. *)
  35.  
  36. PROCEDURE DEALLOCATEOBJECT( VAR op :ObjPtr );
  37. (*
  38.     Invokes the DESTROY methods in op's class and deallocates the
  39.     storage used by op. op is set to NIL.
  40. *)
  41.  
  42. PROCEDURE MEMBEROBJECT( cp :ClassPtr; class :ClassPtr ) :BOOLEAN;
  43. (*
  44.     TRUE if cp is of class class or one of its descendants.
  45. *)
  46.  
  47. END Objects.
  48.