STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | List of all members
_Tree_unchecked_const_iterator< _Mytree, _Base > Class Template Reference
Inheritance diagram for _Tree_unchecked_const_iterator< _Mytree, _Base >:
_Iterator012< bidirectional_iterator_tag, _Mytree::value_type, _Mytree::difference_type, _Mytree::const_pointer, _Mytree::const_reference, _Base >

Public Types

typedef _Tree_unchecked_const_iterator< _Mytree, _Base_Myiter
 
typedef bidirectional_iterator_tag iterator_category
 
typedef _Mytree::_Nodeptr _Nodeptr
 
typedef _Mytree::value_type value_type
 
typedef _Mytree::difference_type difference_type
 
typedef _Mytree::const_pointer pointer
 
typedef _Mytree::const_reference reference
 
- Public Types inherited from _Iterator012< bidirectional_iterator_tag, _Mytree::value_type, _Mytree::difference_type, _Mytree::const_pointer, _Mytree::const_reference, _Base >
typedef bidirectional_iterator_tag iterator_category
 
typedef _Mytree::value_type value_type
 
typedef _Mytree::difference_type difference_type
 
typedef _Mytree::const_pointer pointer
 
typedef _Mytree::const_reference reference
 

Public Member Functions

 _Tree_unchecked_const_iterator ()
 
 _Tree_unchecked_const_iterator (_Nodeptr _Pnode, const _Mytree *_Plist)
 
reference operator* () const
 
pointer operator-> () const
 
_Myiteroperator++ ()
 
_Myiter operator++ (int)
 
_Myiteroperator-- ()
 
_Myiter operator-- (int)
 
bool operator== (const _Myiter &_Right) const
 
bool operator!= (const _Myiter &_Right) const
 
_Nodeptr _Mynode () const
 

Public Attributes

_Nodeptr _Ptr
 

Member Typedef Documentation

template<class _Mytree, class _Base = _Iterator_base0>
typedef _Tree_unchecked_const_iterator<_Mytree, _Base> _Tree_unchecked_const_iterator< _Mytree, _Base >::_Myiter
template<class _Mytree, class _Base = _Iterator_base0>
typedef _Mytree::_Nodeptr _Tree_unchecked_const_iterator< _Mytree, _Base >::_Nodeptr
template<class _Mytree, class _Base = _Iterator_base0>
typedef _Mytree::difference_type _Tree_unchecked_const_iterator< _Mytree, _Base >::difference_type
template<class _Mytree, class _Base = _Iterator_base0>
typedef bidirectional_iterator_tag _Tree_unchecked_const_iterator< _Mytree, _Base >::iterator_category
template<class _Mytree, class _Base = _Iterator_base0>
typedef _Mytree::const_pointer _Tree_unchecked_const_iterator< _Mytree, _Base >::pointer
template<class _Mytree, class _Base = _Iterator_base0>
typedef _Mytree::const_reference _Tree_unchecked_const_iterator< _Mytree, _Base >::reference
template<class _Mytree, class _Base = _Iterator_base0>
typedef _Mytree::value_type _Tree_unchecked_const_iterator< _Mytree, _Base >::value_type

Constructor & Destructor Documentation

template<class _Mytree, class _Base = _Iterator_base0>
_Tree_unchecked_const_iterator< _Mytree, _Base >::_Tree_unchecked_const_iterator ( )
inline
38  : _Ptr()
39  { // construct with null node pointer
40  }
_Nodeptr _Ptr
Definition: xtree:126
template<class _Mytree, class _Base = _Iterator_base0>
_Tree_unchecked_const_iterator< _Mytree, _Base >::_Tree_unchecked_const_iterator ( _Nodeptr  _Pnode,
const _Mytree *  _Plist 
)
inline
43  : _Ptr(_Pnode)
44  { // construct with node pointer _Pnode
45  this->_Adopt(_Plist);
46  }
_Nodeptr _Ptr
Definition: xtree:126

Member Function Documentation

