- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/Configs/TI_DSP_BIOS/stl/stl_stack.h

    00001 /*
    00002  *
    00003  * Copyright (c) 1994
    00004  * Hewlett-Packard Company
    00005  *
    00006  * Permission to use, copy, modify, distribute and sell this software
    00007  * and its documentation for any purpose is hereby granted without fee,
    00008  * provided that the above copyright notice appear in all copies and
    00009  * that both that copyright notice and this permission notice appear
    00010  * in supporting documentation.  Hewlett-Packard Company makes no
    00011  * representations about the suitability of this software for any
    00012  * purpose.  It is provided "as is" without express or implied warranty.
    00013  *
    00014  *
    00015  * Copyright (c) 1996,1997
    00016  * Silicon Graphics Computer Systems, Inc.
    00017  *
    00018  * Permission to use, copy, modify, distribute and sell this software
    00019  * and its documentation for any purpose is hereby granted without fee,
    00020  * provided that the above copyright notice appear in all copies and
    00021  * that both that copyright notice and this permission notice appear
    00022  * in supporting documentation.  Silicon Graphics makes no
    00023  * representations about the suitability of this software for any
    00024  * purpose.  It is provided "as is" without express or implied warranty.
    00025  */
    00026
    00027 /* NOTE: This is an internal header file, included by other STL headers.
    00028  *   You should not attempt to use it directly.
    00029  */
    00030
    00031 #ifndef __SGI_STL_INTERNAL_STACK_H
    00032 #define __SGI_STL_INTERNAL_STACK_H
    00033
    00034 __STL_BEGIN_NAMESPACE
    00035
    00036 #ifndef __STL_LIMITED_DEFAULT_TEMPLATES
    00037 template <class _Tp, class _Sequence = deque<_Tp> >
    00038 #else
    00039 template <class _Tp, class _Sequence>
    00040 #endif
    00041 class stack {
    00042   friend bool operator== __STL_NULL_TMPL_ARGS (const stack&, const stack&);
    00043   friend bool operator< __STL_NULL_TMPL_ARGS (const stack&, const stack&);
    00044 public:
    00045   typedef typename _Sequence::value_type      value_type;
    00046   typedef typename _Sequence::size_type       size_type;
    00047   typedef          _Sequence                  container_type;
    00048
    00049   typedef typename _Sequence::reference       reference;
    00050   typedef typename _Sequence::const_reference const_reference;
    00051 protected:
    00052   _Sequence _M_c;
    00053 public:
    00054   stack() : _M_c() {}
    00055   explicit stack(const _Sequence& __s) : _M_c(__s) {}
    00056
    00057   bool empty() const { return _M_c.empty(); }
    00058   size_type size() const { return _M_c.size(); }
    00059   reference top() { return _M_c.back(); }
    00060   const_reference top() const { return _M_c.back(); }
    00061   void push(const value_type& __x) { _M_c.push_back(__x); }
    00062   void pop() { _M_c.pop_back(); }
    00063 };
    00064
    00065 template <class _Tp, class _Seq>
    00066 bool operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
    00067 {
    00068   return __x._M_c == __y._M_c;
    00069 }
    00070
    00071 template <class _Tp, class _Seq>
    00072 bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
    00073 {
    00074   return __x._M_c < __y._M_c;
    00075 }
    00076
    00077 #ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
    00078
    00079 template <class _Tp, class _Seq>
    00080 bool operator!=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
    00081 {
    00082   return !(__x == __y);
    00083 }
    00084
    00085 template <class _Tp, class _Seq>
    00086 bool operator>(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
    00087 {
    00088   return __y < __x;
    00089 }
    00090
    00091 template <class _Tp, class _Seq>
    00092 bool operator<=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
    00093 {
    00094   return !(__y < __x);
    00095 }
    00096
    00097 template <class _Tp, class _Seq>
    00098 bool operator>=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
    00099 {
    00100   return !(__x < __y);
    00101 }
    00102
    00103 #endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
    00104
    00105 __STL_END_NAMESPACE
    00106
    00107 #endif /* __SGI_STL_INTERNAL_STACK_H */
    00108
    00109 // Local Variables:
    00110 // mode:C++
    00111 // End: