Safe_sequence_base Class Reference

#include <safe_base.h>

Inheritance diagram for Safe_sequence_base:

Inheritance graph
Collaboration diagram for Safe_sequence_base:

Collaboration graph
List of all members.

Detailed Description

The Safe_sequence_base class provides basic support for tracking iterators into a sequence. Sequences that track iterators must derived from Safe_sequence_base publicly, so that safe iterators (which inherit Safe_iterator_base) can attach to them. This class contains two linked lists of iterators, one for constant iterators and one for mutable 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 "safe" sequences may fail to provide the exception-safety guarantees required by the C++ standard.

Definition at line 149 of file safe_base.h.

Public Member Functions

Public Attributes

Protected Member Functions


Constructor & Destructor Documentation

~Safe_sequence_base  )  [inline, protected]
 

Notify all iterators that reference this sequence that the sequence is being destroyed. Definition at line 169 of file safe_base.h.


Member Function Documentation

void M_detach_all  )  [protected]
 

Detach all iterators, leaving them singular.

void M_detach_singular  )  [protected]
 

Detach all singular iterators.

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

void M_invalidate_all  )  const [inline]
 

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

void M_revalidate_singular  )  [protected]
 

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]
 

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.


Member Data Documentation

Safe_iterator_base* M_const_iterators
 

The list of constant iterators that reference this container.

Definition at line 156 of file safe_base.h.

Safe_iterator_base* M_iterators
 

The list of mutable iterators that reference this container.

Definition at line 153 of file safe_base.h.

unsigned int M_version [mutable]
 

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