__gnu_debug::safe_sequence(3)
NAME
- __gnu_debug::Safe_sequence - Base class for constructing a
- 'safe' sequence type that tracks iterators that reference it.
SYNOPSIS
#include <safe_sequence.h> Inherits __gnu_debug::Safe_sequence_base. Inherited by __gnu_debug::basic_string< CharT, Traits,
Allocator >
__gnu_debug_def::hash_map< Value, Type, HashFcn, EqualKey, Alloc >, __gnu_debug_def::hash_multimap< Value, Type, HashFcn,
EqualKey, Alloc >
HashFcn, EqualKey, Alloc >
HashFcn, EqualKey, Alloc >
Allocator >
- >, __gnu_debug_def::multimap< Key, Type, Compare, Allocator >,
__gnu_debug_def::multiset< Key, Compare, Allocator >,
__gnu_debug_def::set< Key, Compare, Allocator >, and
__gnu_debug_def::vector< Type, Allocator >.
Public Member Functions
- template<typename Predicate> void M_invalidate_if (Predi
- cate pred)
template<typename Iterator> void M_transfer_iter (const
Safe_iterator
- void M_invalidate_all () const
- Public Attributes
- Safe_iterator_base * M_iterators
The list of mutable iterators that reference thiscontainer.
- Safe_iterator_base * M_const_iterators
The list of constant iterators that reference thiscontainer.
- unsigned int M_version
The container version number. This number may never be0.
- Protected Member Functions
- void M_detach_all ()
void M_detach_singular ()
void M_revalidate_singular () void M_swap (Safe_sequence_base &x)
Detailed Description
template<typename Sequence> class __gnu_debug::Safe_sequence<
Sequence >
- Base class for constructing a 'safe' sequence type that
- tracks iterators that reference it.
- The class template Safe_sequence simplifies the construc
- tion of 'safe' 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 con
- tainer 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 curi
- ously recurring template pattern. The derived class must have it
- erator and types that are instantiations of class template
Safe_iterator
automatically.
Definition at line 96 of file safe_sequence.h.
Member Function Documentation
- template<typename Sequence> template<typename Predicate> void
- __gnu_debug::Safe_sequence< Sequence >::M_invalidate_if
- (Predicate pred)
- Invalidates all iterators x that reference this sequence,
- are not singular, and for which pred(x) returns true. The user of
- this routine should be careful not to make copies of the itera
- tors passed to pred, as the copies may interfere with the invali
- dation.
- Definition at line 120 of file safe_sequence.h.
- template<typename Sequence> template<typename Iterator> void
- __gnu_debug::Safe_sequence< Sequence >::M_transfer_iter (const
Safe_iterator< Iterator, Sequence > & x)
- Transfers all iterators that reference this memory loca
- tion to this sequence from whatever sequence they are attached
- to.
- Definition at line 152 of file safe_sequence.h.
- void __gnu_debug::Safe_sequence_base::M_detach_all ()
- [protected, inherited]
- Detach all iterators, leaving them singular.
- Definition at line 114 of file debug.cc.
- void __gnu_debug::Safe_sequence_base::M_detach_singular ()
- [protected, inherited]
- Detach all singular iterators.
- Postcondition:
for all iterators i attached to this sequence,i->M_version == M_version.
- Definition at line 133 of file debug.cc.
- void __gnu_debug::Safe_sequence_base::M_revalidate_singular ()
- [protected, inherited]
- Revalidates all attached singular iterators. This method
- may be used to validate iterators that were invalidated before
- (but for some reasion, such as an exception, need to become valid
- again).
- Definition at line 154 of file debug.cc.
- void __gnu_debug::Safe_sequence_base::M_swap
- (Safe_sequence_base & x) [protected, inherited]
- Swap this sequence with the given sequence. This operation
- also swaps ownership of the iterators, so that when the operation
- is complete all iterators that originally referenced one contain
- er now reference the other container.
- Definition at line 172 of file debug.cc.
- References __gnu_debug::swap().
- void __gnu_debug::Safe_sequence_base::M_invalidate_all ()
- const [inline, inherited]
- Invalidates all iterators.
- Definition at line 202 of file safe_base.h.
Member Data Documentation
- Safe_iterator_base*
- __gnu_debug::Safe_sequence_base::M_iterators [inherited]
- The list of mutable iterators that reference this contain
- er.
- Definition at line 153 of file safe_base.h.
- Safe_iterator_base*
- __gnu_debug::Safe_sequence_base::M_const_iterators [inherited]
- The list of constant iterators that reference this con
- tainer.
- Definition at line 156 of file safe_base.h.
- unsigned int __gnu_debug::Safe_sequence_base::M_version
- [mutable, inherited]
- The container version number. This number may never be 0.
- Definition at line 159 of file safe_base.h.
Author
- Generated automatically by Doxygen for libstdc++-v3 Source
- from the source code.
- libstdc++-v3 Source 1 Jan 2007 __gnu_de