template<class _Mytree, class _Base = _Iterator_base0>
_Nodeptr _Tree_unchecked_const_iterator< _Mytree, _Base >::_Mynode ( ) const
inline
122  { // return node pointer
123  return (_Ptr);
124  }
_Nodeptr _Ptr
Definition: xtree:126
template<class _Mytree, class _Base = _Iterator_base0>
bool _Tree_unchecked_const_iterator< _Mytree, _Base >::operator!= ( const _Myiter _Right) const
inline
117  { // test for iterator inequality
118  return (!(*this == _Right));
119  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Mytree, class _Base = _Iterator_base0>
reference _Tree_unchecked_const_iterator< _Mytree, _Base >::operator* ( ) const
inline
49  { // return designated value
50  return (_Mytree::_Myval(_Ptr));
51  }
_Nodeptr _Ptr
Definition: xtree:126
template<class _Mytree, class _Base = _Iterator_base0>
_Myiter& _Tree_unchecked_const_iterator< _Mytree, _Base >::operator++ ( )
inline
59  { // preincrement
60  if (_Mytree::_Isnil(_Ptr))
61  ; // end() shouldn't be incremented, don't move
62  else if (!_Mytree::_Isnil(_Mytree::_Right(_Ptr)))
63  _Ptr = _Mytree::_Min(
64  _Mytree::_Right(_Ptr)); // ==> smallest of right subtree
65  else
66  { // climb looking for right subtree
67  _Nodeptr _Pnode;
68  while (!_Mytree::_Isnil(_Pnode = _Mytree::_Parent(_Ptr))
69  && _Ptr == _Mytree::_Right(_Pnode))
70  _Ptr = _Pnode; // ==> parent while right subtree
71  _Ptr = _Pnode; // ==> parent (head if end())
72  }
73  return (*this);
74  }
_Mytree::_Nodeptr _Nodeptr
Definition: xtree:31
constexpr const _Ty &() _Right
Definition: algorithm:3723
_Nodeptr _Ptr
Definition: xtree:126
template<class _Mytree, class _Base = _Iterator_base0>
_Myiter _Tree_unchecked_const_iterator< _Mytree, _Base >::operator++ ( int  )
inline
77  { // postincrement
78  _Myiter _Tmp = *this;
79  ++*this;
80  return (_Tmp);
81  }
_Tree_unchecked_const_iterator< _Mytree, _Base > _Myiter
Definition: xtree:28
template<class _Mytree, class _Base = _Iterator_base0>
_Myiter& _Tree_unchecked_const_iterator< _Mytree, _Base >::operator-- ( )
inline
84  { // predecrement
85  if (_Mytree::_Isnil(_Ptr))
86  _Ptr = _Mytree::_Right(_Ptr); // end() ==> rightmost
87  else if (!_Mytree::_Isnil(_Mytree::_Left(_Ptr)))
88  _Ptr = _Mytree::_Max(
89  _Mytree::_Left(_Ptr)); // ==> largest of left subtree
90  else
91  { // climb looking for left subtree
92  _Nodeptr _Pnode;
93  while (!_Mytree::_Isnil(_Pnode = _Mytree::_Parent(_Ptr))
94  && _Ptr == _Mytree::_Left(_Pnode))
95  _Ptr = _Pnode; // ==> parent while left subtree
96  if (_Mytree::_Isnil(_Ptr))
97  ; // begin() shouldn't be decremented, don't move
98  else
99  _Ptr = _Pnode; // ==> parent if not head
100  }
101  return (*this);
102  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
_Mytree::_Nodeptr _Nodeptr
Definition: xtree:31
constexpr const _Ty &() _Right
Definition: algorithm:3723
_Nodeptr _Ptr
Definition: xtree:126
template<class _Mytree, class _Base = _Iterator_base0>
_Myiter _Tree_unchecked_const_iterator< _Mytree, _Base >::operator-- ( int  )
inline
105  { // postdecrement
106  _Myiter _Tmp = *this;
107  --*this;
108  return (_Tmp);
109  }
_Tree_unchecked_const_iterator< _Mytree, _Base > _Myiter
Definition: xtree:28
template<class _Mytree, class _Base = _Iterator_base0>
pointer _Tree_unchecked_const_iterator< _Mytree, _Base >::operator-> ( ) const
inline
54  { // return pointer to class object
55  return (pointer_traits<pointer>::pointer_to(**this));
56  }
Definition: xmemory0:254
template<class _Mytree, class _Base = _Iterator_base0>
bool _Tree_unchecked_const_iterator< _Mytree, _Base >::operator== ( const _Myiter _Right) const
inline
112  { // test for iterator equality
113  return (_Ptr == _Right._Ptr);
114  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
_Nodeptr _Ptr
Definition: xtree:126

Member Data Documentation

template<class _Mytree, class _Base = _Iterator_base0>
_Nodeptr _Tree_unchecked_const_iterator< _Mytree, _Base >::_Ptr

The documentation for this class was generated from the following file: