home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP10-8.ZIP / CLASSINC.ZIP / STACK.H < prev    next >
C/C++ Source or Header  |  1990-09-26  |  2KB  |  117 lines

  1. #ifndef __STACK_H
  2. #define __STACK_H
  3.  
  4. //
  5. // This file contains proprietary information of Borland International.
  6. // Copying or reproduction without prior written approval is prohibited.
  7. //
  8. // Copyright (c) 1990
  9. // Borland International
  10. // 1800 Scotts Valley Dr.
  11. // Scotts Valley, CA 95066
  12. // (408) 438-8400
  13. //
  14.  
  15. // Contents ----------------------------------------------------------------
  16. //
  17. //      Stack
  18. //
  19. // Description
  20. //
  21. //      Defines the class Stack.
  22. //
  23. // End ---------------------------------------------------------------------
  24.  
  25. // Interface Dependencies ---------------------------------------------------
  26.  
  27. #ifndef __IOSTREAM_H
  28. #include <iostream.h>
  29. #define __IOSTREAM_H
  30. #endif
  31.  
  32. #ifndef __CLSTYPES_H
  33. #include <clstypes.h>
  34. #endif
  35.  
  36. #ifndef __OBJECT_H
  37. #include <object.h>
  38. #endif
  39.  
  40. #ifndef __CONTAIN_H
  41. #include <contain.h>
  42. #endif
  43.  
  44. #ifndef __LIST_H
  45. #include <list.h>
  46. #endif
  47.  
  48. // End Interface Dependencies ------------------------------------------------
  49.  
  50. // Class //
  51.  
  52. class Stack:  public Container
  53. {
  54. public:
  55.     virtual ~Stack();
  56.  
  57.             void            push( Object& );
  58.             Object&         pop();
  59.             Object&         top() const;
  60.     virtual int             isEmpty() const;
  61.  
  62.     virtual ContainerIterator& initIterator() const;
  63.  
  64.     virtual classType       isA() const;
  65.     virtual char           *nameOf() const;
  66.     virtual hashValueType   hashValue() const;
  67.  
  68. private:
  69.     List    theStack;
  70. };
  71.  
  72. // Description -------------------------------------------------------------
  73. //
  74. //     Defines the container class Stack.
  75. //
  76. // Public Members
  77. //
  78. //     push
  79. //
  80. //     Pushes an object on the stack.
  81. //
  82. //     pop
  83. // 
  84. //     Pops an object from the stack and delivers that object into the
  85. //      ownership of the receiver.
  86. //
  87. //      top
  88. //
  89. //      Returns a refrence to the object on the top of the stack.  The
  90. //      object remains in the ownership of the stack.  You must make 
  91. //      sure not to destroy this object while it is still owned by the stack.
  92. //
  93. //      initIterator
  94. //
  95. //      Stack iterator initializer.
  96. //
  97. //     isA
  98. //
  99. //     Returns the class type for a stack.
  100. //
  101. //     nameOf
  102. //
  103. //     Returns a pointer to the character string "Stack."
  104. //     
  105. //     hashValue
  106. //
  107. //     Returns a pre-defined value for stacks.
  108. //
  109. //     isEmpty
  110. //
  111. //     Returns whether the stack is empty.
  112. //
  113. // End ---------------------------------------------------------------------
  114.  
  115. #endif  // __STACK_H
  116.  
  117.