//-------------------------------------------------------------------------- // author: George (Jiri) Matas g.matas@ee.surrey.ac.uk //-------------------------------------------------------------------------- //static const //char rcsid[] = "$Id: exQueue.cc,v 1.9 1998/01/18 13:27:29 ees1cg Exp $"; //-------------------------------------------------------------------------- #include #include # include "amma/BlkQueue.hh" //#include "BlkQueue.hh" int main() { BlkDQueueG b; // BlkQueueIterG it(s); // for(;it.IsElm();it.Next()); //iterating through an empty stack OK? //FOR_STACKG(it) ; b.Empty(); for(int i = 0; i <50 ; i++) { b.InsLast(i+5); b.DbPrint(); } cout << "Size: " << b.Size() << '\n'; { for(int i=0;i<12;i++) b.InsFirst(-i); } cout << "Size: " << b.Size() << '\n'; { for(int i=0;i<30;i++) { cout << "Get: " << b.GetFirst() << " -- "; cout << "First:" << b.First() << " : "; cout << "Last: " << b.Last() << '\n'; b.DbPrint(); } } b.Empty(); b.InsLast(-1); b.DbPrint(); b.DelFirst(); //b.GetFirst(); b.DbPrint(); b.InsLast(-2); b.DbPrint(); #if 0 //---------------- Check iterators ----------------------------- FOR_STACKG(it) cout << it.Data() << ' '; cout<< '\n'; while(!b.IsEmpty()) { b.Pop(); b.DbPrint(); } cout << "Size: " << b.Size() << '\n'; #endif return 0; }