ReactOS 0.4.15-dev-8235-gcd88a97
_Rope_char_ref_proxy< _CharT, _Alloc > Class Template Reference

#include <_rope.h>

Collaboration diagram for _Rope_char_ref_proxy< _CharT, _Alloc >:

Public Member Functions

 _Rope_char_ref_proxy (_My_rope *__r, size_t __p)
 
 _Rope_char_ref_proxy (const _Self &__x)
 
 _Rope_char_ref_proxy (_My_rope *__r, size_t __p, _CharT __c)
 
 operator _CharT () const
 
_Selfoperator= (_CharT __c)
 
_Rope_char_ptr_proxy< _CharT, _Allocoperator& () const
 
_Selfoperator= (const _Self &__c)
 

Private Types

typedef _Rope_char_ref_proxy< _CharT, _Alloc_Self
 
typedef _Rope_self_destruct_ptr< _CharT, _Alloc_Self_destruct_ptr
 
typedef _Rope_RopeRep< _CharT, _Alloc_RopeRep
 
typedef rope< _CharT, _Alloc_My_rope
 

Private Attributes

size_t _M_pos
 
_CharT _M_current
 
bool _M_current_valid
 
_My_rope_M_root
 

Friends

class rope< _CharT, _Alloc >
 
class _Rope_iterator< _CharT, _Alloc >
 
class _Rope_char_ptr_proxy< _CharT, _Alloc >
 

Detailed Description

template<class _CharT, class _Alloc>
class _Rope_char_ref_proxy< _CharT, _Alloc >

Definition at line 651 of file _rope.h.

Member Typedef Documentation

◆ _My_rope

template<class _CharT , class _Alloc >
typedef rope<_CharT,_Alloc> _Rope_char_ref_proxy< _CharT, _Alloc >::_My_rope
private

Definition at line 658 of file _rope.h.

◆ _RopeRep

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

Definition at line 657 of file _rope.h.

◆ _Self

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

Definition at line 652 of file _rope.h.

◆ _Self_destruct_ptr

template<class _CharT , class _Alloc >
typedef _Rope_self_destruct_ptr<_CharT,_Alloc> _Rope_char_ref_proxy< _CharT, _Alloc >::_Self_destruct_ptr
private

Definition at line 656 of file _rope.h.

Constructor & Destructor Documentation

◆ _Rope_char_ref_proxy() [1/3]

template<class _CharT , class _Alloc >
_Rope_char_ref_proxy< _CharT, _Alloc >::_Rope_char_ref_proxy ( _My_rope __r,
size_t  __p 
)
inline

Definition at line 664 of file _rope.h.

664 :
665 _M_pos(__p), _M_current_valid(false), _M_root(__r) {}
bool _M_current_valid
Definition: _rope.h:661
_My_rope * _M_root
Definition: _rope.h:662

◆ _Rope_char_ref_proxy() [2/3]

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

Definition at line 666 of file _rope.h.

666 :
667 _M_pos(__x._M_pos), _M_current_valid(false), _M_root(__x._M_root) {}

◆ _Rope_char_ref_proxy() [3/3]

template<class _CharT , class _Alloc >
_Rope_char_ref_proxy< _CharT, _Alloc >::_Rope_char_ref_proxy ( _My_rope __r,
size_t  __p,
_CharT  __c 
)
inline

Definition at line 672 of file _rope.h.

673 : _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) {}
_CharT _M_current
Definition: _rope.h:660
#define __c
Definition: schilyio.h:209

Member Function Documentation

◆ operator _CharT()

template<class _CharT , class _Alloc >
_Rope_char_ref_proxy< _CharT, _Alloc >::operator _CharT
inline

Definition at line 2362 of file _rope.h.

2362 {
2363 if (_M_current_valid) {
2364 return _M_current;
2365 } else {
2366 return _My_rope::_S_fetch(_M_root->_M_tree_ptr._M_data, _M_pos);
2367 }
2368}
static _CharT _S_fetch(_RopeRep *__r, size_type __pos)
Definition: _rope.c:1123
_STLP_PRIV _STLP_alloc_proxy< _RopeRep *, _CharT, allocator_type > _M_tree_ptr
Definition: _rope.h:1128

