class System; class User { string myName; System * mySystem; vector <PrivateMessage> mySentMessages; vector <PrivateMessager *> myRecievedMessages; vector <User *> myFriends; public : User (const string & name, System * system = NULL) : myName (name), mySystem (system) { mySentMessages.reserve (20); } void addFriend (User * aFriend) { myFriends.push_back (aFriend); } // addFriend() const string & getName (void) const { return myName; } User * getFriend (unsigned i) const { return myFriends [i]; } const PrivateMessage & getSentMessage (unsigned i) const { return mySentMessages [i]; } const PrivateMessage * getRecievedMessage (unsigned i) const { return myRecievedMessages [i]; } System * getSystem (void) const { return mySystem; } unsigned getNbFriends (void) const { return myFriends.size (); } unsigned getNbSentMessages (void) const { return mySentMessages.size (); } unsigned getNbRecievedMessages (void) const { return myRecievedMessages.size (); } void sendMessage (const PrivateMessage * message) { myRecievedMessages.push_back (message); } // sendMessage() void addMessage (const PrivateMessage & message) { mySentMessages.push_back (message); } }; // User