ReactOS 0.4.16-dev-321-g63bb46a
_Rope_iterator< _CharT, _Alloc > Class Template Reference

#include <_rope.h>

Inheritance diagram for _Rope_iterator< _CharT, _Alloc >:
Collaboration diagram for _Rope_iterator< _CharT, _Alloc >:

Public Types

typedef _Rope_char_ref_proxy< _CharT, _Allocreference
 
typedef _Rope_char_ref_proxy< _CharT, _Alloc > * pointer
 
typedef _CharT value_type
 
typedef ptrdiff_t difference_type
 
typedef random_access_iterator_tag iterator_category
 
- Public Types inherited from _Rope_iterator_base< _CharT, _Alloc >
enum  { _S_path_cache_len = 4 }
 
enum  { _S_iterator_buf_len = 15 }
 
typedef _Rope_RopeRep< _CharT, _Alloc_RopeRep
 

Public Member Functions

 _Rope_iterator (rope< _CharT, _Alloc > *__r, size_t __pos)
 
void _M_check ()
 
 ~_Rope_iterator ()
 
rope< _CharT, _Alloc > & container ()
 
 _Rope_iterator ()
 
 _Rope_iterator (const _Self &__x)
 
 _Rope_iterator (rope< _CharT, _Alloc > &__r, size_t __pos)
 
_Selfoperator= (const _Self &__x)
 
reference operator* ()
 
_Selfoperator++ ()
 
_Selfoperator+= (ptrdiff_t __n)
 
_Selfoperator-- ()
 
_Selfoperator-= (ptrdiff_t __n)
 
_Self operator++ (int)
 
_Self operator-- (int)
 
reference operator[] (ptrdiff_t __n)
 
- Public Member Functions inherited from _Rope_iterator_base< _CharT, _Alloc >
 _Rope_iterator_base ()
 
 _Rope_iterator_base (_RopeRep *__root, size_t __pos)
 
void _M_incr (size_t __n)
 
void _M_decr (size_t __n)
 
size_t index () const
 
 _Rope_iterator_base (const _Self &__x)
 
_Selfoperator= (const _Self &__x)
 

Public Attributes

rope< _CharT, _Alloc > * _M_root_rope
 
- Public Attributes inherited from _Rope_iterator_base< _CharT, _Alloc >
size_t _M_current_pos
 
_RopeRep_M_root
 
size_t _M_leaf_pos
 
_CharT * _M_buf_start
 
_CharT * _M_buf_ptr
 
_CharT * _M_buf_end
 
