class WaitItem {
public:
  int type;              /* type of the message a process is waiting for */
  int sockFd;         /* the socket descriptor the process communicates thru*/
  WaitItem(int ty,int sockId); /* constructor */
  WaitItem(int ty); /* constructor */
};

class WaitListItem      /* an item of the waitlist */
{
public: 
  WaitItem*    waitItemPtr; /*pointer to wait Item*/
  WaitListItem* next;      /* pointer to next element  on list */
  WaitListItem(int ty, int sfd); /* constructor */
  WaitListItem(int ty);         /* constructor*/
  
  WaitListItem();      /* constructor to create a dummy item */
 
};

class WaitList
{                  /* list of waiting processes */
private:
  WaitListItem* first;   /* pointer to the head of the list */
  WaitListItem* last;    /* pointer to the tail */
  WaitListItem* counter; /* counter for iteration */
public:
  WaitList();
  
  void add_item(int key,int sockId); /* add a waiting process to list */
  WaitItem* delete_item(int key);         /* delete a process with type = key */
  int is_empty();                    /* is the list empty */
  WaitItem* next();                        /* return the next key */
  
  void reset();                      /* reset the counter to the head*/
};                                          /* of the list */
