home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_06 / 9n06060a < prev    next >
Text File  |  1991-02-25  |  885b  |  49 lines

  1. //
  2. //    class LongThing    --  a long thing derived from
  3. //                class Thing.
  4. //
  5. //    Version 1.01    --  2/25/91
  6. //
  7. //    Michael Kelly    --  Author
  8. //
  9. #if !defined(TH_LONG_HPP)
  10. #define TH_LONG_HPP
  11.  
  12. #include "thing.hpp"
  13.  
  14. class LongThing : public Thing  {
  15.  
  16.   public:
  17.  
  18.     LongThing()
  19.     {
  20.     thing = new long(0L); 
  21.     }
  22.     LongThing( long &some_thing ) 
  23.     { 
  24.     thing = new long(some_thing); 
  25.     }
  26.  
  27.     long type()    
  28.     { 
  29.     return ( (long)LongType << 16) | sizeof(long); 
  30.     }
  31.  
  32.  
  33.     operator long() { return *( (long *)ptr() ); }
  34.  
  35.     void print();
  36.     int  printable() { return 1; }
  37.     int  sortable()  { return 1; }
  38.  
  39.  
  40.     operator ==(Thing &some_thing);
  41.     operator !=(Thing &some_thing);
  42.     operator < (Thing &some_thing);
  43.     operator <=(Thing &some_thing);
  44.     operator > (Thing &some_thing);
  45.     operator >=(Thing &some_thing);
  46. };
  47.  
  48. #endif
  49.