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

Employee Class Reference

#include <Employee.hpp>

Inheritance diagram for Employee::

Boss CommissionWorker HourlyWorker PieceWorker List of all members.

Public Methods

 Employee (const char *first, const char *last)
virtual ~Employee ()
const char * getFirstName () const
const char * getLastName () const
virtual double earnings () const=0
void printName () const
void printInfo () const

Static Public Methods

int getCount ()

Private Attributes

char * firstName
char * lastName
Date * birthDate
Date * hireDate

Static Private Attributes

int count = 0

Constructor & Destructor Documentation

Employee::Employee const char *    first,
const char *    last
 

Definition at line 10 of file Employee.cpp.

00011    : birthDate( NULL ), hireDate( NULL )
00012 {
00013    firstName = strdup( first );
00014    lastName  = strdup( last );
00015    ++count;
00016 }

Employee::~Employee   [virtual]
 

Definition at line 38 of file Employee.cpp.

00038                     {
00039    if ( firstName != NULL )  delete [] firstName;
00040    if ( lastName  != NULL )  delete [] lastName; 
00041    if ( birthDate != NULL )  delete birthDate;
00042    if ( hireDate  != NULL )  delete hireDate; 
00043    --count;
00044 }


Member Function Documentation

virtual double Employee::earnings   const [pure virtual]
 

Reimplemented in Boss, CommissionWorker, HourlyWorker, and PieceWorker.

int Employee::getCount   [static]
 

Definition at line 8 of file Employee.cpp.

00008 { return count; }

const char * Employee::getFirstName   const
 

Definition at line 48 of file Employee.cpp.

00048                                          {
00049    return firstName;
00050 }

const char * Employee::getLastName   const
 

Definition at line 52 of file Employee.cpp.

00052                                         {
00053    return lastName;
00054 }

void Employee::printInfo   const
 

Reimplemented in HourlyWorker.

Definition at line 60 of file Employee.cpp.

00060                                {
00061    cout << lastName << ", " << firstName;
00062 
00063    if ( hireDate != NULL ) 
00064      cout << "\nHired: " << hireDate;
00065 
00066    if ( birthDate != NULL ) 
00067      cout << "\nBirth date: " << birthDate;
00068 
00069    cout << '\n';
00070 }

void Employee::printName   const
 

Reimplemented in CommissionWorker, HourlyWorker, and PieceWorker.

Definition at line 56 of file Employee.cpp.

Referenced by HourlyWorker::printInfo(), and PieceWorker::printName().

00056                                {
00057    cout << firstName << ' ' << lastName;
00058 }


Member Data Documentation

Date* Employee::birthDate [private]
 

Definition at line 29 of file Employee.hpp.

int Employee::count = 0 [static, private]
 

Definition at line 7 of file Employee.cpp.

char* Employee::firstName [private]
 

Definition at line 26 of file Employee.hpp.

Date* Employee::hireDate [private]
 

Definition at line 30 of file Employee.hpp.

char* Employee::lastName [private]
 

Definition at line 27 of file Employee.hpp.


The documentation for this class was generated from the following files:
Generated on Sun Oct 14 18:48:34 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001