A School Directory Application
Package to illustrate classes, subclasses, polymorphism,cout<<<overloading, and virtual functions
Entry.h
Go to the documentation of this file.
1 
23 #ifndef ENTRY_H
24 #define ENTRY_H
25 
26 class Entry {
27 
28 public:
29  // constructors
33  Entry () ;
34 
43  Entry (std::string first, std::string last, std::string eAddress) ;
44 
54  bool equals (std::string first, std::string second) ;
55 
64  bool equals (Entry otherEntry) ;
65 
75  bool comesBefore (std::string first, std::string second) ;
76 
85  bool comesBefore (Entry otherEntry) ;
86 
102  virtual
103  std::ostream& print (std::ostream &os) const;
104 
112  friend std::ostream& operator<< (std::ostream &os, const Entry& ent) ;
113 
118  virtual
119  ~Entry () ;
120 
121 private:
122  // could use "protected" here, so variables may be accessed in subclasses
123  std::string firstName;
124  std::string lastName;
125  std::string eMail;
126 
127 };
128 
129 #endif
Definition: Entry.h:26
friend std::ostream & operator<<(std::ostream &os, const Entry &ent)
Definition: Entry.cpp:140
bool equals(std::string first, std::string second)
Definition: Entry.cpp:55
Entry()
Definition: Entry.cpp:29
bool comesBefore(std::string first, std::string second)
Definition: Entry.cpp:84
virtual std::ostream & print(std::ostream &os) const
Definition: Entry.cpp:126
virtual ~Entry()
Definition: Entry.cpp:147