#ifndef _graph_h_
#define _graph_h_

#include <string>
#include <iostream>
#include <list>
#include <vector>

using std::string;
using std::ostream;
using std::list;
using std::vector;

// a promise to define these classes later
class Person;
class Message;

// A graph stores a vector of all the people currently logged on and a
// vector of all the messages in the system.  People are added and
// removed from the system.  Friendships are established between
// people.  Messages can be added and passed randomly within the
// network.  The current state of the system can be printed (using the
// output << operator).  The invitation list of a certain depth of
// friends from a given person can also be printed.

class Graph {

public:
  // CONSTRUCTOR & DESTRUCTOR
  Graph();
  ~Graph();

  // ACCESSORS
  Person* find_person(const string &name) const;

  // MODIFIERS
  // These functions return false if the operation was not
  // successfully completed.
  bool add_person(const string& person_name);
  bool remove_person(const string& person_name);
  bool add_friendship(const string& person_name1, const string& person_name2);
  bool add_message(const string& person_name, const string& message);
  void pass_messages_randomly();

  // OUTPUT
  friend ostream& operator<<(ostream &ostr, const Graph &friend_graph);
  bool print_invite_list(ostream &ostr, const string &name, int n) const;

private:

  // REPRESENTATION
  vector<Person*> m_people;
  vector<Message*> m_messages;
};

#endif

