#include "simul.h" /* * Some other queue structures neede by the operation. */ jobQClass::jobQClass() { head = tail = NULL; } boolean jobQClass::Empty() { if (head == NULL) return TRUE; else return FALSE; } void jobQClass::Enqueue(jobType job) { jobType *tmp; tmp = new jobType; (*tmp) = job; tmp->next = NULL; if (Empty() == TRUE) { head = tmp; tail = tmp; } else { tail->next = tmp; tail = tail->next; } } jobType jobQClass::Front() { if (Empty() == TRUE) { cerr << " job queue empty when front \n"; exit(1); } return (*head); } void jobQClass::Dequeue() { jobType *tmp; if (Empty() == TRUE) { cerr << "queue empty when dequeue in queue_t \n"; exit(1); } tmp = head; head = head->next; tmp = NULL; delete tmp; }