29 #ifndef _GLIBCXX_DEBUG_SAFE_LOCAL_ITERATOR_H
30 #define _GLIBCXX_DEBUG_SAFE_LOCAL_ITERATOR_H 1
51 template<
typename _Iterator,
typename _Sequence>
52 class _Safe_local_iterator :
public _Safe_local_iterator_base
67 typedef typename _Sequence::const_local_iterator const_iterator;
68 return std::__are_same<const_iterator, _Safe_local_iterator>::__value;
71 typedef std::iterator_traits<_Iterator>
_Traits;
79 typedef typename _Traits::pointer
pointer;
92 const _Sequence* __seq)
98 ._M_iterator(*
this,
"this"));
111 || __x._M_current == _Iterator(),
113 ._M_iterator(*
this,
"this")
114 ._M_iterator(__x,
"other"));
121 template<
typename _MutableIterator>
124 typename __gnu_cxx::__enable_if<std::__are_same<
126 typename _Sequence::local_iterator::iterator_type>::__value,
127 _Sequence>::__type>& __x)
134 || __x.base() == _Iterator(),
136 ._M_iterator(*
this,
"this")
137 ._M_iterator(__x,
"other"));
149 || __x._M_current == _Iterator(),
151 ._M_iterator(*
this,
"this")
152 ._M_iterator(__x,
"other"));
168 ._M_iterator(*
this,
"this"));
183 ._M_iterator(*
this,
"this"));
197 ._M_iterator(*
this,
"this"));
211 ._M_iterator(*
this,
"this"));
257 template<
typename _Other>
260 _Sequence>& __rhs)
const;
265 {
return static_cast<const _Sequence*
>(
_M_sequence); }
276 template <
typename _Other>
278 _Sequence>& __other)
const
279 {
return _M_bucket == __other.bucket(); }
282 template<
typename _IteratorL,
typename _IteratorR,
typename _Sequence>
289 ._M_iterator(__lhs,
"lhs")
290 ._M_iterator(__rhs,
"rhs"));
293 ._M_iterator(__lhs,
"lhs")
294 ._M_iterator(__rhs,
"rhs"));
297 ._M_iterator(__lhs,
"lhs")
298 ._M_iterator(__rhs,
"rhs"));
301 ._M_iterator(__lhs,
"lhs")
302 ._M_iterator(__rhs,
"rhs"));
303 return __lhs.base() == __rhs.base();
306 template<
typename _Iterator,
typename _Sequence>
313 ._M_iterator(__lhs,
"lhs")
314 ._M_iterator(__rhs,
"rhs"));
317 ._M_iterator(__lhs,
"lhs")
318 ._M_iterator(__rhs,
"rhs"));
321 ._M_iterator(__lhs,
"lhs")
322 ._M_iterator(__rhs,
"rhs"));
323 return __lhs.base() == __rhs.base();
326 template<
typename _IteratorL,
typename _IteratorR,
typename _Sequence>
333 ._M_iterator(__lhs,
"lhs")
334 ._M_iterator(__rhs,
"rhs"));
337 ._M_iterator(__lhs,
"lhs")
338 ._M_iterator(__rhs,
"rhs"));
341 ._M_iterator(__lhs,
"lhs")
342 ._M_iterator(__rhs,
"rhs"));
343 return __lhs.base() != __rhs.base();
346 template<
typename _Iterator,
typename _Sequence>
353 ._M_iterator(__lhs,
"lhs")
354 ._M_iterator(__rhs,
"rhs"));
357 ._M_iterator(__lhs,
"lhs")
358 ._M_iterator(__rhs,
"rhs"));
361 ._M_iterator(__lhs,
"lhs")
362 ._M_iterator(__rhs,
"rhs"));
363 return __lhs.base() != __rhs.base();
Definition: formatter.h:86
_Iterator base() const
Return the underlying iterator.
Definition: safe_local_iterator.h:222
Definition: formatter.h:91
_Safe_local_iterator(const _Safe_local_iterator &__x)
Copy construction.
Definition: safe_local_iterator.h:104
bool _M_dereferenceable() const
Is the iterator dereferenceable?
Definition: safe_local_iterator.h:248
Definition: formatter.h:110
bool _M_is_begin() const
Is this iterator equal to the sequence's begin() iterator?
Definition: safe_local_iterator.h:268
Definition: formatter.h:84
_Iterator _M_current
The underlying iterator.
Definition: safe_local_iterator.h:58
void _M_attach_single(_Safe_sequence_base *__seq)
Definition: safe_local_iterator.h:243
_Safe_sequence_base * _M_sequence
Definition: safe_base.h:55
_Safe_local_iterator _Self
Definition: safe_local_iterator.h:54
reference operator*() const
Iterator dereference.
Definition: safe_local_iterator.h:164
size_type bucket() const
Return the bucket.
Definition: safe_local_iterator.h:228
_Safe_local_iterator(const _Safe_local_iterator< _MutableIterator, typename __gnu_cxx::__enable_if< std::__are_same< _MutableIterator, typename _Sequence::local_iterator::iterator_type >::__value, _Sequence >::__type > &__x)
Converting constructor from a mutable iterator to a constant iterator.
Definition: safe_local_iterator.h:122
Definition: formatter.h:92
Definition: formatter.h:85
bool _M_in_same_bucket(const _Safe_local_iterator< _Other, _Sequence > &__other) const
Is this iterator part of the same bucket as the other one?
Definition: safe_local_iterator.h:277
_Iterator iterator_type
Definition: safe_local_iterator.h:74
void _M_attach(_Safe_sequence_base *__seq, bool __constant)
size_type _M_bucket
The bucket this local iterator belongs to.
Definition: safe_local_iterator.h:61
_Safe_local_iterator()
Definition: safe_local_iterator.h:82
_Traits::reference reference
Definition: safe_local_iterator.h:78
_Safe_local_iterator operator++(int)
Iterator postincrement.
Definition: safe_local_iterator.h:207
_Sequence::size_type size_type
Definition: safe_local_iterator.h:55
Definition: formatter.h:83
const _Sequence * _M_get_sequence() const
Definition: safe_local_iterator.h:264
_Safe_local_iterator(const _Iterator &__i, size_type __bucket, const _Sequence *__seq)
Safe iterator construction from an unsafe iterator and its sequence.
Definition: safe_local_iterator.h:91
void _M_attach_single(_Safe_sequence_base *__seq, bool __constant)
std::iterator_traits< _Iterator > _Traits
Definition: safe_local_iterator.h:71
bool _M_constant() const
Determine if this is a constant iterator.
Definition: safe_local_iterator.h:65
_Traits::iterator_category iterator_category
Definition: safe_local_iterator.h:75
_Traits::pointer pointer
Definition: safe_local_iterator.h:79
_Safe_local_iterator & operator++()
Iterator preincrement.
Definition: safe_local_iterator.h:193
pointer operator->() const
Iterator dereference.
Definition: safe_local_iterator.h:179
_Safe_local_iterator & operator=(const _Safe_local_iterator &__x)
Copy assignment.
Definition: safe_local_iterator.h:144
Basic functionality for a safe iterator.
Definition: safe_unordered_base.h:50
Definition: formatter.h:81
_GLIBCXX_PURE bool _M_singular() const
Base class that supports tracking of iterators that reference a sequence.
Definition: safe_base.h:177
bool operator==(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:484
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
void _M_attach(_Safe_sequence_base *__seq)
Definition: safe_local_iterator.h:238
bool _M_incrementable() const
Is the iterator incrementable?
Definition: safe_local_iterator.h:253
bool _M_valid_range(const _Safe_local_iterator< _Other, _Sequence > &__rhs) const
Definition: safe_local_iterator.tcc:38
_Traits::value_type value_type
Definition: safe_local_iterator.h:76
Safe iterator wrapper.
Definition: formatter.h:49
Definition: formatter.h:82
bool _M_is_end() const
Is this iterator equal to the sequence's end() iterator?
Definition: safe_local_iterator.h:272
bool operator!=(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:516
_Traits::difference_type difference_type
Definition: safe_local_iterator.h:77