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

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. STACK.H
  5. Abstract:
  6. CStack
  7. History:
  8. 26-Apr-96 a-raymcc Created.
  9. --*/
  10. #ifndef _STACK_H_
  11. #define _STACK_H_
  12. class CStack
  13. {
  14. DWORD m_dwSize;
  15. DWORD m_dwStackPtr;
  16. DWORD* m_pData;
  17. DWORD m_dwGrowBy;
  18. explicit CStack(const CStack &){};
  19. CStack& operator=(const CStack &){};
  20. public:
  21. CStack(DWORD dwInitSize = 32, DWORD dwGrowBy = 32);
  22. ~CStack();
  23. void Push(DWORD);
  24. DWORD Pop() { return m_pData[m_dwStackPtr--]; }
  25. DWORD Peek() { return m_pData[m_dwStackPtr]; }
  26. BOOL IsEmpty() { return m_dwStackPtr == -1; }
  27. DWORD Size() { return m_dwStackPtr + 1; }
  28. void Empty() { m_dwStackPtr = (DWORD) -1; }
  29. };
  30. #endif