Answers 845
D
{
public:
Person( String name, Person_ID id );
~Person();
Calendar_Class Calendar(); // the access point to add
➥meetings
protected:
Calendar_Class calendar;
Person_ID id;
String name;
};
class Calendar_Class
{
public:
Calendar_Class();
~Calendar_Class();
void Add( const Meeting& ); // add a meeting to the calendar
void Delete( const Meeting& );
Meeting* Lookup( Time ); // see if there is a meeting at the
// given time
Block( Time, Duration, String reason = “” );
// allocate time to yourself...
protected:
OrderedListOfMeeting meetings;
};
class Meeting
{
public:
Meeting( ListOfPerson&, Room room,
Time when, Duration duration, String purpose
= “” );
~Meeting();
protected:
ListOfPerson people;
Room room;
Time when;
Duration duration;
String purpose;
};
You might have used privateinstead of protected. Protected members are cov-
ered on Day 12, “Implementing Inheritance.”
32 0672327112_app_d.qxd 11/19/04 12:30 PM Page 845