// File: State.h // Description: State class function declarations #ifndef H_stateClass #define H_stateClass #include "Date.h" #include #include using namespace std; class State { public: //********** functors created here *********** // less than by capital struct ByCap : public binary_function { bool operator() (State x, State y) {return (x.getCap() < y.getCap());} }; //less than by population struct ByPop : public binary_function { bool operator() (State x, State y) {return (x.getPopRank() < y.getPopRank());} }; //less than by Area struct ByArea : public binary_function { bool operator()(State x, State y) {return (x.getAreaRank() < y.getAreaRank());} }; //less than by Date Admitted struct ByDate : public binary_function { bool operator()(State x, State y) {return (x.getAdmitOrder() < y.getAdmitOrder());} }; //********* end functors *********** State(); //basic constructor string getName(); //returns stateName string getCap(); //returns stateCapital int getPopRank(); //returns popRank int getAreaRank(); //returns areaRank int getAdmitOrder(); //returns admittOrder bool operator<(const State&) const; //compare state names bool operator<(const string&) const; // (string); //compare state name and key bool operator==(string); //compare for state name and //key equality on State and string bool operator==(State); //compare for state name and //key equality on States long getPop(); private: Date AdmDate; string stateName, stateCapital; int popRank, areaRank, admittOrder; float popDensity; long area; int totalPop; //output State objects friend ostream &operator<<(ostream&, const State &s); //input State objects friend istream &operator>>(istream&, State &s); }; #endif