diff options
| author | fdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-21 19:56:36 +0000 |
|---|---|---|
| committer | fdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-21 19:56:36 +0000 |
| commit | 14551d3ec69faf7c1de0d6bb7cda2558fbbbe53a (patch) | |
| tree | 70702a6a8c175845ee2ccfeade84908e722ccf59 /libstdc++-v3/include/debug | |
| parent | aa52f48f102941d811ab94deb69ad42a86843f86 (diff) | |
| download | ppe42-gcc-14551d3ec69faf7c1de0d6bb7cda2558fbbbe53a.tar.gz ppe42-gcc-14551d3ec69faf7c1de0d6bb7cda2558fbbbe53a.zip | |
2011-07-21 François Dumont <francois.cppdevs@free.fr>
* include/debug/safe_unordered_sequence.h,
safe_unordered_sequence.tcc: Rename respectively in...
* include/debug/safe_unordered_container.h,
safe_unordered_container.tcc: ...those. _Safe_unordered_sequence
rename _Safe_unordered_container.
* include/debug/safe_unordered_base.h: _Safe_unordered_sequence_base
rename _Safe_unordered_container_base.
* include/debug/unordered_map, unordered_set: Adapt to previous
modifications.
* config/abi/pre/gnu.ver: Likewise.
* src/debug.cc: Likewise.
* include/Makefile.am: Likewise.
* include/Makefile.in: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176584 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug')
| -rw-r--r-- | libstdc++-v3/include/debug/safe_unordered_base.h | 52 | ||||
| -rw-r--r-- | libstdc++-v3/include/debug/safe_unordered_container.h (renamed from libstdc++-v3/include/debug/safe_unordered_sequence.h) | 34 | ||||
| -rw-r--r-- | libstdc++-v3/include/debug/safe_unordered_container.tcc (renamed from libstdc++-v3/include/debug/safe_unordered_sequence.tcc) | 24 | ||||
| -rw-r--r-- | libstdc++-v3/include/debug/unordered_map | 10 | ||||
| -rw-r--r-- | libstdc++-v3/include/debug/unordered_set | 10 |
5 files changed, 68 insertions, 62 deletions
diff --git a/libstdc++-v3/include/debug/safe_unordered_base.h b/libstdc++-v3/include/debug/safe_unordered_base.h index 14d83bc49fb..9d1131df40e 100644 --- a/libstdc++-v3/include/debug/safe_unordered_base.h +++ b/libstdc++-v3/include/debug/safe_unordered_base.h @@ -1,4 +1,4 @@ -// Safe sequence/iterator base implementation -*- C++ -*- +// Safe container/iterator base implementation -*- C++ -*- // Copyright (C) 2011 Free Software Foundation, Inc. // @@ -33,13 +33,13 @@ namespace __gnu_debug { - class _Safe_unordered_sequence_base; + class _Safe_unordered_container_base; /** \brief Basic functionality for a @a safe iterator. * * The %_Safe_local_iterator_base base class implements the functionality * of a safe local iterator that is not specific to a particular iterator - * type. It contains a pointer back to the sequence it references + * type. It contains a pointer back to the container it references * along with iterator version information and pointers to form a * doubly-linked list of local iterators referenced by the container. * @@ -54,7 +54,7 @@ namespace __gnu_debug _Safe_local_iterator_base() { } - /** Initialize the iterator to reference the sequence pointed to + /** Initialize the iterator to reference the container pointed to * by @p__seq. @p __constant is true when we are initializing a * constant local iterator, and false if it is a mutable local iterator. * Note that @p __seq may be NULL, in which case the iterator will be @@ -64,7 +64,7 @@ namespace __gnu_debug _Safe_local_iterator_base(const _Safe_sequence_base* __seq, bool __constant) { this->_M_attach(const_cast<_Safe_sequence_base*>(__seq), __constant); } - /** Initializes the iterator to reference the same sequence that + /** Initializes the iterator to reference the same container that @p __x does. @p __constant is true if this is a constant iterator, and false if it is mutable. */ _Safe_local_iterator_base(const _Safe_local_iterator_base& __x, @@ -79,13 +79,13 @@ namespace __gnu_debug ~_Safe_local_iterator_base() { this->_M_detach(); } - _Safe_unordered_sequence_base* - _M_get_sequence() const _GLIBCXX_NOEXCEPT; + _Safe_unordered_container_base* + _M_get_container() const _GLIBCXX_NOEXCEPT; public: - /** Attaches this iterator to the given sequence, detaching it - * from whatever sequence it was attached to originally. If the - * new sequence is the NULL pointer, the iterator is left + /** Attaches this iterator to the given container, detaching it + * from whatever container it was attached to originally. If the + * new container is the NULL pointer, the iterator is left * unattached. */ void _M_attach(_Safe_sequence_base* __seq, bool __constant); @@ -93,7 +93,7 @@ namespace __gnu_debug /** Likewise, but not thread-safe. */ void _M_attach_single(_Safe_sequence_base* __seq, bool __constant) throw (); - /** Detach the iterator for whatever sequence it is attached to, + /** Detach the iterator for whatever container it is attached to, * if any. */ void _M_detach(); @@ -104,23 +104,23 @@ namespace __gnu_debug /** * @brief Base class that supports tracking of local iterators that - * reference an unordered sequence. + * reference an unordered container. * - * The %_Safe_unordered_sequence_base class provides basic support for - * tracking iterators into an unordered sequence. Sequences that track - * iterators must derived from %_Safe_sequence_base publicly, so + * The %_Safe_unordered_container_base class provides basic support for + * tracking iterators into an unordered container. Containers that track + * iterators must derived from %_Safe_unordered_container_base publicly, so * that safe iterators (which inherit _Safe_iterator_base) can * attach to them. This class contains four linked lists of * iterators, one for constant iterators, one for mutable * iterators, one for constant local iterators, one for mutable local - * iterator and a version number that allows very fast + * iterators and a version number that allows very fast * invalidation of all iterators that reference the container. * * This class must ensure that no operation on it may throw an - * exception, otherwise @a safe sequences may fail to provide the + * exception, otherwise @a safe containers may fail to provide the * exception-safety guarantees required by the C++ standard. */ - class _Safe_unordered_sequence_base : public _Safe_sequence_base + class _Safe_unordered_container_base : public _Safe_sequence_base { typedef _Safe_sequence_base _Base; public: @@ -132,29 +132,29 @@ namespace __gnu_debug protected: // Initialize with a version number of 1 and no iterators - _Safe_unordered_sequence_base() + _Safe_unordered_container_base() : _M_local_iterators(0), _M_const_local_iterators(0) { } - /** Notify all iterators that reference this sequence that the - sequence is being destroyed. */ - ~_Safe_unordered_sequence_base() + /** Notify all iterators that reference this container that the + container is being destroyed. */ + ~_Safe_unordered_container_base() { this->_M_detach_all(); } /** Detach all iterators, leaving them singular. */ void _M_detach_all(); - /** Swap this sequence with the given sequence. This operation + /** Swap this container with the given container. This operation * also swaps ownership of the iterators, so that when the * operation is complete all iterators that originally referenced * one container now reference the other container. */ void - _M_swap(_Safe_unordered_sequence_base& __x); + _M_swap(_Safe_unordered_container_base& __x); public: - /** Attach an iterator to this sequence. */ + /** Attach an iterator to this container. */ void _M_attach_local(_Safe_iterator_base* __it, bool __constant); @@ -162,7 +162,7 @@ namespace __gnu_debug void _M_attach_local_single(_Safe_iterator_base* __it, bool __constant) throw (); - /** Detach an iterator from this sequence */ + /** Detach an iterator from this container */ void _M_detach_local(_Safe_iterator_base* __it); diff --git a/libstdc++-v3/include/debug/safe_unordered_sequence.h b/libstdc++-v3/include/debug/safe_unordered_container.h index f32b9113e6f..ce15f9cfb49 100644 --- a/libstdc++-v3/include/debug/safe_unordered_sequence.h +++ b/libstdc++-v3/include/debug/safe_unordered_container.h @@ -1,4 +1,4 @@ -// Safe sequence implementation -*- C++ -*- +// Safe container implementation -*- C++ -*- // Copyright (C) 2011 Free Software Foundation, Inc. // @@ -22,12 +22,12 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. -/** @file debug/safe_unordered_sequence.h +/** @file debug/safe_unordered_container.h * This file is a GNU debug extension to the Standard C++ Library. */ -#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_H -#define _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_H 1 +#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_H +#define _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_H 1 #include <debug/debug.h> #include <debug/macros.h> @@ -37,26 +37,28 @@ namespace __gnu_debug { /** - * @brief Base class for constructing a @a safe unordered sequence type + * @brief Base class for constructing a @a safe unordered container type * that tracks iterators that reference it. * - * The class template %_Safe_unordered_sequence simplifies the - * construction of @a safe unordered sequences that track the iterators - * that reference the sequence, so that the iterators are notified of - * changes in the sequence that may affect their operation, e.g., if + * The class template %_Safe_unordered_container simplifies the + * construction of @a safe unordered containers that track the iterators + * that reference the container, so that the iterators are notified of + * changes in the container that may affect their operation, e.g., if * the container invalidates its iterators or is destructed. This class * template may only be used by deriving from it and passing the name * of the derived class as its template parameter via the curiously * recurring template pattern. The derived class must have @c * iterator and @const_iterator types that are instantiations of - * class template _Safe_iterator for this sequence. Iterators will + * class template _Safe_iterator for this container and @c local_iterator + * and @const_local_iterator types that are instantiations of class + * template _Safe_local_iterator for this container. Iterators will * then be tracked automatically. */ - template<typename _Sequence> - class _Safe_unordered_sequence : public _Safe_unordered_sequence_base + template<typename _Container> + class _Safe_unordered_container : public _Safe_unordered_container_base { public: - /** Invalidates all iterators @c x that reference this sequence, + /** Invalidates all iterators @c x that reference this container, are not singular, and for which @c pred(x) returns @c true. @c pred will be invoked with the normal iterators nested in the safe ones. */ @@ -64,12 +66,16 @@ namespace __gnu_debug void _M_invalidate_if(_Predicate __pred); + /** Invalidates all local iterators @c x that reference this container, + are not singular, and for which @c pred(x) returns @c + true. @c pred will be invoked with the normal ilocal iterators + nested in the safe ones. */ template<typename _Predicate> void _M_invalidate_local_if(_Predicate __pred); }; } // namespace __gnu_debug -#include <debug/safe_unordered_sequence.tcc> +#include <debug/safe_unordered_container.tcc> #endif diff --git a/libstdc++-v3/include/debug/safe_unordered_sequence.tcc b/libstdc++-v3/include/debug/safe_unordered_container.tcc index 88907e8839d..69aafa8e819 100644 --- a/libstdc++-v3/include/debug/safe_unordered_sequence.tcc +++ b/libstdc++-v3/include/debug/safe_unordered_container.tcc @@ -1,4 +1,4 @@ -// Safe sequence implementation -*- C++ -*- +// Safe container implementation -*- C++ -*- // Copyright (C) 2011 Free Software Foundation, Inc. // @@ -22,23 +22,23 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. -/** @file debug/safe_unordered_sequence.tcc +/** @file debug/safe_unordered_container.tcc * This file is a GNU debug extension to the Standard C++ Library. */ -#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_TCC -#define _GLIBCXX_DEBUG_SAFE_UNORDERED_SEQUENCE_TCC 1 +#ifndef _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_TCC +#define _GLIBCXX_DEBUG_SAFE_UNORDERED_CONTAINER_TCC 1 namespace __gnu_debug { - template<typename _Sequence> + template<typename _Container> template<typename _Predicate> void - _Safe_unordered_sequence<_Sequence>:: + _Safe_unordered_container<_Container>:: _M_invalidate_if(_Predicate __pred) { - typedef typename _Sequence::iterator iterator; - typedef typename _Sequence::const_iterator const_iterator; + typedef typename _Container::iterator iterator; + typedef typename _Container::const_iterator const_iterator; __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex()); for (_Safe_iterator_base* __iter = _M_iterators; __iter;) @@ -63,14 +63,14 @@ namespace __gnu_debug } - template<typename _Sequence> + template<typename _Container> template<typename _Predicate> void - _Safe_unordered_sequence<_Sequence>:: + _Safe_unordered_container<_Container>:: _M_invalidate_local_if(_Predicate __pred) { - typedef typename _Sequence::local_iterator local_iterator; - typedef typename _Sequence::const_local_iterator const_local_iterator; + typedef typename _Container::local_iterator local_iterator; + typedef typename _Container::const_local_iterator const_local_iterator; __gnu_cxx::__scoped_lock sentry(this->_M_get_mutex()); for (_Safe_iterator_base* __iter = _M_local_iterators; __iter;) diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index 93ce517b1f7..0e300983bda 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -35,7 +35,7 @@ #else # include <unordered_map> -#include <debug/safe_unordered_sequence.h> +#include <debug/safe_unordered_container.h> #include <debug/safe_iterator.h> #include <debug/safe_local_iterator.h> @@ -50,12 +50,12 @@ namespace __debug typename _Alloc = std::allocator<_Key> > class unordered_map : public _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>, - public __gnu_debug::_Safe_unordered_sequence<unordered_map<_Key, _Tp, + public __gnu_debug::_Safe_unordered_container<unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc> > { typedef _GLIBCXX_STD_C::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc> _Base; - typedef __gnu_debug::_Safe_unordered_sequence<unordered_map> _Safe_base; + typedef __gnu_debug::_Safe_unordered_container<unordered_map> _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_local_iterator _Base_const_local_iterator; @@ -430,12 +430,12 @@ namespace __debug class unordered_multimap : public _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>, - public __gnu_debug::_Safe_unordered_sequence<unordered_multimap<_Key, + public __gnu_debug::_Safe_unordered_container<unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> > { typedef _GLIBCXX_STD_C::unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc> _Base; - typedef __gnu_debug::_Safe_unordered_sequence<unordered_multimap> + typedef __gnu_debug::_Safe_unordered_container<unordered_multimap> _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 981db4a83e6..5be37247584 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -35,7 +35,7 @@ #else # include <unordered_set> -#include <debug/safe_unordered_sequence.h> +#include <debug/safe_unordered_container.h> #include <debug/safe_iterator.h> #include <debug/safe_local_iterator.h> @@ -50,12 +50,12 @@ namespace __debug typename _Alloc = std::allocator<_Value> > class unordered_set : public _GLIBCXX_STD_C::unordered_set<_Value, _Hash, _Pred, _Alloc>, - public __gnu_debug::_Safe_unordered_sequence<unordered_set<_Value, _Hash, + public __gnu_debug::_Safe_unordered_container<unordered_set<_Value, _Hash, _Pred, _Alloc> > { typedef _GLIBCXX_STD_C::unordered_set<_Value, _Hash, _Pred, _Alloc> _Base; - typedef __gnu_debug::_Safe_unordered_sequence<unordered_set> _Safe_base; + typedef __gnu_debug::_Safe_unordered_container<unordered_set> _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_local_iterator _Base_const_local_iterator; @@ -425,12 +425,12 @@ namespace __debug typename _Alloc = std::allocator<_Value> > class unordered_multiset : public _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash, _Pred, _Alloc>, - public __gnu_debug::_Safe_unordered_sequence< + public __gnu_debug::_Safe_unordered_container< unordered_multiset<_Value, _Hash, _Pred, _Alloc> > { typedef _GLIBCXX_STD_C::unordered_multiset<_Value, _Hash, _Pred, _Alloc> _Base; - typedef __gnu_debug::_Safe_unordered_sequence<unordered_multiset> + typedef __gnu_debug::_Safe_unordered_container<unordered_multiset> _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; |

