From 941d4c066f542ea6961f50d2bb03d5f879d55c7b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 15 Aug 2006 20:28:18 +0000 Subject: [PATCH] added this helper --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40283 --- sourcehook/sh_stack.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sourcehook/sh_stack.h b/sourcehook/sh_stack.h index ff03166..1f330b6 100644 --- a/sourcehook/sh_stack.h +++ b/sourcehook/sh_stack.h @@ -1,12 +1,12 @@ /* ======== SourceMM ======== -* Copyright (C) 2004-2005 Metamod:Source Development Team -* No warranties of any kind -* -* License: zlib/libpng -* -* Author(s): Pavol "PM OnoTo" Marko -* ============================ -*/ + * Copyright (C) 2004-2006 Metamod:Source Development Team + * No warranties of any kind + * + * License: zlib/libpng + * + * Author(s): Pavol "PM OnoTo" Marko + * ============================ + */ #ifndef __SH_STACK_H__ #define __SH_STACK_H__ @@ -159,11 +159,17 @@ namespace SourceHook m_Elements[m_UsedSize++] = val; return true; } + void pop() { --m_UsedSize; } + void popall() + { + m_UsedSize = 0; + } + T &front() { return m_Elements[m_UsedSize - 1];