#include #include using namespace std ; #include "Priority.h" // pre - output stream, printme object exists // post - display low, high, or medium ostream & operator<<(ostream & out, const Priority & printme) { if(printme.p == Priority::LOW) out << "LOW" ; else if(printme.p == Priority::MEDIUM) out << "MEDIUM" ; else if(printme.p == Priority::HIGH) out << "HIGH" ; else out << "ERROR" ; return out ; } // pre - priority integer // post - compare this to p bool operator==(const Priority & thisguy, const int p) {return thisguy.p == p;} // pre - priority integer // post - compare this to p bool operator!=(const Priority & thisguy, const int p) {return thisguy.p != p;} // pre - priority integer // post - compare this to p bool operator<(const Priority & thisguy, const int p) {return thisguy.p < p;} // pre - priority integer // post - compare this to p bool operator<=(const Priority & thisguy, const int p) {return thisguy.p <= p;} // pre - priority integer // post - compare this to p bool operator>(const Priority & thisguy, const int p) {return thisguy.p > p;} // pre - priority integer // post - compare this to p bool operator>=(const Priority & thisguy, const int p) {return thisguy.p >= p;} // pre - none // post - set to low Priority::Priority() {this->p = Priority::LOW ; } // pre - integer priority // post - set this to newp Priority::Priority(const int newp) { if(newp < 0 || newp > 2) this->p = Priority::LOW ; else this->p = newp ;} // pre - other priority // post- set this to other Priority::Priority(const Priority & other) { this->p = other.p ;} // pre - other priority // post- set this to other Priority & Priority::operator=(const Priority & other) {this->p = other.p ;} // pre - priority exists // post - compare this to p bool Priority::operator==(const Priority & other) const {return this->p == other.p;} // pre - priority exists // post - compare this to p bool Priority::operator!=(const Priority & other) const {return this->p != other.p;} // pre - priority exists // post - compare this to p bool Priority::operator<(const Priority & other) const {return this->p < other.p;} // pre - priority exists // post - compare this to p bool Priority::operator<=(const Priority & other) const {return this->p <= other.p;} // pre - priority exists // post - compare this to p bool Priority::operator>(const Priority & other) const {return this->p > other.p;} // pre - priority exists // post - compare this to p bool Priority::operator>=(const Priority & other) const {return this->p >= other.p;}