home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / octave-1.1.1p1-base.tgz / octave-1.1.1p1-base.tar / fsf / octave / src / SLStack.cc < prev    next >
C/C++ Source or Header  |  1995-01-03  |  2KB  |  122 lines

  1. // SLStack.cc                                           -*- C++ -*-
  2. /*
  3.  
  4. Copyright (C) 1993, 1994, 1995 John W. Eaton
  5.  
  6. This file is part of Octave.
  7.  
  8. Octave is free software; you can redistribute it and/or modify it
  9. under the terms of the GNU General Public License as published by the
  10. Free Software Foundation; either version 2, or (at your option) any
  11. later version.
  12.  
  13. Octave is distributed in the hope that it will be useful, but WITHOUT
  14. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16. for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with Octave; see the file COPYING.  If not, write to the Free
  20. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. */
  23.  
  24. #ifdef HAVE_CONFIG_H
  25. #include "config.h"
  26. #endif
  27.  
  28. #include "SLStack.h"
  29.  
  30. template <class T>
  31. SLStack<T>::SLStack (void) : p ()
  32. {
  33. }
  34.  
  35. template <class T>
  36. SLStack<T>::SLStack (const SLStack<T>& a) : p (a.p)
  37. {
  38. }
  39.  
  40. template <class T>
  41. SLStack<T>::~SLStack (void)
  42. {
  43. }
  44.  
  45. template <class T>
  46. void
  47. SLStack<T>::push (const T& item)
  48. {
  49.   p.prepend (item);
  50. }
  51.  
  52. template <class T>
  53. T
  54. SLStack<T>::pop (void)
  55. {
  56.   return p.remove_front ();
  57. }
  58.  
  59. template <class T>
  60. T&
  61. SLStack<T>::top (void)
  62. {
  63.   return p.front ();
  64. }
  65.  
  66. template <class T>
  67. void
  68. SLStack<T>::del_top (void)
  69. {
  70.   p.del_front ();
  71. }
  72.  
  73. template <class T>
  74. SLStack<T>&
  75. SLStack<T>::operator = (const SLStack<T>& s)
  76. {
  77.   p = s.p;
  78.   return *this;
  79. }
  80.  
  81. template <class T>
  82. int
  83. SLStack<T>::empty (void)
  84. {
  85.   return p.empty ();
  86. }
  87.  
  88. template <class T>
  89. int
  90. SLStack<T>::full (void)
  91. {
  92.   return 0;
  93. }
  94.  
  95. template <class T>
  96. int
  97. SLStack<T>::length (void)
  98. {
  99.   return p.length ();
  100. }
  101.  
  102. template <class T>
  103. int
  104. SLStack<T>::OK (void)
  105. {
  106.   return p.OK ();
  107. }
  108.  
  109. template <class T>
  110. void
  111. SLStack<T>::clear (void)
  112. {
  113.   p.clear ();
  114. }
  115.  
  116. /*
  117. ;;; Local Variables: ***
  118. ;;; mode: C++ ***
  119. ;;; page-delimiter: "^/\\*" ***
  120. ;;; End: ***
  121. */
  122.