#ifndef TIMETABLE_H_ #define TIMETABLE_H_ #include "Appointment.h" //------------------------------------------------------------------------- /** * This class represents a rudimentary timetable that contains a set * of appointments. Appointments are organized by hour of the day and * day of the week. * * @author Stephen Edwards * @version Feb 22, 2005 */ class TimeTable { public: //~ Constructor ........................................................... // ---------------------------------------------------------- /** * Creates a new TimeTable object. */ TimeTable(); // ---------------------------------------------------------- /** * Copy constructor. */ TimeTable( const TimeTable& rhs ); // ---------------------------------------------------------- /** * Destructor. */ virtual ~TimeTable(); // ---------------------------------------------------------- /** * Assignment operator. */ TimeTable& operator=( const TimeTable& rhs ); //~ Methods ............................................................... // ---------------------------------------------------------- /** * Add another appointment. If there is already an existing appointment * scheduled for the given day/time, it will be replaced. * @param day the day of the week on which this appointment * falls (0-6) * @param appointment the appointment to add */ virtual void addAppointment( int day, const Appointment& appointment ); // ---------------------------------------------------------- /** * Look up the appointment scheduled for a given day and hour. * @param day the day of the week to look up (0-6) * @param hour the hour of the day to look up (0-23) * @return the appointment scheduled for the given time, or null * if there is none */ virtual Appointment appointmentFor( int day, int hour ) const; private: void allocateArray(); //~ Instance/static variables ............................................. Appointment** appointments; }; #endif /*TIMETABLE_H_*/