00001
00002
00003
00004 #if !defined(query_h)
00005 #define query_h
00006 #include <string>
00007 #include "dataMgr.h"
00008 #include "faculty.h"
00009 #include "student.h"
00010 #include "phone.h"
00011 #include "ssn.h"
00012 #include "dob.h"
00013 #include "course.h"
00014 #include "staff.h"
00015 #include "name.h"
00016 #include <list>
00017 #include "exception.h"
00018
00019 using namespace std;
00020
00022
00027
00029
00030
00031
00032
00033
00034
00035 #ifndef FIELD_TYPE
00036 #define FIELD_TYPE
00037 enum fieldtype {NAME, ID, SSN, NAMEDOB, ZIP, STATE, MAJOR, DEPT, GPA, AREA,
00038 AREAPRE, PHONE, COURSES, COURSESSEM, INCOURSE, IDTEACH, IDADVISE,
00039 IDCOMMITTE, IDSUPERV};
00040 #endif
00041
00042 enum who {ALL, USTUD, GSTUD, FAC, STAFF};
00043 enum outtype {FULL, NAMEONLY, GPANAME, GPANAMEDEPT};
00044
00045 typedef void(*comp)(person* p,person *pp, bool& success);
00046 typedef bool(*lessthan)(person*p);
00047 class dataMgr;
00048
00049 class query
00050 {
00051 public:
00052 query();
00053 virtual ~query();
00054 public:
00055 void set(fieldtype f, who w, ostream & out, string fir, string mid, string last, short m, short d, int y);
00056 void setOutput(outtype t);
00057 void set(fieldtype f, who w, ostream &out, string input);
00058 void set(fieldtype f, who w, ostream &out, gstud &g);
00059 void set(fieldtype f, who w, ostream &out, student &s);
00060 void set(fieldtype f, who w, ostream &out, faculty & fac);
00061 void set(fieldtype f, who w, ostream &out, course & c);
00062 void set(fieldtype f,who w, ostream &out, string a, string p, string s);
00063 void set(fieldtype f, who w, ostream &out, int high, int low);
00064 void set(fieldtype f, who w, ostream &out, int checkfor);
00065 void set(fieldtype f, who w, ostream &out);
00066 bool perform();
00067
00068 protected:
00069 void find(fieldtype f, who w, string fir, string mid, string last, short m, short d, int y);
00070 bool find(fieldtype f, who w, string input);
00071 bool find(fieldtype f, who w, gstud &g);
00072 bool find(fieldtype f, who w, student &s);
00073 bool find(fieldtype f, who w, faculty & fac);
00074 bool find(fieldtype f, who w, course & c);
00075 bool find(fieldtype f,who w, string a, string p, string s);
00076 bool find(fieldtype f, who w, int high, int low);
00077 bool find(fieldtype f, who w, int checkfor);
00078 bool find(fieldtype f, who w);
00079
00080 bool output(ostream &out);
00081 outtype m_out;
00082 list< person* > m_list;
00083
00084 private:
00085
00086
00087
00088 };
00089
00090 #endif