__gnu_debug::_Safe_iterator_base(3cxx)

πŸ’… NAME πŸ’…

__gnu_debug::_Safe_iterator_base β€” bestie, it’s the basic functionality for a safe iterator, and the manual section is 3cxx (that’s the libstdc++ debug-mode corner of the man-verse 🫢).


🌸 SYNOPSIS 🌸

okay so first you pull in the header like this:

#include <safe_base.h>

Then the inheritance tea β˜•: Inherited by these absolute icons:

  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::forward_iterator_tag >
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, std::bidirectional_iterator_tag >
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >
  • and __gnu_debug::_Safe_local_iterator_base

πŸ’– Public Member Functions πŸ’–

  • bool _M_attached_to (const _Safe_sequence_base *__seq) const β€” says whether this iterator is attached to __seq.
  • bool _M_can_compare (const _Safe_iterator_base &__x) const throw () β€” can this iterator be compared to __x?
  • void _M_detach_single () throw () β€” detach, but not thread-safe.
  • void _M_invalidate () β€” invalidate the iterator, making it singular.
  • void _M_reset () throw () β€” reset all member variables.
  • bool _M_singular () const throw () β€” is this iterator singular?
  • void _M_unlink () throw () β€” unlink itself.

πŸŽ€ Public Attributes πŸŽ€

  • _Safe_iterator_base * _M_next
  • _Safe_iterator_base * _M_prior
  • _Safe_sequence_base * _M_sequence
  • unsigned int _M_version

🧚 Protected Member Functions 🧚

  • constexpr _Safe_iterator_base ()
  • constexpr _Safe_iterator_base (const _Safe_iterator_base &__x, bool __constant)
  • constexpr _Safe_iterator_base (const _Safe_sequence_base *__seq, bool __constant)
  • void _M_attach (_Safe_sequence_base *__seq, bool __constant)
  • void _M_attach_single (_Safe_sequence_base *__seq, bool __constant) throw ()
  • void _M_detach ()
  • __gnu_cxx::__mutex & _M_get_mutex () throw ()

🫢 Friends 🫢

  • class _Safe_sequence_base

πŸ¦‹ DETAILED DESCRIPTION πŸ¦‹

Basic functionality for a safe iterator.

The _Safe_iterator_base base class implements the functionality of a safe iterator that is not specific to a particular iterator type. It contains a pointer back to the sequence it references along with iterator version information and pointers to form a doubly-linked list of iterators referenced by the container 🌈.

⚠️ Important caveat, no cap: this class must not perform any operations that can throw an exception, or the exception guarantees of derived iterators will be broken. So keep it chill and non-throwing, bestie πŸ’€.

πŸŽ€ CONSTRUCTOR & DESTRUCTOR DOCUMENTATION πŸŽ€

🧡 constexpr __gnu_debug::_Safe_iterator_base::_Safe_iterator_base () [inline], [constexpr], [protected] 🧡

Initializes the iterator and makes it singular ✨.

🧡 constexpr __gnu_debug::_Safe_iterator_base::_Safe_iterator_base (const _Safe_sequence_base * __seq, bool __constant) [inline], [constexpr], [protected] 🧡

Initialize the iterator to reference the sequence pointed to by __seq. __constant is true when we are initializing a constant iterator, and false if it is a mutable iterator. Note that __seq may be NULL, in which case the iterator will be singular. Otherwise, the iterator will reference __seq and be nonsingular πŸ’–.

References _M_attach().

🧡 constexpr __gnu_debug::_Safe_iterator_base::_Safe_iterator_base (const _Safe_iterator_base & __x, bool __constant) [inline], [constexpr], [protected] 🧡

Initializes the iterator to reference the same sequence that __x does. __constant is true if this is a constant iterator, and false if it is mutable πŸ¦‹.

References _M_attach(), and _M_sequence.


πŸ”§ MEMBER FUNCTION DOCUMENTATION πŸ”§

πŸ”₯ void __gnu_debug::_Safe_iterator_base::_M_attach (_Safe_sequence_base * __seq, bool __constant) [protected] πŸ”₯

Attaches this iterator to the given sequence, detaching it from whatever sequence it was attached to originally. If the new sequence is the NULL pointer, the iterator is left unattached πŸ‘‘.

Referenced by _Safe_iterator_base(), _Safe_iterator_base(), and __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_attach().

πŸ”₯ void __gnu_debug::_Safe_iterator_base::_M_attach_single (_Safe_sequence_base * __seq, bool __constant) [protected] πŸ”₯

Likewise, but not thread-safe πŸ™ˆ.

Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_attach_single().

