man __gnu_debug::Safe_sequence_base (Fonctions bibliothèques) - Base class that supports tracking of iterators that reference a sequence.

NAME

__gnu_debug::Safe_sequence_base - Base class that supports tracking of iterators that reference a sequence.

SYNOPSIS



#include <safe_base.h>

Inherited by __gnu_debug::Safe_sequence< Sequence >, __gnu_debug::Safe_sequence< basic_string< CharT, Traits, Allocator > >, __gnu_debug::Safe_sequence< deque< Type, Allocator > >, __gnu_debug::Safe_sequence< hash_map< Value, Type, HashFcn, EqualKey, Alloc > >, __gnu_debug::Safe_sequence< hash_multimap< Value, Type, HashFcn, EqualKey, Alloc > >, __gnu_debug::Safe_sequence< hash_multiset< Value, HashFcn, EqualKey, Alloc > >, __gnu_debug::Safe_sequence< hash_set< Value, HashFcn, EqualKey, Alloc > >, __gnu_debug::Safe_sequence< list< Type, Allocator > >, __gnu_debug::Safe_sequence< map< Key, Type, Compare, Allocator > >, __gnu_debug::Safe_sequence< multimap< Key, Type, Compare, Allocator > >, __gnu_debug::Safe_sequence< multiset< Key, Compare, Allocator > >, __gnu_debug::Safe_sequence< set< Key, Compare, Allocator > >, __gnu_debug::Safe_sequence< vector< Type, Allocator > >, and __gnu_debug_def::bitset< Nb >.

Public Member Functions

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

Safe_sequence_base ()

~Safe_sequence_base ()

void M_detach_all ()

void M_detach_singular ()

void M_revalidate_singular ()

void M_swap (Safe_sequence_base &x)

Detailed Description

Base class that supports tracking of iterators that reference a sequence.

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.

Constructor & Destructor Documentation

__gnu_debug::Safe_sequence_base::~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 __gnu_debug::Safe_sequence_base::M_detach_all () [protected]

Detach all iterators, leaving them singular.

Definition at line 114 of file debug.cc.

void __gnu_debug::Safe_sequence_base::M_detach_singular () [protected]

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_invalidate_all () const [inline]

Invalidates all iterators.

Definition at line 202 of file safe_base.h.

void __gnu_debug::Safe_sequence_base::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).

Definition at line 154 of file debug.cc.

void __gnu_debug::Safe_sequence_base::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.

Definition at line 172 of file debug.cc.

References __gnu_debug::swap().

Member Data Documentation

Safe_iterator_base* __gnu_debug::Safe_sequence_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* __gnu_debug::Safe_sequence_base::M_iterators

The list of mutable iterators that reference this container.

Definition at line 153 of file safe_base.h.

unsigned int __gnu_debug::Safe_sequence_base::M_version [mutable]

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.