Gel2D - The free/open source game creation suite

gelQueue.h
Go to the documentation of this file.
00001 /*
00002 Gel2D Game Engine - Cross-platform 2D gaming middleware
00003 Copyright (C) 2011 Mark D. Procarione
00004 
00005 Gel2D is free software: you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation, either version 3 of the License, or
00008 (at your option) any later version.
00009 
00010 Gel2D is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013 GNU General Public License for more details.
00014 */
00015 
00016 #ifndef __GELQUEUE_H__
00017 #define __GELQUEUE_H__
00018 
00019 #include "gelLinkedList.h"
00020 
00021 namespace gel
00022 {
00025 
00026         template <class dType> class GelQueue : public GelLinkedList<dType>
00027         {
00028                 public:
00030 
00031                         GelQueue() {}
00032 
00034                         ~GelQueue() {}
00035 
00037 
00038                         void enqueue( const dType &item ) { this->append(item); }
00039 
00041 
00042                         dType dequeue() { return this->takeFirst(); }
00043 
00045 
00046                         dType peek() { return this->getFirst(); }
00047 
00049 
00050                         const dType peek() const { return this->getFirst(); }
00051         };
00053 }
00054 
00055 #endif // __GELQUEUE_H__