Source code of Windows XP (NT5)
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.

87 lines
900 B

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. stack.hxx
  6. Abstract:
  7. Template stack implmentation.
  8. Author:
  9. Steve Kiraly (SteveKi) 11/06/96
  10. Revision History:
  11. --*/
  12. #ifndef _STACK_HXX
  13. #define _STACK_HXX
  14. template<class T>
  15. class TStack {
  16. public:
  17. TStack(
  18. UINT uSize
  19. );
  20. ~TStack(
  21. VOID
  22. );
  23. BOOL
  24. bValid(
  25. VOID
  26. ) const;
  27. BOOL
  28. bPush(
  29. IN T Object
  30. );
  31. BOOL
  32. bPop(
  33. IN OUT T *Object
  34. );
  35. UINT
  36. uSize(
  37. VOID
  38. ) const;
  39. BOOL
  40. bEmpty(
  41. VOID
  42. ) const;
  43. private:
  44. BOOL
  45. bGrow(
  46. IN UINT uSize
  47. );
  48. UINT _uSize;
  49. T *_pStack;
  50. T *_pStackPtr;
  51. };
  52. #if DBG
  53. #define _INLINE
  54. #else
  55. #define _INLINE inline
  56. #endif
  57. #include "stack.inl"
  58. #undef _INLINE
  59. #endif