home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / stlport / stl / _slist_base.h < prev    next >
C/C++ Source or Header  |  2001-01-26  |  3KB  |  88 lines

  1. /*
  2.  *
  3.  * Copyright (c) 1996,1997
  4.  * Silicon Graphics Computer Systems, Inc.
  5.  *
  6.  * Copyright (c) 1997
  7.  * Moscow Center for SPARC Technology
  8.  *
  9.  * Copyright (c) 1999 
  10.  * Boris Fomitchev
  11.  *
  12.  * This material is provided "as is", with absolutely no warranty expressed
  13.  * or implied. Any use is at your own risk.
  14.  *
  15.  * Permission to use or copy this software for any purpose is hereby granted 
  16.  * without fee, provided the above notices are retained on all copies.
  17.  * Permission to modify the code and to distribute modified code is granted,
  18.  * provided the above notices are retained, and a notice that the code was
  19.  * modified is included with the above copyright notice.
  20.  *
  21.  */
  22.  
  23. /* NOTE: This is an internal header file, included by other STL headers.
  24.  *   You should not attempt to use it directly.
  25.  */
  26.  
  27. #ifndef _STLP_INTERNAL_SLIST_BASE_H
  28. #define _STLP_INTERNAL_SLIST_BASE_H
  29.  
  30. #ifndef _STLP_CSTDDEF
  31. #include <cstddef>
  32. #endif
  33.  
  34. _STLP_BEGIN_NAMESPACE 
  35.  
  36. struct _Slist_node_base
  37. {
  38.   _Slist_node_base* _M_next;
  39. };
  40.  
  41. inline _Slist_node_base*
  42. __slist_make_link(_Slist_node_base* __prev_node,
  43.                   _Slist_node_base* __new_node)
  44. {
  45.   __new_node->_M_next = __prev_node->_M_next;
  46.   __prev_node->_M_next = __new_node;
  47.   return __new_node;
  48. }
  49.  
  50.  
  51. template <class _Dummy>
  52. class _Sl_global {
  53. public:
  54.   // those used to be global functions 
  55.   // moved here to reduce code bloat without templatizing _Slist_iterator_base
  56.   static size_t _STLP_CALL size(_Slist_node_base* __node);
  57.   static _Slist_node_base* _STLP_CALL __reverse(_Slist_node_base* __node);
  58.   static void _STLP_CALL __splice_after(_Slist_node_base* __pos,
  59.                                         _Slist_node_base* __before_first,
  60.                                         _Slist_node_base* __before_last);
  61.   
  62.   static void _STLP_CALL __splice_after(_Slist_node_base* __pos, _Slist_node_base* __head);
  63.  
  64.   static _Slist_node_base* _STLP_CALL __previous(_Slist_node_base* __head,
  65.                                                  const _Slist_node_base* __node);
  66.   static const _Slist_node_base* _STLP_CALL __previous(const _Slist_node_base* __head,
  67.                         const _Slist_node_base* __node) {
  68.     return _Sl_global<_Dummy>::__previous((_Slist_node_base*)__head, __node);
  69.   }
  70. };
  71.  
  72. # if defined (_STLP_USE_TEMPLATE_EXPORT) 
  73. _STLP_EXPORT_TEMPLATE_CLASS _Sl_global<bool>;
  74. # endif
  75. typedef _Sl_global<bool> _Sl_global_inst;
  76.  
  77. _STLP_END_NAMESPACE
  78.  
  79. # if !defined (_STLP_LINK_TIME_INSTANTIATION)
  80. #  include <stl/_slist_base.c>
  81. # endif
  82.  
  83. #endif /* _STLP_INTERNAL_SLIST_BASE_H */
  84.  
  85. // Local Variables:
  86. // mode:C++
  87. // End:
  88.