A School Directory Application
Package to illustrate classes, subclasses, polymorphism,cout<<<overloading, and virtual functions
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SchoolDirectory Class Reference

Public Member Functions

 SchoolDirectory ()
 
void add (Entry person)
 
void print ()
 
Entrylookup (std::string first, std::string second)
 

Detailed Description


Remarks
Example of a School Directory application * Entries take the form of Students, Faculty and Staff *
Example illustrates a class hierarchy * * Base class: Entry * Subclasses: Student, Faculty, Staff *
Each class has a header (.h) and implementation (.cpp) files *
Other features: overwritten << operator and virtual print * *
: file: SchoolDirectory.cpp *
Author
Henry M. Walker *
Date
January 11, 2023 *
Remarks
References *
A School Directory as an Example of Object-Oriented Design * http://localhost/courses/cpp-style-guide/directory/index.php *

Constructor & Destructor Documentation

◆ SchoolDirectory()

SchoolDirectory::SchoolDirectory ( )
inline

Remarks
Default constructor (with no parameters) *

Member Function Documentation

◆ add()

void SchoolDirectory::add ( Entry  person)
inline

Remarks
insert a person into the SchoolDirectory *
eirectory entries are maintained in lastname/firstname order *
Parameters
personthe entry to be inserted into the underlying directory *
Precondition
entries in the underlying directory are ordered by name *
Postcondition
the underlying directory continues to be ordered by name *
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookup()

Entry * SchoolDirectory::lookup ( std::string  first,
std::string  second 
)
inline

Remarks
entries in the directory are searched by first and last name *
Parameters
firstthe first name of a person *
lastthe last name of a person *
Precondition
the underlying directory is ordered by last/first name *
Returns
if the name is found, a pointer to the entry is returned * if the name is not found, NULL is returned *
Remarks
searching is performed via a binarysearch *
Here is the caller graph for this function:

◆ print()

void SchoolDirectory::print ( )
inline

Remarks
entries in the underlying directory are printed to cout * with beginning and end markers *
Here is the caller graph for this function:

The documentation for this class was generated from the following file: