Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

listMgr.h

Go to the documentation of this file.
00001 // listMgr.h
00002 //
00003 
00004 //class listMgr;
00005 
00006 #if !defined(listMgr_h)
00007 #define listMgr_h
00008 
00009 #include <iostream>
00010 #include <string>
00011 #include <vector>
00012 #include <algorithm>
00013 #include "fileMgr.h"
00014 
00015 using namespace std;
00016 
00017 #include "course.h"
00018 #include "student.h"
00019 #include "staff.h"
00020 
00021 
00022 typedef person* entity;
00023 typedef vector<entity> vectorentity;
00024 typedef vector<course> vectorcourse;
00025 
00026 /*
00027  * This class manages the lists
00028  */
00029 
00030 class listMgr
00031 {
00032 
00033 public:
00034     bool getCourseNum(course & c, int & index);
00035     void setFromUser(bool u);
00036     void clear();
00037     void setMerge(bool m);
00038     listMgr();
00039     virtual ~listMgr();
00040 
00041 //public:
00042 
00043     void finishMerge();
00044     /*
00045      * adds a course or advisor
00046      */
00047     void add(course& c);
00049     string ToParse();
00050     string ToFileFmt();
00051     string ToString();
00052     void add(int courseNum, int index, student *s);
00053     void add(int courseNum, student *s);
00054     void add(int courseNum, staff *s);
00055     /*
00056      * Deletes a course or advisor
00057      */
00058     void remove(course & c);    
00059     virtual void removep(person *p,int index)=0;
00060     virtual void addHeader(string &s)=0;
00061     virtual void addTrailer(string &s)=0;
00062 
00063 
00064     int getCourseNum(int num);
00065     /*
00066      * Checks to see if specified course or advisor exists
00067      */
00068     bool exist(course& c);
00069 
00070     /*
00071      * Gets the list of courses or advisors specified
00072      */
00073     vectorentity getMembList(course& c);
00074     /*
00075      * Gets a particular entry in the list of courses or advisors
00076      */
00077     course getEntry(int num);
00078 
00079 
00080 //  void setMgr(dataMgr * ptr);
00081 
00082 
00083 protected:
00084     bool m_fromUser;
00085     void addm(course & c);
00086 
00087     bool            m_merge;
00088     /*
00089      * The vector for the list.
00090      */
00091     vectorcourse    m_listVec;
00092     /*
00093      * Check's if this is an empty index
00094      */
00095     bool            m_hasEmpty;
00096     /*
00097      * List of empty indeces for the deleted objects
00098      */
00099     vector<int>     m_emptyList;
00100     /*
00101      *
00102      */
00103     vector<int>     m_newIndex;
00105 //  dataMgr * dataptr;
00106 private:
00107 };
00108 
00109 class adviseMgr :  public listMgr, public Singleton<adviseMgr>
00110 {
00111 public:
00112     adviseMgr();
00113     ~adviseMgr();
00114     virtual void removep(person *p,int index);
00115 protected:
00116     virtual void addHeader(string &s);
00117     virtual void addTrailer(string &s);
00118 
00119 private:
00120 };
00121 
00122 class courseMgr : public listMgr, public Singleton<courseMgr>
00123 {
00124 public:
00125     courseMgr();
00126     ~courseMgr();
00127     virtual void removep(person *p, int index);
00128 protected:
00129     virtual void addHeader(string &s);
00130     virtual void addTrailer(string &s);
00131 
00132 private:
00133 };
00134 
00135 class superV : public listMgr,  public Singleton<superV>
00136 {
00137 public:
00138     superV();
00139     virtual ~superV();
00140 public:
00141     string ToParse();
00142     string ToString();
00143     string ToFileFmt();
00144     virtual void removep(person *p,int index);
00145 protected:
00146     virtual void addHeader(string &s);
00147     virtual void addTrailer(string &s);
00148 
00149 private:
00150 };
00151 
00152 #endif /* listMgr_h */

Generated on Mon Oct 22 20:18:45 2001 for University People Management System by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001