struct {
   _RopeRep const *   _M_data [_S_path_cache_len]
 
_M_path_end
 
int _M_leaf_index
 
unsigned char _M_path_directions
 
struct {
   _CharT   _M_data [_S_iterator_buf_len]
 
_M_tmp_buf
 

Private Types

typedef _Rope_iterator< _CharT, _Alloc_Self
 
typedef _Rope_iterator_base< _CharT, _Alloc_Base
 
typedef _Rope_RopeRep< _CharT, _Alloc_RopeRep
 

Friends

class rope< _CharT, _Alloc >
 

Additional Inherited Members

- Static Public Member Functions inherited from _Rope_iterator_base< _CharT, _Alloc >
static void _S_setbuf (_Rope_iterator_base< _CharT, _Alloc > &__x)
 
static void _S_setcache (_Rope_iterator_base< _CharT, _Alloc > &__x)
 
static void _S_setcache_for_incr (_Rope_iterator_base< _CharT, _Alloc > &__x)
 

Detailed Description

template<class _CharT, class _Alloc>
class _Rope_iterator< _CharT, _Alloc >

Definition at line 965 of file _rope.h.

Member Typedef Documentation

◆ _Base

template<class _CharT , class _Alloc >
typedef _Rope_iterator_base<_CharT,_Alloc> _Rope_iterator< _CharT, _Alloc >::_Base
private

Definition at line 968 of file _rope.h.

◆ _RopeRep

template<class _CharT , class _Alloc >
typedef _Rope_RopeRep<_CharT,_Alloc> _Rope_iterator< _CharT, _Alloc >::_RopeRep
private

Definition at line 969 of file _rope.h.

◆ _Self

template<class _CharT , class _Alloc >
typedef _Rope_iterator<_CharT, _Alloc> _Rope_iterator< _CharT, _Alloc >::_Self
private

Definition at line 967 of file _rope.h.

◆ difference_type

template<class _CharT , class _Alloc >
typedef ptrdiff_t _Rope_iterator< _CharT, _Alloc >::difference_type

Definition at line 987 of file _rope.h.

◆ iterator_category

template<class _CharT , class _Alloc >
typedef random_access_iterator_tag _Rope_iterator< _CharT, _Alloc >::iterator_category

Definition at line 988 of file _rope.h.

◆ pointer

template<class _CharT , class _Alloc >
typedef _Rope_char_ref_proxy<_CharT,_Alloc>* _Rope_iterator< _CharT, _Alloc >::pointer

Definition at line 985 of file _rope.h.

◆ reference

template<class _CharT , class _Alloc >
typedef _Rope_char_ref_proxy<_CharT,_Alloc> _Rope_iterator< _CharT, _Alloc >::reference

Definition at line 984 of file _rope.h.

◆ value_type

template<class _CharT , class _Alloc >
typedef _CharT _Rope_iterator< _CharT, _Alloc >::value_type

Definition at line 986 of file _rope.h.

Constructor & Destructor Documentation

◆ _Rope_iterator() [1/4]

template<class _CharT , class _Alloc >
_Rope_iterator< _CharT, _Alloc >::_Rope_iterator ( rope< _CharT, _Alloc > *  __r,
size_t  __pos 
)

Definition at line 59 of file _rope.c.

_RopeRep * _M_root
Definition: _rope.h:766
rope< _CharT, _Alloc > * _M_root_rope
Definition: _rope.h:972
_STLP_PRIV _STLP_alloc_proxy< _RopeRep *, _CharT, allocator_type > _M_tree_ptr
Definition: _rope.h:1128
static void _S_ref(_Self *__t)
Definition: _rope.h:442

◆ ~_Rope_iterator()

template<class _CharT , class _Alloc >
_Rope_iterator< _CharT, _Alloc >::~_Rope_iterator ( )
inline

Definition at line 990 of file _rope.h.

990 { //*TY 5/6/00 - added dtor to balance reference count
992 }
static void _S_unref(_Self *__t)
Definition: _rope.h:437

◆ _Rope_iterator() [2/4]

template<class _CharT , class _Alloc >
_Rope_iterator< _CharT, _Alloc >::_Rope_iterator ( )
inline

Definition at line 995 of file _rope.h.

995 {
996 this->_M_root = 0; // Needed for reference counting.
997 }

◆ _Rope_iterator() [3/4]

template<class _CharT , class _Alloc >
_Rope_iterator< _CharT, _Alloc >::_Rope_iterator ( const _Self __x)
inline

Definition at line 998 of file _rope.h.

998 :
1000 _M_root_rope = __x._M_root_rope;
1002 }

◆ _Rope_iterator() [4/4]

template<class _CharT , class _Alloc >
_Rope_iterator< _CharT, _Alloc >::_Rope_iterator ( rope< _CharT, _Alloc > &  __r,
size_t  __pos 
)

Definition at line 64 of file _rope.c.

64 :
66 _M_root_rope(&__r) {
67#if !defined (__DMC__)
68 _RopeRep::_S_ref(this->_M_root); if (!(__r.empty()))_S_setcache(*this);
69#else
71 _RopeRep::_S_ref(this->_M_root); if (!(__r.empty()))_S_setcache(*__x);
72#endif
73}
static void _S_setcache(_Rope_iterator_base< _CharT, _Alloc > &__x)
Definition: _rope.c:136
bool empty() const
Definition: _rope.h:1354

Member Function Documentation

◆ _M_check()

template<class _CharT , class _Alloc >
void _Rope_iterator< _CharT, _Alloc >::_M_check

Definition at line 299 of file _rope.c.

299 {
300 if (_M_root_rope->_M_tree_ptr._M_data != this->_M_root) {
301 // _Rope was modified. Get things fixed up.
303 this->_M_root = _M_root_rope->_M_tree_ptr._M_data;
305 this->_M_buf_ptr = 0;
306 }
307}
_CharT * _M_buf_ptr
Definition: _rope.h:772

Referenced by _Rope_iterator< _CharT, _Alloc >::operator*().

◆ container()

template<class _CharT , class _Alloc >
rope< _CharT, _Alloc > & _Rope_iterator< _CharT, _Alloc >::container ( )
inline

Definition at line 994 of file _rope.h.

994{ return *_M_root_rope; }

Referenced by _Rope_rotate().

◆ operator*()

template<class _CharT , class _Alloc >
reference _Rope_iterator< _CharT, _Alloc >::operator* ( )
inline

Definition at line 1012 of file _rope.h.

1012 {
1013 _M_check();
1014 if (0 == this->_M_buf_ptr) {
1015 return reference(_M_root_rope, this->_M_current_pos);
1016 } else {
1017 return reference(_M_root_rope, this->_M_current_pos, *(this->_M_buf_ptr));
1018 }
1019 }
size_t _M_current_pos
Definition: _rope.h:764
_Rope_char_ref_proxy< _CharT, _Alloc > reference
Definition: _rope.h:984
void _M_check()
Definition: _rope.c:299

◆ operator++() [1/2]

template<class _CharT , class _Alloc >
_Self & _Rope_iterator< _CharT, _Alloc >::operator++ ( )
inline

Definition at line 1020 of file _rope.h.

1020 {
1021 this->_M_incr(1);
1022 return *this;
1023 }
void _M_incr(size_t __n)
Definition: _rope.c:270

◆ operator++() [2/2]

template<class _CharT , class _Alloc >
_Self _Rope_iterator< _CharT, _Alloc >::operator++ ( int  )
inline

Definition at line 1044 of file _rope.h.

1044 {
1045 size_t __old_pos = this->_M_current_pos;
1046 this->_M_incr(1);
1047 return _Self(_M_root_rope, __old_pos);
1048 }
_Rope_iterator< _CharT, _Alloc > _Self
Definition: _rope.h:967

◆ operator+=()

template<class _CharT , class _Alloc >
_Self & _Rope_iterator< _CharT, _Alloc >::operator+= ( ptrdiff_t  __n)
inline

Definition at line 1024 of file _rope.h.

1024 {
1025 if (__n >= 0) {
1026 this->_M_incr(__n);
1027 } else {
1028 this->_M_decr(-__n);
1029 }
1030 return *this;
1031 }
return __n
Definition: _algo.h:75
void _M_decr(size_t __n)
Definition: _rope.c:286

◆ operator--() [1/2]

template<class _CharT , class _Alloc >
_Self & _Rope_iterator< _CharT, _Alloc >::operator-- ( )
inline

Definition at line 1032 of file _rope.h.

1032 {
1033 this->_M_decr(1);
1034 return *this;
1035 }

◆ operator--() [2/2]

template<class _CharT , class _Alloc >
_Self _Rope_iterator< _CharT, _Alloc >::operator-- ( int  )
inline

Definition at line 1049 of file _rope.h.

1049 {
1050 size_t __old_pos = this->_M_current_pos;
1051 this->_M_decr(1);
1052 return _Self(_M_root_rope, __old_pos);
1053 }

◆ operator-=()

template<class _CharT , class _Alloc >
_Self & _Rope_iterator< _CharT, _Alloc >::operator-= ( ptrdiff_t  __n)
inline

Definition at line 1036 of file _rope.h.

1036 {
1037 if (__n >= 0) {
1038 this->_M_decr(__n);
1039 } else {
1040 this->_M_incr(-__n);
1041 }
1042 return *this;
1043 }

◆ operator=()

template<class _CharT , class _Alloc >
_Self & _Rope_iterator< _CharT, _Alloc >::operator= ( const _Self __x)
inline

Definition at line 1004 of file _rope.h.

1004 {
1005 _RopeRep* __old = this->_M_root;
1006 _RopeRep::_S_ref(__x._M_root);
1007 _Base::operator=(__x);
1008 _M_root_rope = __x._M_root_rope;
1009 _RopeRep::_S_unref(__old);
1010 return *this;
1011 }
_Self & operator=(const _Self &__x)
Definition: _rope.h:851
_Rope_RopeRep< _CharT, _Alloc > _RopeRep
Definition: _rope.h:969

◆ operator[]()

template<class _CharT , class _Alloc >
reference _Rope_iterator< _CharT, _Alloc >::operator[] ( ptrdiff_t  __n)
inline

Definition at line 1054 of file _rope.h.

1054 {
1055 return reference(_M_root_rope, this->_M_current_pos + __n);
1056 }

Friends And Related Function Documentation

◆ rope< _CharT, _Alloc >

template<class _CharT , class _Alloc >
friend class rope< _CharT, _Alloc >
friend

Definition at line 961 of file _rope.h.

Member Data Documentation

◆ _M_root_rope


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