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

__rope_const_iterator Class Template Reference

#include <stl_rope.h>

Inheritance diagram for __rope_const_iterator:

Inheritance graph
[legend]
Collaboration diagram for __rope_const_iterator:

Collaboration graph
[legend]
List of all members.

Public Types

typedef charT reference
typedef const charT * pointer

Public Methods

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

Protected Methods

 __rope_const_iterator (const RopeBase *root, size_t pos)

Friends

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

template<class charT, class Alloc>
class __rope_const_iterator< charT, Alloc >


Member Typedef Documentation

template<class charT, class Alloc>
typedef const charT* __rope_const_iterator::pointer
 

Reimplemented from random_access_iterator< charT, ptrdiff_t >.

Definition at line 694 of file stl_rope.h.

template<class charT, class Alloc>
typedef charT __rope_const_iterator::reference
 

Reimplemented from random_access_iterator< charT, ptrdiff_t >.

Definition at line 691 of file stl_rope.h.

Referenced by operator *, and operator[].


Constructor & Destructor Documentation

template<class charT, class Alloc>
__rope_const_iterator< charT, Alloc >::__rope_const_iterator const RopeBase   root,
size_t    pos
[inline, protected]
 

Definition at line 685 of file stl_rope.h.

References __rope_iterator_base::root, and __rope_iterator_base::RopeBase.

00685                                                             :
00686                    __rope_iterator_base<charT,Alloc>(
00687                      const_cast<RopeBase *>(root), pos)
00688                    // Only nonconst iterators modify root ref count
00689     {}
  public:

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

Definition at line 697 of file stl_rope.h.

00697 {};

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

Definition at line 698 of file stl_rope.h.

template<class charT, class Alloc>
__rope_const_iterator< charT, Alloc >::__rope_const_iterator const __rope_iterator< charT, Alloc > &    x
 

template<class charT, class Alloc>
__rope_const_iterator< charT, Alloc >::__rope_const_iterator const rope< charT, Alloc > &    r,
size_t    pos
[inline]
 

Definition at line 701 of file stl_rope.h.


Member Function Documentation

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

Definition at line 713 of file stl_rope.h.

References __rope_iterator_base::buf_ptr, reference, and __rope_iterator_base::setcache.

00713                           {
00714         if (0 == buf_ptr) setcache(*this);
00715         return *buf_ptr;
00716     }

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

Definition at line 747 of file stl_rope.h.

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

00747                                           {
00748         size_t old_pos = current_pos;
00749         incr(1);
00750         return __rope_const_iterator<charT,Alloc>(root, old_pos);
00751         // This makes a subsequent dereference expensive.
00752         // Perhaps we should instead copy the iterator
00753         // if it has a valid cache?
00754     }

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

Definition at line 717 of file stl_rope.h.

References __GC_CONST, __rope_iterator_base::buf_end, __rope_iterator_base::buf_ptr, __rope_iterator_base::current_pos, and __rope_iterator_base::incr.

00717                                         {
00718         __GC_CONST charT * next;
00719         if (0 != buf_ptr && (next = buf_ptr + 1) < buf_end) {
00720             buf_ptr = next;
00721             ++current_pos;
00722         } else {
00723             incr(1);
00724         }
00725         return *this;
00726     }

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

Definition at line 727 of file stl_rope.h.

References __rope_iterator_base::decr, and __rope_iterator_base::incr.

00727                                                    {
00728         if (n >= 0) {
00729             incr(n);
00730         } else {
00731             decr(-n);
00732         }
00733         return *this;
00734     }

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

Definition at line 755 of file stl_rope.h.

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

00755                                           {
00756         size_t old_pos = current_pos;
00757         decr(1);
00758         return __rope_const_iterator<charT,Alloc>(root, old_pos);
00759     }

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

Definition at line 735 of file stl_rope.h.

References __rope_iterator_base::decr.

00735                                         {
00736         decr(1);
00737         return *this;
00738     }

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

Definition at line 739 of file stl_rope.h.

References __rope_iterator_base::decr, and __rope_iterator_base::incr.

00739                                                    {
00740         if (n >= 0) {
00741             decr(n);
00742         } else {
00743             incr(-n);
00744         }
00745         return *this;
00746     }

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

Definition at line 703 of file stl_rope.h.

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

00703                                                                        {
00704         if (0 != x.buf_ptr) {
00705             *this = x;
00706         } else {
00707             current_pos = x.current_pos;
00708             root = x.root;
00709             buf_ptr = 0;
00710         }
00711         return(*this);
00712     }

template<class charT, class Alloc>
reference __rope_const_iterator< charT, Alloc >::operator[] size_t    n [inline]
 

Definition at line 769 of file stl_rope.h.

References __rope_iterator_base::current_pos, rope::fetch, reference, and __rope_iterator_base::root.

00769                                    {
00770         return rope<charT,Alloc>::fetch(root, current_pos + n);
00771     }


Friends And Related Function Documentation

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

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

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

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

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

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

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

Reimplemented from __rope_iterator_base.

Definition at line 683 of file stl_rope.h.


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