Safe_sequence Class Template Reference

#include <safe_sequence.h>

Inheritance diagram for Safe_sequence:

Inheritance graph
Collaboration diagram for Safe_sequence:

Collaboration graph
List of all members.

Detailed Description

template<typename Sequence>
class __gnu_debug::Safe_sequence< Sequence >

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.

Public Member Functions

Public Attributes

Protected Member Functions


Member Function Documentation

void M_detach_all  )  [protected, inherited]
 

Detach all iterators, leaving them singular.

void M_detach_singular  )  [protected, inherited]
 

Detach all singular iterators.

Postcondition:
for all iterators i attached to this sequence, i->M_version == M_version.

void M_invalidate_all  )  const [inline, inherited]
 

Invalidates all iterators. Definition at line 202 of file safe_base.h.

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

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

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

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


Member Data Documentation

Safe_iterator_base* M_const_iterators [inherited]
 

The list of constant iterators that reference this container.

Definition at line 156 of file safe_base.h.

Safe_iterator_base* M_iterators [inherited]
 

The list of mutable iterators that reference this container.

Definition at line 153 of file safe_base.h.

unsigned int M_version [mutable, inherited]
 

The container version number. This number may never be 0.

Definition at line 159 of file safe_base.h.


The documentation for this class was generated from the following file:
Generated on Sun Sep 12 15:50:09 2004 for libstdc++ source by doxygen 1.3.8