πŸ”₯ bool __gnu_debug::_Safe_iterator_base::_M_attached_to (const _Safe_sequence_base * __seq) const [inline] πŸ”₯

Determines if we are attached to the given sequence πŸ’….

References _M_sequence.

πŸ”₯ bool __gnu_debug::_Safe_iterator_base::_M_can_compare (const _Safe_iterator_base & __x) const πŸ”₯

Can we compare this iterator to the given iterator __x? Returns true if both iterators are nonsingular and reference the same sequence ⭐.

πŸ”₯ void __gnu_debug::_Safe_iterator_base::_M_detach () [protected] πŸ”₯

Detach the iterator for whatever sequence it is attached to, if any πŸ“.

Referenced by:

  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_Safe_iterator()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()
  • and __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()

πŸ”₯ void __gnu_debug::_Safe_iterator_base::_M_detach_single () πŸ”₯

Likewise, but not thread-safe 😭.

Referenced by __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if().

πŸ”₯ __gnu_cxx::__mutex & __gnu_debug::_Safe_iterator_base::_M_get_mutex () [protected] πŸ”₯

For use in _Safe_iterator πŸ’œ.

Referenced by:

  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::operator++()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator++()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::operator=()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()
  • and __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::operator=()

πŸ”₯ void __gnu_debug::_Safe_iterator_base::_M_invalidate () [inline] πŸ”₯

Invalidate the iterator, making it singular πŸ’€.

References _M_version.

πŸ”₯ void __gnu_debug::_Safe_iterator_base::_M_reset () πŸ”₯

Reset all member variables.

πŸ”₯ bool __gnu_debug::_Safe_iterator_base::_M_singular () const πŸ”₯

Is this iterator singular? πŸ‘€

Referenced by:

  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_Safe_iterator()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_Safe_iterator()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_Safe_iterator()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::_Safe_local_iterator()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::_Safe_local_iterator()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::_Safe_local_iterator()
  • __gnu_debug::__check_singular_aux()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_dereferenceable()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::_M_dereferenceable()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_incrementable()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::_M_incrementable()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::operator=()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()
  • and __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::operator=()

Unlink itself πŸ”—.

References _M_next, and _M_prior.


πŸ—‚οΈ MEMBER DATA DOCUMENTATION πŸ—‚οΈ

🌟 _Safe_iterator_base* __gnu_debug::_Safe_iterator_base::_M_next 🌟

Pointer to the next iterator in the sequence’s list of iterators. Only valid when _M_sequence != NULL 🫢.

Referenced by:

  • __gnu_debug::_Safe_sequence< _SafeSequence >::_M_invalidate_if()
  • __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if()
  • and _M_unlink()

🌟 _Safe_iterator_base* __gnu_debug::_Safe_iterator_base::_M_prior 🌟

Pointer to the previous iterator in the sequence’s list of iterators. Only valid when _M_sequence != NULL 🫢.

Referenced by:

  • __gnu_debug::_Safe_sequence< _SafeSequence >::_M_invalidate_if()
  • __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if()
  • and _M_unlink()

🌟 _Safe_sequence_base* __gnu_debug::_Safe_iterator_base::_M_sequence 🌟

The sequence this iterator references; may be NULL to indicate a singular iterator πŸ’….

Referenced by:

  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_Safe_iterator()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_Safe_iterator()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_Safe_iterator()
  • _Safe_iterator_base()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::_Safe_local_iterator()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::_Safe_local_iterator()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::_Safe_local_iterator()
  • __gnu_debug::_Safe_local_iterator_base::_Safe_local_iterator_base()
  • _M_attached_to()
  • __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::operator=()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()
  • and __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::operator=()

🌟 unsigned int __gnu_debug::_Safe_iterator_base::_M_version 🌟

The version number of this iterator. The sentinel value 0 is used to indicate an invalidated iterator (i.e., one that is singular because of an operation on the container). This version number must equal the version number in the sequence referenced by _M_sequence for the iterator to be non-singular πŸ”₯.

Referenced by:

  • _M_invalidate()
  • __gnu_debug::_Safe_sequence< _Sequence >::_M_transfer_from_if()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::_M_value_initialized()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::_M_value_initialized()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()
  • __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::operator=()
  • __gnu_debug::_Safe_iterator< _Iterator, _Sequence, _Category >::operator=()
  • and __gnu_debug::_Safe_local_iterator< _Iterator, _Sequence >::operator=()

πŸ‘‘ AUTHOR πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code 🌈.


okay that’s literally the whole page, bestie πŸ’– β€” source/version: libstdc++ (Doxygen-generated), footer vibe: libstd__gnu_debug::_Safe_iterator_base(3cxx), and no date is listed. Mwah πŸ’‹