Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

__rope_iterator Class Template Reference

#include <stl_rope.h>

Inheritance diagram for __rope_iterator:

Inheritance graph
[legend]
Collaboration diagram for __rope_iterator:

Collaboration graph
[legend]
List of all members.

Public Types

typedef __rope_charT_ref_proxy<
charT, Alloc > 
reference
typedef __rope_charT_ref_proxy<
charT, Alloc > * 
pointer

Public Methods

rope< charT, Alloc > & container ()
 __rope_iterator ()
 __rope_iterator (const __rope_iterator &x)
 __rope_iterator (rope< charT, Alloc > &r, size_t pos)
 ~__rope_iterator ()
__rope_iterator & operator= (const __rope_iterator &x)
reference operator * ()
__rope_iterator & operator++ ()
__rope_iterator & operator+= (difference_type n)
__rope_iterator & operator-- ()
__rope_iterator & operator-= (difference_type n)
__rope_iterator operator++ (int)
__rope_iterator operator-- (int)
reference operator[] (ptrdiff_t n)

Protected Methods

 __rope_iterator (rope< charT, Alloc > *r, size_t pos)
void check ()

Protected Attributes

rope< charT, Alloc > * root_rope

Friends

class rope< charT, Alloc >
bool operator==__STL_NULL_TMPL_ARGS (const __rope_iterator< charT, Alloc > &x, const __rope_iterator< charT, Alloc > &y)
bool operator<__STL_NULL_TMPL_ARGS (const __rope_iterator< charT, Alloc > &x, const __rope_iterator< charT, Alloc > &y)
ptrdiff_t operator-__STL_NULL_TMPL_ARGS (const __rope_iterator< charT, Alloc > &x, const __rope_iterator< charT, Alloc > &y)
__rope_iterator< charT, Alloc > operator-__STL_NULL_TMPL_ARGS (const __rope_iterator< charT, Alloc > &x, ptrdiff_t n)
__rope_iterator< charT, Alloc > operator+__STL_NULL_TMPL_ARGS (const __rope_iterator< charT, Alloc > &x, ptrdiff_t n)
__rope_iterator< charT, Alloc > operator+__STL_NULL_TMPL_ARGS (ptrdiff_t n, const __rope_iterator< charT, Alloc > &x)

template<class charT, class Alloc>
class __rope_iterator< charT, Alloc >


Member Typedef Documentation

template<class charT, class Alloc>
typedef __rope_charT_ref_proxy<charT,Alloc>* __rope_iterator::pointer
 

Reimplemented from random_access_iterator< charT, ptrdiff_t >.

Definition at line 803 of file stl_rope.h.

template<class charT, class Alloc>
typedef __rope_charT_ref_proxy<charT,Alloc> __rope_iterator::reference
 

Reimplemented from random_access_iterator< charT, ptrdiff_t >.

Definition at line 802 of file stl_rope.h.


Constructor & Destructor Documentation

template<class charT, class Alloc>
__rope_iterator< charT, Alloc >::__rope_iterator rope< charT, Alloc > *    r,
size_t    pos
[inline, protected]
 

Definition at line 795 of file stl_rope.h.

References __rope_iterator_base::root.

00795                                                       :
00796              __rope_iterator_base<charT,Alloc>(r -> tree_ptr, pos),
00797              root_rope(r) {
00798                 RopeBase::ref(root);
00799              }
    void check();

template<class charT, class Alloc>
__rope_iterator< charT, Alloc >::__rope_iterator   [inline]
 

Definition at line 807 of file stl_rope.h.

References __rope_iterator_base::root.

00807                       {
00808         root = 0;  // Needed for reference counting.
00809     };

template<class charT, class Alloc>
__rope_iterator< charT, Alloc >::__rope_iterator const __rope_iterator< charT, Alloc > &    x [inline]
 

Definition at line 810 of file stl_rope.h.

References __rope_iterator_base::root.

00810                                                :
00811         __rope_iterator_base<charT,Alloc>(x) {
00812         root_rope = x.root_rope;
00813         RopeBase::ref(root);
00814     }
    __rope_iterator(rope<charT,Alloc>& r, size_t pos);

template<class charT, class Alloc>
__rope_iterator< charT, Alloc >::__rope_iterator rope< charT, Alloc > &    r,
size_t    pos
 

template<class charT, class Alloc>
__rope_iterator< charT, Alloc >::~__rope_iterator   [inline]
 

Definition at line 816 of file stl_rope.h.

References __rope_iterator_base::root.

00816                        {
00817         RopeBase::unref(root);
00818     }


Member Function Documentation

template<class charT, class Alloc>
void __rope_iterator< charT, Alloc >::check   [protected]
 

Referenced by operator *.

template<class charT, class Alloc>
rope<charT,Alloc>& __rope_iterator< charT, Alloc >::container   [inline]
 

Definition at line 806 of file stl_rope.h.

00806 { return *root_rope; }

template<class charT, class Alloc>
reference __rope_iterator< charT, Alloc >::operator *   [inline]
 

Definition at line 834 of file stl_rope.h.

References __rope_iterator_base::buf_ptr, check, and __rope_iterator_base::current_pos.

00834                           {
00835         check();
00836         if (0 == buf_ptr) {
00837             return __rope_charT_ref_proxy<charT,Alloc>(root_rope, current_pos);
00838         } else {
00839             return __rope_charT_ref_proxy<charT,Alloc>(root_rope,
00840                                                        current_pos, *buf_ptr);
00841         }
00842     }

