_slist_base.h

00001 /*
00002  *
00003  * Copyright (c) 1996,1997
00004  * Silicon Graphics Computer Systems, Inc.
00005  *
00006  * Copyright (c) 1997
00007  * Moscow Center for SPARC Technology
00008  *
00009  * Copyright (c) 1999 
00010  * Boris Fomitchev
00011  *
00012  * This material is provided "as is", with absolutely no warranty expressed
00013  * or implied. Any use is at your own risk.
00014  *
00015  * Permission to use or copy this software for any purpose is hereby granted 
00016  * without fee, provided the above notices are retained on all copies.
00017  * Permission to modify the code and to distribute modified code is granted,
00018  * provided the above notices are retained, and a notice that the code was
00019  * modified is included with the above copyright notice.
00020  *
00021  */
00022 
00023 /* NOTE: This is an internal header file, included by other STL headers.
00024  *   You should not attempt to use it directly.
00025  */
00026 
00027 #ifndef _STLP_INTERNAL_SLIST_BASE_H
00028 #define _STLP_INTERNAL_SLIST_BASE_H
00029 
00030 #ifndef _STLP_CSTDDEF
00031 #include <cstddef>
00032 #endif
00033 
00034 _STLP_BEGIN_NAMESPACE 
00035 
00036 struct _Slist_node_base
00037 {
00038   _Slist_node_base* _M_next;
00039 };
00040 
00041 inline _Slist_node_base*
00042 __slist_make_link(_Slist_node_base* __prev_node,
00043                   _Slist_node_base* __new_node)
00044 {
00045   __new_node->_M_next = __prev_node->_M_next;
00046   __prev_node->_M_next = __new_node;
00047   return __new_node;
00048 }
00049 
00050 
00051 template <class _Dummy>
00052 class _Sl_global {
00053 public:
00054   // those used to be global functions 
00055   // moved here to reduce code bloat without templatizing _Slist_iterator_base
00056   static size_t _STLP_CALL size(_Slist_node_base* __node);
00057   static _Slist_node_base* _STLP_CALL __reverse(_Slist_node_base* __node);
00058   static void _STLP_CALL __splice_after(_Slist_node_base* __pos,
00059                                         _Slist_node_base* __before_first,
00060                                         _Slist_node_base* __before_last);
00061   
00062   static void _STLP_CALL __splice_after(_Slist_node_base* __pos, _Slist_node_base* __head);
00063 
00064   static _Slist_node_base* _STLP_CALL __previous(_Slist_node_base* __head,
00065                                                  const _Slist_node_base* __node);
00066   static const _Slist_node_base* _STLP_CALL __previous(const _Slist_node_base* __head,
00067                                             const _Slist_node_base* __node) {
00068     return _Sl_global<_Dummy>::__previous((_Slist_node_base*)__head, __node);
00069   }
00070 };
00071 
00072 # if defined (_STLP_USE_TEMPLATE_EXPORT) 
00073 _STLP_EXPORT_TEMPLATE_CLASS _Sl_global<bool>;
00074 # endif
00075 typedef _Sl_global<bool> _Sl_global_inst;
00076 
00077 _STLP_END_NAMESPACE
00078 
00079 # if !defined (_STLP_LINK_TIME_INSTANTIATION)
00080 #  include <stl/_slist_base.c>
00081 # endif
00082 
00083 #endif /* _STLP_INTERNAL_SLIST_BASE_H */
00084 
00085 // Local Variables:
00086 // mode:C++
00087 // End:

Generated on Mon Jun 5 10:20:47 2006 for Intelligence.kdevelop by  doxygen 1.4.6