__gnu_debug::_Safe_sequence< _Sequence > Class Template Reference

Base class for constructing a "safe" sequence type that tracks iterators that reference it. More...

#include <safe_sequence.h>

Inheritance diagram for __gnu_debug::_Safe_sequence< _Sequence >:

__gnu_debug::_Safe_sequence_base List of all members.

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)

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 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.


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 iterators passed to pred, as the copies may interfere with the invalidation.

Definition at line 120 of file safe_sequence.h.

References __gnu_debug::_Safe_iterator_base::_M_next.

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 location to this sequence from whatever sequence they are attached to.

Definition at line 152 of file safe_sequence.h.

References __gnu_debug::_Safe_iterator_base::_M_attach(), __gnu_debug::_Safe_sequence_base::_M_const_iterators, __gnu_debug::_Safe_sequence_base::_M_iterators, __gnu_debug::_Safe_iterator_base::_M_next, __gnu_debug::_Safe_iterator_base::_M_sequence, and __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::base().


The documentation for this class was generated from the following file:
Generated on Tue Jan 30 17:32:04 2007 for GNU C++ STL by doxygen 1.3.6