/*****************************************************************************
* 	Project 	: Network Based Message Queue System		    **
*	Course		: CIS 650 - Software Engineering		    **
*	Location 	: /research/paraducks3/courses/cis650/proj/rt	    **
*	File		: rtdml.h					    **
*	Description 	: Header file containing the data message list class**
*****************************************************************************/

#ifndef RTDML_H
#define RTDML_H

class MesgListItem        /* message object of list */
{
public:  
  Message *mesgPtr;     /* pointer to message object */
  MesgListItem* next;        /* pointer to next item in list */
  MesgListItem(Message *m);/*initialize the list item*/
};

class MesgList             /* message list*/
{
private:
  MesgListItem* first;     /* pointer to the head of the list */
  MesgListItem* last;      /* pointer to the tail */
  MesgListItem* counter;   /* current position of cursor for iteration thru 
			      list*/
public:
  MesgList();              /* constructor*/
  
  void add_item(Message *m); /* add an item to the list*/  
  Message*  delete_item(int key);                  /* delete and return a mes
						      sage of type key */
  int is_empty();                        /* is the list empty */
  
  Message* next();                  /* return the next element in the list */
  int number_of_messages_of_type(int key) ; /* number of messages on the queue
		of a particular type (key) */
  
};

#endif /* RTDML_H */

