ReactOS  0.4.13-dev-961-g238ea69
_Deque_iterator_base< _Tp > Struct Template Reference

#include <_deque.h>

Inheritance diagram for _Deque_iterator_base< _Tp >:

Public Types

typedef random_access_iterator_tag iterator_category
 
typedef _Tp value_type
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef value_type ** _Map_pointer
 
typedef _Deque_iterator_base< _Tp > _Self
 

Public Member Functions

 _Deque_iterator_base (value_type *__x, _Map_pointer __y)
 
 _Deque_iterator_base ()
 
difference_type _M_subtract (const _Self &__x) const
 
void _M_increment ()
 
void _M_decrement ()
 
void _M_advance (difference_type __n)
 
void _M_set_node (_Map_pointer __new_node)
 

Static Public Member Functions

static size_t _S_buffer_size ()
 

Public Attributes

value_type_M_cur
 
value_type_M_first
 
value_type_M_last
 
_Map_pointer _M_node
 

Detailed Description

template<class _Tp>
struct _Deque_iterator_base< _Tp >

Definition at line 84 of file _deque.h.

Member Typedef Documentation

◆ _Map_pointer

template<class _Tp>
typedef value_type** _Deque_iterator_base< _Tp >::_Map_pointer

Definition at line 97 of file _deque.h.

◆ _Self

template<class _Tp>
typedef _Deque_iterator_base< _Tp > _Deque_iterator_base< _Tp >::_Self

Definition at line 99 of file _deque.h.

◆ difference_type

template<class _Tp>
typedef ptrdiff_t _Deque_iterator_base< _Tp >::difference_type

Definition at line 95 of file _deque.h.

◆ iterator_category

Definition at line 91 of file _deque.h.

◆ size_type

template<class _Tp>
typedef size_t _Deque_iterator_base< _Tp >::size_type

Definition at line 94 of file _deque.h.

◆ value_type

template<class _Tp>
typedef _Tp _Deque_iterator_base< _Tp >::value_type

Definition at line 93 of file _deque.h.

Constructor & Destructor Documentation

◆ _Deque_iterator_base() [1/2]

template<class _Tp>
_Deque_iterator_base< _Tp >::_Deque_iterator_base ( value_type __x,
_Map_pointer  __y 
)
inline

Definition at line 106 of file _deque.h.

107  : _M_cur(__x), _M_first(*__y),
108  _M_last(*__y + _S_buffer_size()), _M_node(__y) {}
static size_t _S_buffer_size()
Definition: _deque.h:86
value_type * _M_last
Definition: _deque.h:103
value_type * _M_first
Definition: _deque.h:102
_Map_pointer _M_node
Definition: _deque.h:104
value_type * _M_cur
Definition: _deque.h:101

◆ _Deque_iterator_base() [2/2]

template<class _Tp>
_Deque_iterator_base< _Tp >::_Deque_iterator_base ( )
inline

Definition at line 110 of file _deque.h.

110 : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {}
value_type * _M_last
Definition: _deque.h:103
value_type * _M_first
Definition: _deque.h:102
_Map_pointer _M_node
Definition: _deque.h:104
value_type * _M_cur
Definition: _deque.h:101

Member Function Documentation

◆ _M_advance()

template<class _Tp>
void _Deque_iterator_base< _Tp >::_M_advance ( difference_type  __n)
inline

Definition at line 139 of file _deque.h.

139  {
140  const size_t buffersize = _S_buffer_size();
141  difference_type __offset = __n + (_M_cur - _M_first);
142  if (__offset >= 0 && __offset < difference_type(buffersize))
143  _M_cur += __n;
144  else {
145  difference_type __node_offset =
146  __offset > 0 ? __offset / buffersize
147  : -difference_type((-__offset - 1) / buffersize) - 1;
148  _M_set_node(_M_node + __node_offset);
149  _M_cur = _M_first +
150 
151  (__offset - __node_offset * difference_type(buffersize));
152  }
153  }
ptrdiff_t difference_type
Definition: _deque.h:95
return __n
Definition: _algo.h:75
static size_t _S_buffer_size()
Definition: _deque.h:86
value_type * _M_first
Definition: _deque.h:102
void _M_set_node(_Map_pointer __new_node)
Definition: _deque.h:155
_Map_pointer _M_node
Definition: _deque.h:104
value_type * _M_cur
Definition: _deque.h:101

Referenced by _Deque_iterator< String, _Nonconst_traits< String > >::operator+=().

◆ _M_decrement()

template<class _Tp>
void _Deque_iterator_base< _Tp >::_M_decrement ( )
inline

Definition at line 131 of file _deque.h.

131  {
132  if (_M_cur == _M_first) {
133  _M_set_node(_M_node - 1);
134  _M_cur = _M_last;
135  }
136  --_M_cur;
137  }
value_type * _M_last
Definition: _deque.h:103
value_type * _M_first
Definition: _deque.h:102
void _M_set_node(_Map_pointer __new_node)
Definition: _deque.h:155
_Map_pointer _M_node
Definition: _deque.h:104
value_type * _M_cur
Definition: _deque.h:101

Referenced by _Deque_iterator< String, _Nonconst_traits< String > >::operator--().

◆ _M_increment()

template<class _Tp>
void _Deque_iterator_base< _Tp >::_M_increment ( )
inline

Definition at line 124 of file _deque.h.

124  {
125  if (++_M_cur == _M_last) {
126  _M_set_node(_M_node + 1);
127  _M_cur = _M_first;
128  }
129  }
value_type * _M_last
Definition: _deque.h:103
value_type * _M_first
Definition: _deque.h:102
void _M_set_node(_Map_pointer __new_node)
Definition: _deque.h:155
_Map_pointer _M_node
Definition: _deque.h:104
value_type * _M_cur
Definition: _deque.h:101

Referenced by _Deque_iterator< String, _Nonconst_traits< String > >::operator++().

◆ _M_set_node()

template<class _Tp>
void _Deque_iterator_base< _Tp >::_M_set_node ( _Map_pointer  __new_node)
inline

◆ _M_subtract()

template<class _Tp>
difference_type _Deque_iterator_base< _Tp >::_M_subtract ( const _Self __x) const
inline

Definition at line 119 of file _deque.h.

119  {
120  return difference_type(_S_buffer_size()) * (_M_node - __x._M_node - 1) +
121  (_M_cur - _M_first) + (__x._M_last - __x._M_cur);
122  }
ptrdiff_t difference_type
Definition: _deque.h:95
static size_t _S_buffer_size()
Definition: _deque.h:86
value_type * _M_first
Definition: _deque.h:102
_Map_pointer _M_node
Definition: _deque.h:104
value_type * _M_cur
Definition: _deque.h:101

Referenced by _Deque_iterator< String, _Nonconst_traits< String > >::operator-().

◆ _S_buffer_size()

template<class _Tp>
static size_t _Deque_iterator_base< _Tp >::_S_buffer_size ( )
inlinestatic

Definition at line 86 of file _deque.h.

86  {
87  const size_t blocksize = _MAX_BYTES;
88  return (sizeof(_Tp) < blocksize ? (blocksize / sizeof(_Tp)) : 1);
89  }

Referenced by _Deque_iterator_base< IncompleteClass >::_M_advance(), _Deque_iterator_base< IncompleteClass >::_M_set_node(), _Deque_iterator_base< IncompleteClass >::_M_subtract(), and _Deque_base< String, _Alloc >::buffer_size().

Member Data Documentation

◆ _M_cur

◆ _M_first

◆ _M_last

◆ _M_node


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