#include <safe_iterator.h>
Inheritance diagram for __gnu_debug::_Safe_iterator< _Iterator, _Sequence >:
Public Types | |
typedef _Iterator | _Base_iterator |
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 () | |
the iterator is singular and unattached | |
_Safe_iterator (const _Iterator &__i, const _Sequence *__seq) | |
Safe iterator construction from an unsafe iterator and its sequence. | |
_Safe_iterator (const _Safe_iterator &__x) | |
Copy construction. | |
template<typename _MutableIterator> | _Safe_iterator (const _Safe_iterator< _MutableIterator, typename std::__enable_if< _Sequence,(std::__are_same< _MutableIterator, typename _Sequence::iterator::_Base_iterator >::_M_type) >::_M_type > &__x) |
Converting constructor from a mutable iterator to a constant iterator. | |
_Safe_iterator & | operator= (const _Safe_iterator &__x) |
Copy assignment. | |
reference | operator * () const |
Iterator dereference. | |
pointer | operator-> () const |
Iterator dereference. | |
_Safe_iterator & | operator++ () |
Iterator preincrement. | |
_Safe_iterator | operator++ (int) |
Iterator postincrement. | |
_Safe_iterator & | operator-- () |
Iterator predecrement. | |
_Safe_iterator | operator-- (int) |
Iterator postdecrement. | |
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. | |
operator _Iterator () const | |
Conversion to underlying non-debug iterator to allow better interaction with non-debug containers. | |
void | _M_attach (const _Sequence *__seq) |
void | _M_invalidate () |
bool | _M_dereferenceable () const |
Is the iterator dereferenceable? | |
bool | _M_incrementable () const |
Is the iterator incrementable? | |
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? | |
bool | _M_is_end () const |
Is this iterator equal to the sequence's end() iterator? | |
Static Public Member Functions | |
template<typename _Iterator1, typename _Iterator2> pair< difference_type, _Distance_precision > | _M_get_distance (const _Iterator1 &__lhs, const _Iterator2 &__rhs) |
template<typename _Iterator1, typename _Iterator2> pair< difference_type, _Distance_precision > | _M_get_distance (const _Iterator1 &__lhs, const _Iterator2 &__rhs, std::random_access_iterator_tag) |
template<typename _Iterator1, typename _Iterator2> pair< difference_type, _Distance_precision > | _M_get_distance (const _Iterator1 &__lhs, const _Iterator2 &__rhs, std::forward_iterator_tag) |
Private Types | |
typedef _Safe_iterator | _Self |
typedef iterator_traits< _Iterator > | _Traits |
enum | _Distance_precision { __dp_equality, __dp_sign, __dp_exact } |
Private Member Functions | |
bool | _M_constant () const |
Determine if this is a constant iterator. | |
Private Attributes | |
_Iterator | _M_current |
The underlying iterator. |
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.
Definition at line 64 of file safe_iterator.h.
|
Definition at line 92 of file safe_iterator.h. |
|
Definition at line 66 of file safe_iterator.h. |
|
Definition at line 89 of file safe_iterator.h. |
|
Definition at line 95 of file safe_iterator.h. |
|
Definition at line 93 of file safe_iterator.h. |
|
Definition at line 97 of file safe_iterator.h. |
|
Definition at line 96 of file safe_iterator.h. |
|
Definition at line 94 of file safe_iterator.h. |
|
The precision to which we can calculate the distance between two iterators. Definition at line 71 of file safe_iterator.h. |
|
the iterator is singular and unattached
Definition at line 100 of file safe_iterator.h. |
|
Safe iterator construction from an unsafe iterator and its sequence.
Definition at line 109 of file safe_iterator.h. References __gnu_debug::__msg_init_singular, and _GLIBCXX_DEBUG_VERIFY. |
|
Copy construction.
Definition at line 121 of file safe_iterator.h. References __gnu_debug::__msg_init_copy_singular, _GLIBCXX_DEBUG_VERIFY, and __gnu_debug::_Safe_iterator_base::_M_singular(). |
|
Converting constructor from a mutable iterator to a constant iterator.
Definition at line 137 of file safe_iterator.h. References __gnu_debug::__msg_init_const_singular, and _GLIBCXX_DEBUG_VERIFY. |
|
Attach iterator to the given sequence. Definition at line 320 of file safe_iterator.h. References __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_constant(). Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator=(). |
|
|
Determine if this is a constant iterator.
Definition at line 83 of file safe_iterator.h. Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_attach(). |
|
Definition at line 341 of file safe_iterator.h. References __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_is_begin(), and __gnu_debug::_Safe_iterator_base::_M_singular(). |
|
Is the iterator dereferenceable?
Definition at line 332 of file safe_iterator.h. References __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_is_end(), and __gnu_debug::_Safe_iterator_base::_M_singular(). Referenced by __gnu_debug::__check_dereferenceable(), and __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_incrementable(). |
|
Definition at line 379 of file safe_iterator.h. References __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::__dp_equality, and std::make_pair(). |
|
Definition at line 371 of file safe_iterator.h. References __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::__dp_exact, and std::make_pair(). |
|
Determine the distance between two iterators with some known precision. Definition at line 362 of file safe_iterator.h. Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_can_advance(), and __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_valid_range(). |
|
Definition at line 354 of file safe_iterator.h. Referenced by __gnu_debug::_Error_formatter::_Parameter::_Parameter(). |
|
Is the iterator incrementable?
Definition at line 337 of file safe_iterator.h. References __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_dereferenceable(). |
|
Invalidate the iterator, making it singular. Definition at line 112 of file safe_iterator.tcc. References __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_singular(), __gnu_debug::_Safe_iterator_base::_M_version, and __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::base(). |
|
Is this iterator equal to the sequence's begin() iterator?
Definition at line 387 of file safe_iterator.h. Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_decrementable(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_valid_range(), and __gnu_debug::_Error_formatter::_Parameter::_Parameter(). |
|
Is this iterator equal to the sequence's end() iterator?
Definition at line 391 of file safe_iterator.h. Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_dereferenceable(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_valid_range(), and __gnu_debug::_Error_formatter::_Parameter::_Parameter(). |
|
|
Return the underlying iterator.
Definition at line 310 of file safe_iterator.h. Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_invalidate(), __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_iter(), __gnu_debug::operator!=(), __gnu_debug::operator-(), __gnu_debug::operator==(), __gnu_debug::operator>(), and __gnu_debug::operator>=(). |
|
Iterator dereference.
Definition at line 173 of file safe_iterator.h. References __gnu_debug::__msg_bad_deref, and _GLIBCXX_DEBUG_VERIFY. |
|
Conversion to underlying non-debug iterator to allow better interaction with non-debug containers.
Definition at line 316 of file safe_iterator.h. |
|
Definition at line 280 of file safe_iterator.h. |
|
Iterator postincrement.
Definition at line 217 of file safe_iterator.h. References __gnu_debug::__msg_bad_inc, and _GLIBCXX_DEBUG_VERIFY. |
|
Iterator preincrement.
Definition at line 203 of file safe_iterator.h. References __gnu_debug::__msg_bad_inc, and _GLIBCXX_DEBUG_VERIFY. |
|
Definition at line 270 of file safe_iterator.h. References __gnu_debug::__msg_advance_oob, and _GLIBCXX_DEBUG_VERIFY. |
|
Definition at line 298 of file safe_iterator.h. |
|
Iterator postdecrement.
Definition at line 247 of file safe_iterator.h. References __gnu_debug::__msg_bad_dec, and _GLIBCXX_DEBUG_VERIFY. |
|
Iterator predecrement.
Definition at line 233 of file safe_iterator.h. References __gnu_debug::__msg_bad_dec, and _GLIBCXX_DEBUG_VERIFY. |
|
Definition at line 288 of file safe_iterator.h. References __gnu_debug::__msg_retreat_oob, and _GLIBCXX_DEBUG_VERIFY. |
|
Iterator dereference.
Definition at line 189 of file safe_iterator.h. References __gnu_debug::__msg_bad_deref, and _GLIBCXX_DEBUG_VERIFY. |
|
Copy assignment.
Definition at line 157 of file safe_iterator.h. References __gnu_debug::__msg_copy_singular, _GLIBCXX_DEBUG_VERIFY, __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_attach(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_current, __gnu_debug::_Safe_iterator_base::_M_sequence, and __gnu_debug::_Safe_iterator_base::_M_singular(). |
|
Definition at line 259 of file safe_iterator.h. References __gnu_debug::__msg_iter_subscript_oob, _GLIBCXX_DEBUG_VERIFY, and __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_M_can_advance(). |
|
The underlying iterator.
Definition at line 79 of file safe_iterator.h. Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator=(). |