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

person.h

Go to the documentation of this file.
00001 // person.h
00002 //
00003 
00004 #if !defined(person_h)
00005 #define person_h
00006 #include <string>
00007 
00008 using namespace std;
00009 
00010 /*
00011  * This maintains all information for person this class will be
00012  * abstract in that no instances of it will be created.
00013  */
00014 
00015 #include "address.h"
00016 #include "id.h"
00017 #include "name.h"
00018 #include "phone.h"
00019 #include "dob.h"
00020 #include "ssn.h"
00021 #include "field.h"
00022 #include "email.h"
00023 
00024 #ifndef FIELD_TYPE
00025 #define FIELD_TYPE
00026 enum fieldtype {NAME, ID, SSN, NAMEDOB, ZIP, STATE, MAJOR, DEPT, GPA, AREA,
00027                 AREAPRE, PHONE, COURSES, COURSESSEM, INCOURSE, IDTEACH, IDADVISE,
00028                 IDCOMMITTE, IDSUPERV, ADDRESS};
00029 #endif
00030 
00031 
00032 class person : public field
00033 {
00034 public:
00035     person();
00036     virtual ~person();
00037     person(const person& p);
00038     const person& operator=(const person& rhs);
00040     virtual void removec(int cIndex)=0;
00041     virtual void removes(int index)=0;
00042     virtual void removea(int index)=0;
00043 
00044     bool operator <(const person& rhs)
00045     {
00046         return (m_id < rhs.m_id);
00047     }
00048 
00049     bool operator >(const person& rhs)
00050     {
00051         return (m_id.getIdInt() > rhs.m_id.getIdInt());
00052     }
00053             
00054 public:
00055     inline address getAddress() const
00056     {
00057         return m_address;
00058     }
00059 
00060     inline email getEmail() const
00061     {
00062         return m_email;
00063     }
00064     
00065     inline id getId() const
00066     {
00067         return m_id;
00068     }
00069 
00070     inline name getName() const
00071     {
00072         return m_name;
00073     }
00074 
00075     inline phone getPhone() const
00076     {
00077         return m_phone;
00078     }
00079 
00080     inline dob getDob() const
00081     {
00082         return m_dob;
00083     }
00084 
00085     inline ssn getSsn() const
00086     {
00087         return m_ssn;
00088     }
00089 
00090     inline void setAddress(const address& a)
00091     {
00092         m_address = a;
00093     }
00094 
00095     inline void setEmail(const email& e)
00096     {
00097         m_email = e;
00098     }
00099 
00100     inline void setId(const id& i)
00101     {
00102         m_id = i;
00103     }
00104 
00105     inline void setName(const name& n)
00106     {
00107         m_name = n;
00108     } 
00109 
00110     inline void setPhone(const phone& p)
00111     {
00112         m_phone = p;
00113     }
00114 
00115     inline void setDob(const dob& d)
00116     {
00117         m_dob = d;
00118     }
00119 
00120     inline void setSsn(const ssn& s)
00121     {
00122         m_ssn = s;
00123     }
00124 
00125     string ToParse(int fld);
00126     string ToString();
00127     string ToFileFmt();
00128 
00129     inline int key()
00130     {
00131         return m_id.getIdInt();
00132     }
00133 protected:
00134     void copy(const person& p);
00135 
00137     address m_address;
00138     
00140     email   m_email;
00141     
00143     id      m_id;
00144     
00146     name    m_name;
00147     
00149     phone   m_phone;
00150     
00152     dob     m_dob;
00153     
00155     ssn     m_ssn;
00156 
00157 private:
00158 
00159 
00160 };
00161 
00162 #endif /* person_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