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.

142 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. intstack.hxx
  5. Abstract:
  6. This class implements a linked list integer stack.
  7. Author:
  8. Norbert P. Kusters (norbertk) 28-Dec-90
  9. --*/
  10. #if !defined(INTSTACK_DEFN)
  11. #define INTSTACK_DEFN
  12. #include "bigint.hxx"
  13. #if defined ( _AUTOCHECK_ )
  14. #define IFSUTIL_EXPORT
  15. #elif defined ( _IFSUTIL_MEMBER_ )
  16. #define IFSUTIL_EXPORT __declspec(dllexport)
  17. #else
  18. #define IFSUTIL_EXPORT __declspec(dllimport)
  19. #endif
  20. DECLARE_CLASS( INTSTACK );
  21. DEFINE_TYPE( struct _INTNODE, INTNODE );
  22. struct _INTNODE {
  23. PINTNODE Next;
  24. BIG_INT Data;
  25. };
  26. class INTSTACK : public OBJECT {
  27. public:
  28. IFSUTIL_EXPORT
  29. DECLARE_CONSTRUCTOR( INTSTACK );
  30. VIRTUAL
  31. IFSUTIL_EXPORT
  32. ~INTSTACK(
  33. );
  34. NONVIRTUAL
  35. IFSUTIL_EXPORT
  36. BOOLEAN
  37. Initialize(
  38. );
  39. NONVIRTUAL
  40. IFSUTIL_EXPORT
  41. BOOLEAN
  42. Push(
  43. IN BIG_INT Data
  44. );
  45. NONVIRTUAL
  46. IFSUTIL_EXPORT
  47. VOID
  48. Pop(
  49. IN ULONG HowMany DEFAULT 1
  50. );
  51. NONVIRTUAL
  52. IFSUTIL_EXPORT
  53. BIG_INT
  54. Look(
  55. IN ULONG Index DEFAULT 0
  56. ) CONST;
  57. NONVIRTUAL
  58. ULONG
  59. QuerySize(
  60. ) CONST;
  61. NONVIRTUAL
  62. BOOLEAN
  63. IsMember(
  64. IN BIG_INT Data
  65. ) CONST;
  66. NONVIRTUAL
  67. IFSUTIL_EXPORT
  68. BOOLEAN
  69. ReverseCopy(
  70. IN PINTSTACK x
  71. );
  72. private:
  73. NONVIRTUAL
  74. VOID
  75. Construct (
  76. );
  77. NONVIRTUAL
  78. VOID
  79. Destroy(
  80. );
  81. PINTNODE _stack;
  82. ULONG _size;
  83. };
  84. INLINE
  85. ULONG
  86. INTSTACK::QuerySize(
  87. ) CONST
  88. /*++
  89. Routine Description:
  90. This routine computes the number of elements in the stack.
  91. Arguments:
  92. None.
  93. Return Value:
  94. The number of elements in the stack.
  95. --*/
  96. {
  97. return _size;
  98. }
  99. #endif // INTSTACK_DEFN