//+----------------------------------------------------------------------+
//|								    DAPsim								 |
//| Dean Morrison												11/30/06 |
//| University of Florida												 |
//| Department of Electrical and Computer Engineering					 |
//+----------------------------------------------------------------------+
//| Description: DAPsim is a trace-driven simulator developed in C++ for |
//| the purpose of designing, testing, and evaluating demand prepaging 	 |
//| policies.  It currently implements my proposed concept of Dynamically|
//| Adaptive Prepaging, but may be modified to evaluate many other 		 |
//| policies.															 |
//|																		 |
//| Reuse Policy: Use of this software for personal or instructional	 |
//| purposes is granted without fee provided that the source bears a	 |
//| clear and complete citation.										 |
//+----------------------------------------------------------------------+

#ifndef LRU_PAGEQ_H_
#define LRU_PAGEQ_H_

#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <list>
#include <map>
#include <math.h>

#include "main.h"
#include "LRU_pageQ_entry.h"

using namespace std;

class LRU_pageQ {
private:
	int size;
	int maxSize;
	list<LRU_pageQ_entry> queue;
	LRU_pageQ_entry LRU_entry;
	LRU_pageQ_entry MRU_entry;

public:
	LRU_pageQ();
	LRU_pageQ(int newMaxSize);

	void setMaxSize(int newMaxSize);

	int getSize(void);
	int getMaxSize(void);
	LRU_pageQ_entry getLRU_entry(void);
	LRU_pageQ_entry getMRU_entry(void);

	void pushMRU(unsigned long int newPage);
	LRU_pageQ_entry popLRU(void);

	//bool referenceUsedPage(long int pageNumber);
	//LRU_pageQ_entry referencePrepagedPage(long int pageNumber);

	void addUsedPage(unsigned long int newPage);
	void addPrepagedPage(unsigned long int newPage);

	void evictPage(void);

	list<LRU_pageQ_entry> * getQueue(void);

	bool pagePresentInQ(unsigned long int pageNumber);
};

#endif