/***********************************************************************/ /* Course: Computer Science 402a */ /* Assignment: Assignment 2 */ /* Instructor: Mark Giesbrecht */ /* Submitted by: Dan Fraser */ /* Student Number: 001219229 */ /* Due Date: Wednesday, February 16 */ /***********************************************************************/ /* HostInfo.h - Interface for HostInfo networking class */ /***********************************************************************/ #ifndef _HOSTINFO_H_ #define _HOSTINFO_H_ #include class HostInfo { public: /************************************************************************ Function Name: HostInfo - constructor Input Parameters: realname - string specifying user's real name hostname - string specifying user's host name port - integer specifying user's port Output Parameters: n/a Description: creates and initializes HostInfo object ************************************************************************/ HostInfo(string realname, string hostname, int port); virtual ~HostInfo() {}; /************************************************************************ Function Name: accessor methods Input Parameters: n/a n/a Output Parameters: returns values or refs where appropriate Description: n/a ************************************************************************/ virtual string getHostname() { return _hostname; }; virtual string &setHostname() { return _hostname; }; virtual string getRealname() { return _realname; }; virtual string &setRealname() { return _realname; }; virtual int getUID() { return _uid; }; virtual int &setUID() { return _uid; }; virtual int getPort() { return _port; }; virtual int &setPort() { return _port; }; virtual int getSerial(); bool operator== (HostInfo); bool operator!= (int); private: static int _serial; // serial number int _uid; // user id string _realname; // user's real time string _hostname; // user's host name int _port; // user's port number }; #endif