// C++ code Copyright (C) David R. Evans G4AMJ/NQ0I #ifndef SETH #define SETH #include // This should all really be done with templates, so that sets of other // types can easily be constructed. However, the Mac doesn't know about // templates, so we'll just use integers. class set { int _current_size, _max_size; int* _data; public: // also, the Mac doesn't appear to implement array construction using // the default constructor correctly #ifdef macintosh set(void); #else set(const int size = 256); #endif set(const set&); ~set(void) { destroy_array(_data); } void operator=(const set&); friend boolean operator<(int, const set&); boolean operator<(const set&) const; void operator+=(const int); void operator+=(set&); void operator-=(const int); inline int operator[](const int n) const { return _data[n]; } inline int size(void) const { return _current_size; } inline void clear(void) { _current_size = 0; } }; #endif