STLdoc
STLdocumentation
|
Safe iterator wrapper. More...
#include <debug/formatter.h>
Public Types | |
typedef _Iterator | iterator_type |
typedef _Traits::iterator_category | iterator_category |
typedef _Traits::value_type | value_type |
typedef _Traits::difference_type | difference_type |
typedef _Traits::reference | reference |
typedef _Traits::pointer | pointer |
Public Member Functions | |
_Safe_iterator () | |
_Safe_iterator (const _Iterator &__i, const _Sequence *__seq) | |
Safe iterator construction from an unsafe iterator and its sequence. More... | |
_Safe_iterator (const _Safe_iterator &__x) | |
Copy construction. More... | |
template<typename _MutableIterator > | |
_Safe_iterator (const _Safe_iterator< _MutableIterator, typename __gnu_cxx::__enable_if<(std::__are_same< _MutableIterator, typename _Sequence::iterator::iterator_type >::__value), _Sequence >::__type > &__x) | |
Converting constructor from a mutable iterator to a constant iterator. More... | |
_Safe_iterator & | operator= (const _Safe_iterator &__x) |
Copy assignment. More... | |
reference | operator* () const |
Iterator dereference. More... | |
pointer | operator-> () const |
Iterator dereference. More... | |
_Safe_iterator & | operator++ () |
Iterator preincrement. More... | |
_Safe_iterator | operator++ (int) |
Iterator postincrement. More... | |
_Safe_iterator & | operator-- () |
Iterator predecrement. More... | |
_Safe_iterator | operator-- (int) |
Iterator postdecrement. More... | |
reference | operator[] (const difference_type &__n) const |
_Safe_iterator & | operator+= (const difference_type &__n) |
_Safe_iterator | operator+ (const difference_type &__n) const |
_Safe_iterator & | operator-= (const difference_type &__n) |
_Safe_iterator | operator- (const difference_type &__n) const |
_Iterator | base () const |
Return the underlying iterator. More... | |
operator _Iterator () const | |
Conversion to underlying non-debug iterator to allow better interaction with non-debug containers. More... | |
void | _M_attach (_Safe_sequence_base *__seq) |
void | _M_attach_single (_Safe_sequence_base *__seq) |
bool | _M_dereferenceable () const |
Is the iterator dereferenceable? More... | |
bool | _M_before_dereferenceable () const |
Is the iterator before a dereferenceable one? More... | |
bool | _M_incrementable () const |
Is the iterator incrementable? More... | |
bool | _M_decrementable () const |
bool | _M_can_advance (const difference_type &__n) const |
template<typename _Other > | |
bool | _M_valid_range (const _Safe_iterator< _Other, _Sequence > &__rhs) const |
const _Sequence * | _M_get_sequence () const |
bool | _M_is_begin () const |
Is this iterator equal to the sequence's begin() iterator? More... | |
bool | _M_is_end () const |
Is this iterator equal to the sequence's end() iterator? More... | |
bool | _M_is_before_begin () const |
bool | _M_is_beginnest () const |
![]() | |
void | _M_attach (_Safe_sequence_base *__seq, bool __constant) |
void | _M_attach_single (_Safe_sequence_base *__seq, bool __constant) throw () |
void | _M_detach () |
void | _M_detach_single () throw () |
bool | _M_attached_to (const _Safe_sequence_base *__seq) const |
_GLIBCXX_PURE bool | _M_singular () const throw () |
_GLIBCXX_PURE bool | _M_can_compare (const _Safe_iterator_base &__x) const throw () |
void | _M_invalidate () |
void | _M_reset () throw () |
void | _M_unlink () throw () |
Private Types | |
typedef _Safe_iterator | _Self |
typedef std::iterator_traits < _Iterator > | _Traits |
Private Member Functions | |
bool | _M_constant () const |
Determine if this is a constant iterator. More... | |
Private Attributes | |
_Iterator | _M_current |
The underlying iterator. More... | |
Additional Inherited Members | |
![]() | |
_Safe_sequence_base * | _M_sequence |
unsigned int | _M_version |
_Safe_iterator_base * | _M_prior |
_Safe_iterator_base * | _M_next |
![]() | |
_Safe_iterator_base () | |
_Safe_iterator_base (const _Safe_sequence_base *__seq, bool __constant) | |
_Safe_iterator_base (const _Safe_iterator_base &__x, bool __constant) | |
_Safe_iterator_base & | operator= (const _Safe_iterator_base &) |
_Safe_iterator_base (const _Safe_iterator_base &) | |
~_Safe_iterator_base () | |
__gnu_cxx::__mutex & | _M_get_mutex () throw () |
Safe iterator wrapper.
The class template _Safe_iterator is a wrapper around an iterator that tracks the iterator's movement among sequences and checks that operations performed on the "safe" iterator are legal. In additional to the basic iterator operations (which are validated, and then passed to the underlying iterator), _Safe_iterator has member functions for iterator invalidation, attaching/detaching the iterator from sequences, and querying the iterator's state.
|
private |
|
private |
typedef _Traits::difference_type __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::difference_type |
typedef _Traits::iterator_category __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::iterator_category |
typedef _Iterator __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::iterator_type |
typedef _Traits::pointer __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::pointer |
typedef _Traits::reference __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::reference |
typedef _Traits::value_type __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::value_type |
|
inline |
|
inline |
Safe iterator construction from an unsafe iterator and its sequence.
seq
is not NULL
|
inline |
Copy construction.
|
inline |
Converting constructor from a mutable iterator to a constant iterator.
|
inline |
Attach iterator to the given sequence.
|
inline |
Likewise, but not thread-safe.
|
inline |
Is the iterator before a dereferenceable one?
bool __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_can_advance | ( | const difference_type & | __n | ) | const |
|
inlineprivate |
|
inline |
|
inline |
Is the iterator dereferenceable?
|
inline |
|
inline |
Is the iterator incrementable?
|
inline |
Is this iterator equal to the sequence's before_begin() iterator if any?
|
inline |
Is this iterator equal to the sequence's begin() iterator?
|
inline |
Is this iterator equal to the sequence's before_begin() iterator if any or begin() otherwise?
|
inline |
Is this iterator equal to the sequence's end() iterator?
bool __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_valid_range | ( | const _Safe_iterator< _Other, _Sequence > & | __rhs | ) | const |
|
inline |
Return the underlying iterator.
|
inline |
Conversion to underlying non-debug iterator to allow better interaction with non-debug containers.
|
inline |
Iterator dereference.
|
inline |
|
inline |
Iterator preincrement.
|
inline |
Iterator postincrement.
|
inline |
|
inline |
|
inline |
Iterator predecrement.
|
inline |
Iterator postdecrement.
|
inline |
|
inline |
Iterator dereference.
Make this correct w.r.t. iterators that return proxies
Use addressof() instead of & operator
|
inline |
Copy assignment.
|
inline |
|
private |
The underlying iterator.