Listing 6 (th_doubl.hpp)

//
//  class DoubleThing  --  a double thing derived from
//             class Thing.
//
//  Version 1.01   --  2/25/91
//
//  Michael Kelly  --  Author
//
#if !defined(TH_DOUBL_HPP)
#define TH_DOUBL_HPP

#include "thing.hpp"

class DoubleThing : public Thing  {

  public:

    DoubleThing()
    {
   thing = new double(0.0);
    }
    DoubleThing( double &some_thing )
    {
   thing = new double(some_thing);
    }

    long type()
    {
   return ( (long)DoubleType << 16) | sizeof(double);
    }

    operator double() { return *( (double *)ptr() ); }

    void print();
    int printable() { return 1; }
    int sortable()  { return 1; }

    operator ==(Thing &some_thing);
    operator !=(Thing &some_thing);
    operator < (Thing &some_thing);
    operator <=(Thing &some_thing);
    operator > (Thing &some_thing);
    operator >=(Thing &some_thing);
};

#endif

// End of File