home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / db02_src.zip / myobj.h < prev    next >
C/C++ Source or Header  |  1993-11-05  |  2KB  |  80 lines

  1. /**************************************************************************
  2.  * Source Id :
  3.  *
  4.  * $Id: myobj.h,v 1.6 1993/03/18 04:38:22 kevinl Exp $
  5.  *-------------------------------------------------------------------------
  6.  * Project Notes :
  7.  *
  8.  *  Diamond Base
  9.  *  ============
  10.  *      A solid database implementation, spurred on by the continuing
  11.  *  Metal (Lead) Base saga.
  12.  *
  13.  *  Project Team :
  14.  *        A. Davison
  15.  *        K. Lentin
  16.  *        D. Platt
  17.  *
  18.  *    Project Commenced : 05-02-1993
  19.  *
  20.  *-------------------------------------------------------------------------
  21.  *  Module Notes :
  22.  *
  23.  *  Class definition for my test object.
  24.  *
  25.  *
  26.  *  Original Author : Krazy Kev
  27.  *
  28.  *-------------------------------------------------------------------------
  29.  * Revision History:
  30.  *
  31.  * $Log: myobj.h,v $
  32.  * Revision 1.6  1993/03/18  04:38:22  kevinl
  33.  * Changed const's to enum
  34.  *
  35.  * Revision 1.5  1993/03/17  14:31:16  kevinl
  36.  * Added operators void* char*
  37.  * Added getDataLength, compare, removed isLessThan, isEqual
  38.  *
  39.  * Revision 1.4  1993/02/18  22:28:30  davison
  40.  * Added numKey and default return values
  41.  *
  42.  * Revision 1.3  1993/02/17  12:16:19  kevinl
  43.  * Added isEqual
  44.  * fixed setKey
  45.  *
  46.  * Revision 1.2  1993/02/13  00:56:32  kevinl
  47.  * added setKey and new constructor
  48.  *
  49.  * Revision 1.1  1993/02/08  14:41:47  darrenp
  50.  * Initial revision
  51.  *
  52.  **************************************************************************/
  53.  
  54. #ifndef __MYOBJ_H__
  55. #define __MYOBJ_H__
  56.  
  57. #include "object.h"
  58.  
  59. class myObject : public object
  60. {
  61.     long theKey;
  62.     char theData[11];
  63.  
  64. public:
  65.  
  66.     enum {longKey, charKey};
  67.  
  68.     inline virtual operator void*() { return (void*)theData; }
  69.     inline virtual operator char*() { return (char*)theData; }
  70.     inline virtual long getDataLength() { return sizeof(theKey) + sizeof(theData); };
  71.     inline virtual long getKeyLength(long keyNum=0);
  72.     inline virtual pKeyType getKey(long keyNum=0);
  73.     virtual int compare(pKeyType key, long keyNum=0);
  74.     myObject();
  75.     myObject(pKeyType newKey, long keyNum=0);
  76.     void setKey(pKeyType newKey, long keyNum=0);
  77. };
  78.  
  79. #endif
  80.