ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

_stack.h
Go to the documentation of this file.
00001 /*
00002  *
00003  * Copyright (c) 1994
00004  * Hewlett-Packard Company
00005  *
00006  * Copyright (c) 1996,1997
00007  * Silicon Graphics Computer Systems, Inc.
00008  *
00009  * Copyright (c) 1997
00010  * Moscow Center for SPARC Technology
00011  *
00012  * Copyright (c) 1999
00013  * Boris Fomitchev
00014  *
00015  * This material is provided "as is", with absolutely no warranty expressed
00016  * or implied. Any use is at your own risk.
00017  *
00018  * Permission to use or copy this software for any purpose is hereby granted
00019  * without fee, provided the above notices are retained on all copies.
00020  * Permission to modify the code and to distribute modified code is granted,
00021  * provided the above notices are retained, and a notice that the code was
00022  * modified is included with the above copyright notice.
00023  *
00024  */
00025 
00026 /* NOTE: This is an internal header file, included by other STL headers.
00027  *   You should not attempt to use it directly.
00028  */
00029 
00030 #ifndef _STLP_INTERNAL_STACK_H
00031 #define _STLP_INTERNAL_STACK_H
00032 
00033 #ifndef _STLP_INTERNAL_DEQUE_H
00034 #  include <stl/_deque.h>
00035 #endif
00036 
00037 _STLP_BEGIN_NAMESPACE
00038 
00039 #if !defined ( _STLP_LIMITED_DEFAULT_TEMPLATES )
00040 template <class _Tp, class _Sequence = deque<_Tp> >
00041 #elif defined ( _STLP_MINIMUM_DEFAULT_TEMPLATE_PARAMS )
00042 #  define _STLP_STACK_ARGS _Tp
00043 template <class _Tp>
00044 #else
00045 template <class _Tp, class _Sequence>
00046 #endif
00047 class stack
00048 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
00049 #  if defined (_STLP_STACK_ARGS)
00050             : public __stlport_class<stack<_Tp> >
00051 #  else
00052             : public __stlport_class<stack<_Tp, _Sequence> >
00053 #  endif
00054 #endif
00055 {
00056 #ifdef _STLP_STACK_ARGS
00057   typedef deque<_Tp> _Sequence;
00058   typedef stack<_Tp> _Self;
00059 #else
00060   typedef stack<_Tp, _Sequence> _Self;
00061 #endif
00062 
00063 public:
00064   typedef typename _Sequence::value_type      value_type;
00065   typedef typename _Sequence::size_type       size_type;
00066   typedef          _Sequence                  container_type;
00067 
00068   typedef typename _Sequence::reference       reference;
00069   typedef typename _Sequence::const_reference const_reference;
00070 protected:
00071   //c is a Standard name (23.2.3.3), do no make it STLport naming convention compliant.
00072   _Sequence c;
00073 public:
00074   stack() : c() {}
00075   explicit stack(const _Sequence& __s) : c(__s) {}
00076 
00077 #if !defined (_STLP_NO_MOVE_SEMANTIC)
00078   stack(__move_source<_Self> src)
00079     : c(_STLP_PRIV _AsMoveSource(src.get().c)) {}
00080 #endif
00081 
00082   bool empty() const { return c.empty(); }
00083   size_type size() const { return c.size(); }
00084   reference top() { return c.back(); }
00085   const_reference top() const { return c.back(); }
00086   void push(const value_type& __x) { c.push_back(__x); }
00087   void pop() { c.pop_back(); }
00088   const _Sequence& _Get_s() const { return c; }
00089 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
00090   void _M_swap_workaround(_Self& __x) {
00091     _Sequence __tmp = c;
00092     c = __x.c;
00093     __x.c = __tmp;
00094   }
00095 #endif
00096 };
00097 
00098 #ifndef _STLP_STACK_ARGS
00099 #  define _STLP_STACK_ARGS _Tp, _Sequence
00100 #  define _STLP_STACK_HEADER_ARGS class _Tp, class _Sequence
00101 #else
00102 #  define _STLP_STACK_HEADER_ARGS class _Tp
00103 #endif
00104 
00105 template < _STLP_STACK_HEADER_ARGS >
00106 inline bool _STLP_CALL  operator==(const stack< _STLP_STACK_ARGS >& __x,
00107                                    const stack< _STLP_STACK_ARGS >& __y)
00108 { return __x._Get_s() == __y._Get_s(); }
00109 
00110 template < _STLP_STACK_HEADER_ARGS >
00111 inline bool _STLP_CALL  operator<(const stack< _STLP_STACK_ARGS >& __x,
00112                                   const stack< _STLP_STACK_ARGS >& __y)
00113 { return __x._Get_s() < __y._Get_s(); }
00114 
00115 _STLP_RELOPS_OPERATORS(template < _STLP_STACK_HEADER_ARGS >, stack< _STLP_STACK_ARGS >)
00116 
00117 #undef _STLP_STACK_ARGS
00118 #undef _STLP_STACK_HEADER_ARGS
00119 
00120 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_NO_MOVE_SEMANTIC)
00121 template <class _Tp, class _Sequence>
00122 struct __move_traits<stack<_Tp, _Sequence> > :
00123   _STLP_PRIV __move_traits_aux<_Sequence>
00124 {};
00125 #endif
00126 
00127 _STLP_END_NAMESPACE
00128 
00129 #endif /* _STLP_INTERNAL_STACK_H */
00130 
00131 // Local Variables:
00132 // mode:C++
00133 // End:

Generated on Sat May 26 2012 04:28:08 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.