00001 // dataMgr.h 00002 // 00003 00004 #if !defined(dataMgr_h) 00005 #define dataMgr_h 00006 00007 // disable warnings about extra chars in debug builds for templates 00008 #pragma warning( disable : 4786 ) 00009 00010 #include <string> 00011 00012 using namespace std; 00013 00014 #include "listMgr.h" 00015 #include "student.h" 00016 #include "faculty.h" 00017 #include "gstud.h" 00018 #include "staff.h" 00019 00020 #include "ustud.h" 00021 #include "bsTree.h" 00022 #include <vector> 00023 #include <string> 00024 00025 typedef person* entity; 00026 00027 using namespace std; 00028 #include "Singleton.h" 00029 00030 typedef vector<staff*> vecstaff; 00031 typedef vector<faculty*> vecfaculty; 00032 typedef vector<gstud*> vecgstud; 00033 typedef vector<ustud*> vecustud; 00034 00035 00037 class dataMgr : public Singleton<dataMgr> 00038 { 00039 public: 00040 00041 dataMgr(); 00042 virtual ~dataMgr(); 00043 00044 public: 00046 void showTree(); 00048 bool m_merge; 00050 void setMerge(const bool& merge); 00052 bool getMerge(); 00053 person* findNode(int key); 00054 00057 void add(ustud& s); 00058 void add(gstud& s); 00059 void add(faculty& s); 00060 void add(staff& s); 00061 00064 void userAdd(faculty& s); 00065 00067 void remove(ustud& s); 00068 void remove(gstud& s); 00069 void remove(faculty& s); 00070 void remove(staff& s); 00071 00072 00074 void update(ustud& s); 00075 void update(gstud& s); 00076 void update(faculty& s); 00077 void update(staff& s); 00078 00080 void reset(); 00081 void begin(); 00082 00083 protected: 00084 00085 00086 private: 00087 // courseMgr m_courses; 00088 // fileMgr m_files; 00089 bsTree<person*,int> m_treeId; 00090 bsTree<person*,int> m_treeSsn; 00091 00093 // tree< person* > m_dataTree; 00094 00097 /* 00098 * A vector of pointers to the staff members. 00099 */ 00100 vecstaff m_vstaff; 00101 /* 00102 * A vector of pointers to the faculty members. 00103 */ 00104 vecfaculty m_vfaculty; 00105 /* 00106 * A vector of pointers to graduate students. 00107 */ 00108 vecgstud m_vgstud; 00109 /* 00110 * A vector of pointers to undergraduate students. 00111 */ 00112 vecustud m_vustud; 00113 00115 bool exist(int key); 00116 00118 friend class query; 00119 }; 00120 00121 #endif /* dataMgr_h */
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001