/////////////////////////////////////////////////////////////// // mtqueue.cpp - template-based thread-safe queue // // ver 3.1 // // // // Language: Visual C++, ver 6.0 // // Platform: Micron Dual Pentium Pro 200, Win NT 4.0 // // Application: CSE691 - Project #3 prototype // // Author: Jim Fawcett, CST 2-187, Syracuse Univ // // (315) 443-3948, fawcett@syr.edu // /////////////////////////////////////////////////////////////// #include "mtqueue.h" #ifdef TEST_MTQUEUE //----< test stub >-------------------------------------------- #include using namespace std; void main() { cout << "\n" << "\n Testing Queues Based on Doubly Linked Lists" << "\n =============================================\n\n"; mtqueue iq; int i; for(i=0; i<5; i++) iq.enQ(4-i); cout << " "; while(iq.length() > 0) cout << iq.deQ() << ' '; cout << "\n\n"; mtqueue dq; for(i=0; i<5; i++) { dq.enQ(i+0.5); } cout << " "; while(dq.length() > 0) cout << dq.deQ() << ' '; cout << "\n\n"; mtqueue sq; sq.enQ(string("aardvark")); sq.enQ(string("platypus")); sq.enQ(string("equine ")); sq.enQ(string("feline ")); cout << " "; while(sq.length() > 0) { cout << sq.deQ() << " "; } cout << "\n\n"; } #endif