template<class charT, class Alloc>
__rope_iterator __rope_iterator< charT, Alloc >::operator++ int    [inline]
 

Definition at line 867 of file stl_rope.h.

References __rope_iterator_base::current_pos, and __rope_iterator_base::incr.

00867                                     {
00868         size_t old_pos = current_pos;
00869         incr(1);
00870         return __rope_iterator<charT,Alloc>(root_rope, old_pos);
00871     }

template<class charT, class Alloc>
__rope_iterator& __rope_iterator< charT, Alloc >::operator++   [inline]
 

Definition at line 843 of file stl_rope.h.

References __rope_iterator_base::incr.

00843                                   {
00844         incr(1);
00845         return *this;
00846     }

template<class charT, class Alloc>
__rope_iterator& __rope_iterator< charT, Alloc >::operator+= difference_type    n [inline]
 

Definition at line 847 of file stl_rope.h.

References __rope_iterator_base::decr, random_access_iterator< charT, ptrdiff_t >::difference_type, and __rope_iterator_base::incr.

00847                                                    {
00848         if (n >= 0) {
00849             incr(n);
00850         } else {
00851             decr(-n);
00852         }
00853         return *this;
00854     }

template<class charT, class Alloc>
__rope_iterator __rope_iterator< charT, Alloc >::operator-- int    [inline]
 

Definition at line 872 of file stl_rope.h.

References __rope_iterator_base::current_pos, and __rope_iterator_base::decr.

00872                                     {
00873         size_t old_pos = current_pos;
00874         decr(1);
00875         return __rope_iterator<charT,Alloc>(root_rope, old_pos);
00876     }

template<class charT, class Alloc>
__rope_iterator& __rope_iterator< charT, Alloc >::operator--   [inline]
 

Definition at line 855 of file stl_rope.h.

References __rope_iterator_base::decr.

00855                                   {
00856         decr(1);
00857         return *this;
00858     }

template<class charT, class Alloc>
__rope_iterator& __rope_iterator< charT, Alloc >::operator-= difference_type    n [inline]
 

Definition at line 859 of file stl_rope.h.

References __rope_iterator_base::decr, random_access_iterator< charT, ptrdiff_t >::difference_type, and __rope_iterator_base::incr.

00859                                                    {
00860         if (n >= 0) {
00861             decr(n);
00862         } else {
00863             incr(-n);
00864         }
00865         return *this;
00866     }

template<class charT, class Alloc>
__rope_iterator& __rope_iterator< charT, Alloc >::operator= const __rope_iterator< charT, Alloc > &    x [inline]
 

Definition at line 819 of file stl_rope.h.

References __rope_iterator_base::buf_ptr, __rope_iterator_base::current_pos, __rope_iterator_base::root, root_rope, and __rope_iterator_base::RopeBase.

00819                                                            {
00820         RopeBase *old = root;
00821 
00822         RopeBase::ref(x.root);
00823         if (0 != x.buf_ptr) {
00824             *this = x;
00825         } else {
00826             current_pos = x.current_pos;
00827             root = x.root;
00828             root_rope = x.root_rope;
00829             buf_ptr = 0;
00830         }
00831         RopeBase::unref(old);
00832         return(*this);
00833     }

template<class charT, class Alloc>
reference __rope_iterator< charT, Alloc >::operator[] ptrdiff_t    n [inline]
 

Definition at line 877 of file stl_rope.h.

References __rope_iterator_base::current_pos.

00877                                       {
00878         return __rope_charT_ref_proxy<charT,Alloc>(root_rope, current_pos + n);
00879     }


Friends And Related Function Documentation

template<class charT, class Alloc>
__rope_iterator<charT,Alloc> operator+__STL_NULL_TMPL_ARGS ptrdiff_t    n,
const __rope_iterator< charT, Alloc > &    x
[friend]
 

template<class charT, class Alloc>
__rope_iterator<charT,Alloc> operator+__STL_NULL_TMPL_ARGS const __rope_iterator< charT, Alloc > &    x,
ptrdiff_t    n
[friend]
 

template<class charT, class Alloc>
__rope_iterator<charT,Alloc> operator-__STL_NULL_TMPL_ARGS const __rope_iterator< charT, Alloc > &    x,
ptrdiff_t    n
[friend]
 

template<class charT, class Alloc>
ptrdiff_t operator-__STL_NULL_TMPL_ARGS const __rope_iterator< charT, Alloc > &    x,
const __rope_iterator< charT, Alloc > &    y
[friend]
 

template<class charT, class Alloc>
bool operator<__STL_NULL_TMPL_ARGS const __rope_iterator< charT, Alloc > &    x,
const __rope_iterator< charT, Alloc > &    y
[friend]
 

template<class charT, class Alloc>
bool operator==__STL_NULL_TMPL_ARGS const __rope_iterator< charT, Alloc > &    x,
const __rope_iterator< charT, Alloc > &    y
[friend]
 

template<class charT, class Alloc>
friend class rope< charT, Alloc > [friend]
 

Reimplemented from __rope_iterator_base.

Definition at line 785 of file stl_rope.h.


Member Data Documentation

template<class charT, class Alloc>
rope<charT,Alloc>* __rope_iterator::root_rope [protected]
 

Definition at line 787 of file stl_rope.h.

Referenced by operator+, and operator=.


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

Documentation generated on Thu May 2 15:03:17 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001