◆ operator&()

Definition at line 1296 of file _rope.c.

1296 {
1298}
friend class _Rope_char_ptr_proxy< _CharT, _Alloc >
Definition: _rope.h:655

◆ operator=() [1/2]

template<class _CharT , class _Alloc >
_Rope_char_ref_proxy< _CharT, _Alloc > & _Rope_char_ref_proxy< _CharT, _Alloc >::operator= ( _CharT  __c)

Definition at line 1269 of file _rope.c.

1269 {
1270 _RopeRep* __old = _M_root->_M_tree_ptr._M_data;
1271 // First check for the case in which everything is uniquely
1272 // referenced. In that case we can do this destructively.
1273 _CharT* __ptr = _My_rope::_S_fetch_ptr(__old, _M_pos);
1274 if (0 != __ptr) {
1275 *__ptr = __c;
1276 return *this;
1277 }
1278 _Self_destruct_ptr __left(
1279 _My_rope::_S_substring(__old, 0, _M_pos));
1280 _Self_destruct_ptr __right(
1281 _My_rope::_S_substring(__old, _M_pos+1, __old->_M_size._M_data));
1282 _Self_destruct_ptr __result_left(
1284
1285 // _STLP_ASSERT(__left == __result_left || 1 == __result_left->_M_ref_count)
1286 _RopeRep* __result =
1287 _My_rope::_S_concat_rep(__result_left, __right);
1288 // _STLP_ASSERT(1 <= __result->_M_ref_count)
1289 _RopeRep::_S_unref(__old);
1290 _M_root->_M_tree_ptr._M_data = __result;
1291 return *this;
1292}
_Rope_RopeRep< _CharT, _Alloc > _RopeRep
Definition: _rope.h:657
_Rope_self_destruct_ptr< _CharT, _Alloc > _Self_destruct_ptr
Definition: _rope.h:656
static _RopeRep * _S_substring(_RopeRep *__base, size_t __start, size_t __endp1)
Definition: _rope.c:621
static _CharT * _S_fetch_ptr(_RopeRep *__r, size_type __pos)
Definition: _rope.c:1170
static _RopeRep * _S_concat_rep(_RopeRep *__left, _RopeRep *__right)
Definition: _rope.c:577
static _RopeRep * _S_destr_concat_char_iter(_RopeRep *__r, const _CharT *__iter, size_t __slen)
Definition: _rope.c:517
static void _S_unref(_Self *__t)
Definition: _rope.h:437

Referenced by _Rope_char_ref_proxy< _CharT, _Alloc >::operator=().

◆ operator=() [2/2]

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

Definition at line 677 of file _rope.h.

677 {
678 return operator=((_CharT)__c);
679 }
_Self & operator=(_CharT __c)
Definition: _rope.c:1269

Friends And Related Function Documentation

◆ _Rope_char_ptr_proxy< _CharT, _Alloc >

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

Definition at line 652 of file _rope.h.

◆ _Rope_iterator< _CharT, _Alloc >

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

Definition at line 652 of file _rope.h.

◆ rope< _CharT, _Alloc >

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

Definition at line 652 of file _rope.h.

Member Data Documentation

◆ _M_current

template<class _CharT , class _Alloc >
_CharT _Rope_char_ref_proxy< _CharT, _Alloc >::_M_current
private

Definition at line 660 of file _rope.h.

◆ _M_current_valid

template<class _CharT , class _Alloc >
bool _Rope_char_ref_proxy< _CharT, _Alloc >::_M_current_valid
private

Definition at line 661 of file _rope.h.

◆ _M_pos

template<class _CharT , class _Alloc >
size_t _Rope_char_ref_proxy< _CharT, _Alloc >::_M_pos
private

Definition at line 659 of file _rope.h.

◆ _M_root

template<class _CharT , class _Alloc >
_My_rope* _Rope_char_ref_proxy< _CharT, _Alloc >::_M_root
private

Definition at line 662 of file _rope.h.


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