Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
806 B

/*++
Copyright (C) 1996-2001 Microsoft Corporation
Module Name:
STACK.H
Abstract:
CStack
History:
26-Apr-96 a-raymcc Created.
--*/
#ifndef _STACK_H_
#define _STACK_H_
class CStack
{
DWORD m_dwSize;
DWORD m_dwStackPtr;
DWORD* m_pData;
DWORD m_dwGrowBy;
explicit CStack(const CStack &){};
CStack& operator=(const CStack &){};
public:
CStack(DWORD dwInitSize = 32, DWORD dwGrowBy = 32);
~CStack();
void Push(DWORD);
DWORD Pop() { return m_pData[m_dwStackPtr--]; }
DWORD Peek() { return m_pData[m_dwStackPtr]; }
BOOL IsEmpty() { return m_dwStackPtr == -1; }
DWORD Size() { return m_dwStackPtr + 1; }
void Empty() { m_dwStackPtr = (DWORD) -1; }
};
#endif