// Filename: NamedTimer.h // #ifndef _NamedTimer #define _NamedTimer // NamedTimer class: derived from Timer but also has a string name // // Construction: // a) a positive integer initializer specifies the number of minutes, // number of seconds, and name string // b) no initializer; timer set to zero; name set to empty // ******************** Public Operations ********************* // ~ --> deletes space allocated to name // void print( ) const --> prints name => minutes:seconds remaining // const char * name( ) --> returns the name of the timer // By David Hutchens and Beth Katz #include "Timer.h" // include the superclass's interface class NamedTimer : public Timer { public: NamedTimer(int minutes=0, int seconds=0, const char * name= ""); NamedTimer(const NamedTimer & existing); virtual const NamedTimer & operator =(const NamedTimer & rhs); virtual ~NamedTimer( ) { delete [] theName; }; virtual void print(std::ostream & os) const; virtual const char * name( ) const; private: char * theName; }; #endif