Listing 11 (th_long.cpp)

//
//  class LongThing-- a long thing derived from
//              class Thing.
//
//  Version 1.01  -- 2/25/91
//
//  Michael Kelly -- Author
//
#include <stdio.h>
#include "th_long.hpp"

void LongThing::print()
{
    printf("%ld\n", (long)*this);
}

LongThing::operator ==(Thing &some_thing)
{
    return ( type() == some_thing.type() ) ?
      ( *((long *)ptr()) == *((long *)some_thing.ptr()) ) : 0;
}

LongThing::operator !=(Thing &some_thing)
{
    return ( type() == some_thing.type() ) ?
      ( *((long *)ptr()) != *((long *)some_thing.ptr()) ) : 0;
}

LongThing::operator < (Thing &some_thing)
{
    return (type() == some_thing.type() ) ?
      ( *((long *)ptr()) <  *((long *)some_thing.ptr()) ) : 0;
}

Longthing::operator <=(Thing &some_thing)
{
    return ( type() == some_thing.type() ) ?
      ( *((long *)ptr()) <= *((long *)some_thing.ptr()) ) : 0;
}

LongThing::operator > (Thing &some_thing)
{
    return ( type() == some_thing.type() ) ?
      ( *((long *)ptr()) >  *((long *)some_thing.ptr()) ) : 0;
}

LongThing::operator >=(Thing &some_thing)
{
    return ( type() == some thing.type() ) ?
      ( *((long *)ptr()) >="*((long *)some_thing.ptr()) ) : 0;
}

// End of File