/home/ntakagi/work/STLport-5.1.5/stlport/stl/_slist_base.h

Go to the documentation of this file.
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_INTERNAL_CSTDDEF
00031 #  include <stl/_cstddef.h>
00032 #endif
00033 
00034 _STLP_BEGIN_NAMESPACE
00035 
00036 _STLP_MOVE_TO_PRIV_NAMESPACE
00037 
00038 struct _Slist_node_base {
00039   _Slist_node_base* _M_next;
00040 };
00041 
00042 inline _Slist_node_base*
00043 __slist_make_link(_Slist_node_base* __prev_node,
00044                   _Slist_node_base* __new_node) {
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(__CONST_CAST(_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 
00076 typedef _Sl_global<bool> _Sl_global_inst;
00077 
00078 _STLP_MOVE_TO_STD_NAMESPACE
00079 
00080 _STLP_END_NAMESPACE
00081 
00082 #if !defined (_STLP_LINK_TIME_INSTANTIATION) && defined (_STLP_EXPOSE_GLOBALS_IMPLEMENTATION)
00083 #  include <stl/_slist_base.c>
00084 #endif
00085 
00086 #endif /* _STLP_INTERNAL_SLIST_BASE_H */
00087 
00088 // Local Variables:
00089 // mode:C++
00090 // End:



Generated on Mon Mar 10 15:32:36 2008 by  doxygen 1.5.1