/***********************************************************************/ /* Course: Computer Science 402a */ /* Assignment: Assignment 2 */ /* Instructor: Mark Giesbrecht */ /* Submitted by: Dan Fraser */ /* Student Number: 001219229 */ /* Due Date: Wednesday, February 16 */ /***********************************************************************/ /* Busy.h - interface for the Busy class */ /***********************************************************************/ #ifndef _BUSY_H_ #define _BUSY_H_ #define DAYLEN 160 #include "Meeting.h" #include #include class Busy { public: /************************************************************************ Function Name: Busy - constructor Input Parameters: none Output Parameters: none Description: creates a new instance of Busy ************************************************************************/ Busy(); /************************************************************************ Function Name: allocate Input Parameters: meeting - pointer to Meeting start - integer start time (9am monday + start/15) length - integer meeting length (length / 15) Output Parameters: returns success as boolean Description: allocates time for a new meeting. ************************************************************************/ bool allocate(Meeting *meeting, int start, int length); /************************************************************************ Function Name: deallocate Input Parameters: start - integer start time (9am monday + start/15) length - integer meeting length (length / 15) Output Parameters: returns success as boolean Description: deallocates time ************************************************************************/ bool deallocate(int start, int length); bool deallocate(Meeting *meeting); /************************************************************************ Function Name: check Input Parameters: start - integer start time (9am monday + start/15) length - integer meeting length (length / 15) Output Parameters: returns bool - true if busy, false otherwise Description: checks if user is busy at time(s) ************************************************************************/ bool check(Busy busylist); bool check(int start, int length); /************************************************************************ Function Name: getMeeting Input Parameters: start - integer start time (9am monday + start/15) Output Parameters: returns pointer to Meeting Description: returns Meeting object at a certain time, NULL if no meeting at that time ************************************************************************/ Meeting *getMeeting(int start) { return meetings[start]; } /************************************************************************ Function Name: print Input Parameters: none Output Parameters: none Description: pretty-prints the user's schedule ************************************************************************/ void print(); /************************************************************************ Function Name: realTime Input Parameters: timet - integer start time (9am monday + start/15) Output Parameters: returns real time as string Description: converts internal time to human-readable time ************************************************************************/ string realTime(int time); protected: bool checkTime(int time); private: Meeting *meetings[DAYLEN]; }; #endif