00001 /* 00002 Copyright (c) 2000-2003 Lee Thomason (www.grinninglizard.com) 00003 00004 Grinning Lizard Utilities. Note that software that uses the 00005 utility package (including Lilith3D and Kyra) have more restrictive 00006 licences which applies to code outside of the utility package. 00007 00008 00009 This software is provided 'as-is', without any express or implied 00010 warranty. In no event will the authors be held liable for any 00011 damages arising from the use of this software. 00012 00013 Permission is granted to anyone to use this software for any 00014 purpose, including commercial applications, and to alter it and 00015 redistribute it freely, subject to the following restrictions: 00016 00017 1. The origin of this software must not be misrepresented; you must 00018 not claim that you wrote the original software. If you use this 00019 software in a product, an acknowledgment in the product documentation 00020 would be appreciated but is not required. 00021 00022 2. Altered source versions must be plainly marked as such, and 00023 must not be misrepresented as being the original software. 00024 00025 3. This notice may not be removed or altered from any source 00026 distribution. 00027 */ 00028 00029 /* 00030 00031 #ifndef GL_STACK_INCLUDED 00032 #define GL_STACK_INCLUDED 00033 00034 00035 #include "dynarray.h" 00036 00037 template <class T> 00038 class GlStack 00039 { 00040 public: 00041 00042 GlStack( int size ) : array( size ) 00043 {} 00044 00045 void Push( T data ) { array.PushBack( data ); } 00046 T Pop() { return array.PopBack(); } 00047 bool Empty() { return array.Count() == 0; } 00048 T Top() { return array[ array.Count() - 1 ]; } 00049 00050 private: 00051 KrDynArray< T > array; 00052 00053 00054 #endif 00055 */