// Chap 7, p 323 // Rename this file as QueueL.cpp // ******************************************************** // Implementation file QueueL.cpp for the ADT queue. // ADT list implementation. // ******************************************************** #include "QueueL.h" // header file queueClass::queueClass() { } // end constructor queueClass::queueClass(const queueClass& Q): L(Q.L) { } // end copy constructor queueClass::~queueClass() { } // end destructor boolean queueClass::QueueIsEmpty() { return boolean(L.ListLength() == 0); } // end QueueIsEmpty void queueClass::QueueAdd(queueItemType NewItem, boolean& Success) { L.ListInsert(L.ListLength()+1, NewItem, Success); } // end QueueAdd void queueClass::QueueRemove(boolean& Success) { L.ListDelete(1, Success); // Assertion: If list was empty at entry, Success // is FALSE. } // end QueueRemove void queueClass::GetQueueFront(queueItemType& QueueFront, boolean& Success) { L.ListRetrieve(1, QueueFront, Success); // Assertion: If list was empty at entry, Success // is FALSE. } // end GetQueueFront // End of implementation file.