/***********************************************************************/ /* Course: Computer Science 402a */ /* Assignment: Assignment 2 */ /* Instructor: Mark Giesbrecht */ /* Submitted by: Dan Fraser */ /* Student Number: 001219229 */ /* Due Date: Wednesday, February 16 */ /***********************************************************************/ /* calendar.h - Calendar interface description t */ /***********************************************************************/ #ifndef _CALENDAR_H_ #define _CALENDAR_H_ #define REQUEST_SIZE 1024 #include "nameserver.h" #include "StreamSocket.h" #include "HostInfo.h" #include #include #include #include "Meeting.h" #include "Busy.h" #include "cal_server.h" #include "globals.h" /************************************************************************ Function Name: uid_lookup Input Parameters: port - nameserver port number (n/a in rpc version) uid - integer uid to look up Output Parameters: returns HostInfo object with user info Description: contacts nameserver and looks up UID. ************************************************************************/ HostInfo uid_lookup(int port, int uid); /************************************************************************ Function Name: name_lookup Input Parameters: port - nameserver port number (n/a in rpc version) name - string name to look up Output Parameters: returns HostInfo object with user info Description: contacts nameserver and looks up info by name ************************************************************************/ HostInfo name_lookup(int port, string name); /************************************************************************ Function Name: check_times Input Parameters: request - request string to send to server HostInfo - contains information on how to contact server Output Parameters: returns list of times which are valid Description: contacts remote user server and checks if times in request are valid ************************************************************************/ vector check_times(string request, HostInfo host); /************************************************************************ Function Name: send_request Input Parameters: request - request string to send to remote server host - HostInfo object with info on how to connect to remote Output Parameters: returns success as boolean Description: connects to remote server and sends request string ************************************************************************/ bool send_request(string request, HostInfo host); /************************************************************************ Function Name: print_menu Input Parameters: n/a Output Parameters: n/a Description: prints the menu ************************************************************************/ void print_menu(); /************************************************************************ Function Name: request_meeting Input Parameters: n/a Output Parameters: n/a Description: gets meeting time and uid's from user, checks to see if times and uids are valid, and tries to book the meeting with all involved remote users. ************************************************************************/ void request_meeting(); /************************************************************************ Function Name: cancel_meeting Input Parameters: n/a Output Parameters: n/a Description: checks to see if this user is the origiator, if so, cancels meeting and sends cancel requests to all other involved remote servers. ************************************************************************/ void cancel_meeting(); #endif