#include <safe_sequence.h>
Public Member Functions | |
template<typename Predicate> | |
void | M_invalidate_if (Predicate pred) |
template<typename Iterator> | |
void | M_transfer_iter (const Safe_iterator< Iterator, Sequence > &x) |
void | M_invalidate_all () const |
Public Attributes | |
Safe_iterator_base * | M_iterators |
The list of mutable iterators that reference this container. | |
Safe_iterator_base * | M_const_iterators |
The list of constant iterators that reference this container. | |
unsigned int | M_version |
The container version number. This number may never be 0. | |
Protected Member Functions | |
void | M_detach_all () |
void | M_detach_singular () |
void | M_revalidate_singular () |
void | M_swap (Safe_sequence_base &x) |
The class template Safe_sequence simplifies the construction 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 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 iterator
and types that are instantiations of class template Safe_iterator for this sequence. Iterators will then be tracked automatically.
Definition at line 96 of file safe_sequence.h.
void __gnu_debug::Safe_sequence< Sequence >::M_invalidate_if | ( | Predicate | pred | ) | [inline] |
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 iterators passed to pred
, as the copies may interfere with the invalidation.
Definition at line 120 of file safe_sequence.h.
void __gnu_debug::Safe_sequence< Sequence >::M_transfer_iter | ( | const Safe_iterator< Iterator, Sequence > & | x | ) | [inline] |
Transfers all iterators that reference this memory location 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] |
void __gnu_debug::Safe_sequence_base::M_detach_singular | ( | ) | [protected, inherited] |
void __gnu_debug::Safe_sequence_base::M_revalidate_singular | ( | ) | [protected, inherited] |
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 container 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.
The list of mutable iterators that reference this container.
Definition at line 153 of file safe_base.h.
The list of constant iterators that reference this container.
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.