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

rope Class Template Reference

#include <stl_rope.h>

Collaboration diagram for rope:

Collaboration graph
[legend]
List of all members.

Public Types

typedef charT value_type
typedef ptrdiff_t difference_type
typedef size_t size_type
typedef charT const_reference
typedef const charT * const_pointer
typedef __rope_iterator< charT,
Alloc > 
iterator
typedef __rope_const_iterator<
charT, Alloc > 
const_iterator
typedef __rope_charT_ref_proxy<
charT, Alloc > 
reference
typedef __rope_charT_ptr_proxy<
charT, Alloc > 
pointer
typedef reverse_iterator<
const_iterator, value_type,
const_reference, difference_type
const_reverse_iterator
typedef reverse_iterator<
iterator, value_type, reference,
difference_type
reverse_iterator

Public Methods

void apply_to_pieces (size_t begin, size_t end, __rope_char_consumer< charT > &c) const
bool empty () const
int compare (const rope &y) const
 rope (const charT *s)
 rope (const charT *s, size_t len)
 rope (const charT *s, charT *e)
 rope (const const_iterator &s, const const_iterator &e)
 rope (const iterator &s, const iterator &e)
 rope (charT c)
 rope (size_t n, charT c)
 rope (const charT *i, const charT *j)
 rope ()
 rope (char_producer< charT > *fn, size_t len, bool delete_fn)
 rope (const rope &x)
 ~rope ()
rope & operator= (const rope &x)
void push_back (charT x)
void pop_back ()
charT back () const
void push_front (charT x)
void pop_front ()
charT front () const
void balance ()
void copy (charT *buffer) const
size_type copy (size_type pos, size_type n, charT *buffer) const
void dump ()
const charT * c_str () const
const charT * replace_with_c_str ()
void delete_c_str ()
charT operator[] (size_type pos) const
charT at (size_type pos) const
const_iterator begin () const
const_iterator const_begin () const
const_iterator end () const
const_iterator const_end () const
size_type size () const
size_type length () const
size_type max_size () const
const_reverse_iterator rbegin () const
const_reverse_iterator const_rbegin () const
const_reverse_iterator rend () const
const_reverse_iterator const_rend () const
rope & append (const charT *iter, size_t n)
rope & append (const charT *c_string)
rope & append (const charT *s, const charT *e)
rope & append (const_iterator s, const_iterator e)
rope & append (charT c)
rope & append ()
rope & append (const rope &y)
rope & append (size_t n, charT c)
void swap (rope &b)
void insert (size_t p, const rope &r)
void insert (size_t p, size_t n, charT c)
void insert (size_t p, const charT *i, size_t n)
void insert (size_t p, const charT *c_string)
void insert (size_t p, charT c)
void insert (size_t p)
void insert (size_t p, const charT *i, const charT *j)
void insert (size_t p, const const_iterator &i, const const_iterator &j)
void insert (size_t p, const iterator &i, const iterator &j)
void replace (size_t p, size_t n, const rope &r)
void replace (size_t p, size_t n, const charT *i, size_t i_len)
void replace (size_t p, size_t n, charT c)
void replace (size_t p, size_t n, const charT *c_string)
void replace (size_t p, size_t n, const charT *i, const charT *j)
void replace (size_t p, size_t n, const const_iterator &i, const const_iterator &j)
void replace (size_t p, size_t n, const iterator &i, const iterator &j)
void replace (size_t p, charT c)
void replace (size_t p, const rope &r)
void replace (size_t p, const charT *i, size_t i_len)
void replace (size_t p, const charT *c_string)
void replace (size_t p, const charT *i, const charT *j)
void replace (size_t p, const const_iterator &i, const const_iterator &j)
void replace (size_t p, const iterator &i, const iterator &j)
void erase (size_t p, size_t n)
void erase (size_t p)
iterator insert (const iterator &p, const rope &r)
iterator insert (const iterator &p, size_t n, charT c)
iterator insert (const iterator &p, charT c)
iterator insert (const iterator &p)
iterator insert (const iterator &p, const charT *c_string)
iterator insert (const iterator &p, const charT *i, size_t n)
iterator insert (const iterator &p, const charT *i, const charT *j)
iterator insert (const iterator &p, const const_iterator &i, const const_iterator &j)
iterator insert (const iterator &p, const iterator &i, const iterator &j)
void replace (const iterator &p, const iterator &q, const rope &r)
void replace (const iterator &p, const iterator &q, charT c)
void replace (const iterator &p, const iterator &q, const charT *c_string)
void replace (const iterator &p, const iterator &q, const charT *i, size_t n)
void replace (const iterator &p, const iterator &q, const charT *i, const charT *j)
void replace (const iterator &p, const iterator &q, const const_iterator &i, const const_iterator &j)
void replace (const iterator &p, const iterator &q, const iterator &i, const iterator &j)
void replace (const iterator &p, const rope &r)
void replace (const iterator &p, charT c)
void replace (const iterator &p, const charT *c_string)
void replace (const iterator &p, const charT *i, size_t n)
void replace (const iterator &p, const charT *i, const charT *j)
void replace (const iterator &p, const_iterator i, const_iterator j)
void replace (const iterator &p, iterator i, iterator j)
iterator erase (const iterator &p, const iterator &q)
iterator erase (const iterator &p)
rope substr (size_t start, size_t len=1) const
rope substr (iterator start, iterator end) const
rope substr (iterator start) const
rope substr (const_iterator start, const_iterator end) const
rope< charT, Alloc > substr (const_iterator start)
size_type find (charT c, size_type pos=0) const
size_type find (charT *s, size_type pos=0) const
iterator mutable_begin ()
iterator mutable_end ()
reverse_iterator mutable_rbegin ()
reverse_iterator mutable_rend ()
reference mutable_reference_at (size_type pos)
const_iterator end ()
const_iterator begin ()
const_reverse_iterator rend ()
const_reverse_iterator rbegin ()

Protected Types

typedef __GC_CONST charT * cstrptr
typedef simple_alloc< charT,
Alloc > 
DataAlloc
typedef simple_alloc< __rope_RopeConcatenation<
charT, Alloc >, Alloc > 
CAlloc
typedef simple_alloc< __rope_RopeLeaf<
charT, Alloc >, Alloc > 
LAlloc
typedef simple_alloc< __rope_RopeFunction<
charT, Alloc >, Alloc > 
FAlloc
typedef simple_alloc< __rope_RopeSubstring<
charT, Alloc >, Alloc > 
SAlloc
typedef __rope_RopeBase< charT,
Alloc > 
RopeBase
typedef __rope_RopeConcatenation<
charT, Alloc > 
RopeConcatenation
typedef __rope_RopeLeaf< charT,
Alloc > 
RopeLeaf
typedef __rope_RopeFunction<
charT, Alloc > 
RopeFunction
typedef __rope_RopeSubstring<
charT, Alloc > 
RopeSubstring
typedef __rope_self_destruct_ptr<
charT, Alloc > 
self_destruct_ptr
enum  { copy_max = 23 }

Protected Methods

 rope (RopeBase *t)

Static Protected Methods

cstrptr atomic_swap (cstrptr *p, cstrptr q)
bool is0 (charT c)
charT fetch (RopeBase *r, size_type pos)
charT * fetch_ptr (RopeBase *r, size_type pos)
bool apply_to_pieces (__rope_char_consumer< charT > &c, const RopeBase *r, size_t begin, size_t end)
void unref (RopeBase *t)
void ref (RopeBase *t)
RopeBasesubstring (RopeBase *base, size_t start, size_t endp1)
RopeBaseconcat_char_iter (RopeBase *r, const charT *iter, size_t slen)
RopeBasedestr_concat_char_iter (RopeBase *r, const charT *iter, size_t slen)
RopeBaseconcat (RopeBase *left, RopeBase *right)
size_t rounded_up_size (size_t n)
size_t allocated_capacity (size_t n)
charT * alloc_copy (const charT *s, size_t size)
RopeLeafRopeLeaf_from_char_ptr (__GC_CONST charT *s, size_t size)
RopeLeafRopeLeaf_from_unowned_char_ptr (const charT *s, size_t size)
RopeBasetree_concat (RopeBase *left, RopeBase *right)
RopeFunctionRopeFunction_from_fn (char_producer< charT > *fn, size_t size, bool delete_fn)
RopeLeafleaf_concat_char_iter (RopeLeaf *r, const charT *iter, size_t slen)
RopeLeafdestr_leaf_concat_char_iter (RopeLeaf *r, const charT *iter, size_t slen)
size_t char_ptr_len (const charT *s)
charT * flatten (RopeBase *r, charT *buffer)
charT * flatten (RopeBase *r, size_t start, size_t len, charT *buffer)
bool is_balanced (RopeBase *r)
bool is_almost_balanced (RopeBase *r)
bool is_roughly_balanced (RopeBase *r)
RopeBaseconcat_and_set_balanced (RopeBase *left, RopeBase *right)
RopeBasebalance (RopeBase *r)
void add_to_forest (RopeBase *r, RopeBase **forest)
void add_leaf_to_forest (RopeBase *r, RopeBase **forest)
void dump (RopeBase *r, int indent=0)
int compare (const RopeBase *x, const RopeBase *y)
RopeBasereplace (RopeBase *old, size_t pos1, size_t pos2, RopeBase *r)

Protected Attributes

RopeBasetree_ptr

Static Protected Attributes

charT empty_c_str [1]
const unsigned long min_len [RopeBase::max_rope_depth+1]

Friends

class __rope_iterator< charT, Alloc >
class __rope_const_iterator< charT, Alloc >
struct __rope_RopeBase< charT, Alloc >
class __rope_iterator_base< charT, Alloc >
class __rope_charT_ptr_proxy< charT, Alloc >
class __rope_charT_ref_proxy< charT, Alloc >
struct __rope_RopeSubstring< charT, Alloc >
struct rope< charT, Alloc >::concat_fn
rope identity_element (concat_fn)
rope< charT, Alloc > operator+__STL_NULL_TMPL_ARGS (const rope< charT, Alloc > &left, const rope< charT, Alloc > &right)
rope< charT, Alloc > operator+__STL_NULL_TMPL_ARGS (const rope< charT, Alloc > &left, const charT *right)
rope< charT, Alloc > operator+__STL_NULL_TMPL_ARGS (const rope< charT, Alloc > &left, charT right)

template<class charT, class Alloc>
class rope< charT, Alloc >


Member Typedef Documentation

template<class charT, class Alloc>
typedef simple_alloc<__rope_RopeConcatenation<charT,Alloc>, Alloc> rope::CAlloc [protected]
 

Definition at line 965 of file stl_rope.h.

template<class charT, class Alloc>
typedef __rope_const_iterator<charT,Alloc> rope::const_iterator
 

Definition at line 914 of file stl_rope.h.

Referenced by begin, const_begin, const_end, and end.

template<class charT, class Alloc>
typedef const charT* rope::const_pointer
 

Definition at line 912 of file stl_rope.h.

template<class charT, class Alloc>
typedef charT rope::const_reference
 

Definition at line 911 of file stl_rope.h.

template<class charT, class Alloc>
typedef reverse_iterator<const_iterator, value_type, const_reference, difference_type> rope::const_reverse_iterator
 

Definition at line 1461 of file stl_rope.h.

Referenced by const_rbegin, const_rend, rbegin, and rend.

template<class charT, class Alloc>
typedef __GC_CONST charT* rope::cstrptr [protected]
 

Definition at line 927 of file stl_rope.h.

Referenced by atomic_swap.

template<class charT, class Alloc>
typedef simple_alloc<charT, Alloc> rope::DataAlloc [protected]
 

Definition at line 964 of file stl_rope.h.

template<class charT, class Alloc>
typedef ptrdiff_t rope::difference_type
 

Definition at line 909 of file stl_rope.h.

template<class charT, class Alloc>
typedef simple_alloc<__rope_RopeFunction<charT,Alloc>, Alloc> rope::FAlloc [protected]
 

Definition at line 967 of file stl_rope.h.

template<class charT, class Alloc>
typedef __rope_iterator<charT,Alloc> rope::iterator
 

Definition at line 913 of file stl_rope.h.

Referenced by erase, mutable_begin, and mutable_end.

template<class charT, class Alloc>
typedef simple_alloc<__rope_RopeLeaf<charT,Alloc>, Alloc> rope::LAlloc [protected]
 

Definition at line 966 of file stl_rope.h.

template<class charT, class Alloc>
typedef __rope_charT_ptr_proxy<charT,Alloc> rope::pointer
 

Definition at line 916 of file stl_rope.h.

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

Definition at line 915 of file stl_rope.h.

Referenced by mutable_reference_at.

template<class charT, class Alloc>
typedef reverse_iterator<iterator, value_type, reference, difference_type> rope::reverse_iterator
 

Definition at line 1832 of file stl_rope.h.

Referenced by mutable_rbegin, and mutable_rend.

template<class charT, class Alloc>
typedef __rope_RopeBase<charT,Alloc> rope::RopeBase [protected]
 

Definition at line 974 of file stl_rope.h.

template<class charT, class Alloc>
typedef __rope_RopeConcatenation<charT,Alloc> rope::RopeConcatenation [protected]
 

Definition at line 975 of file stl_rope.h.

template<class charT, class Alloc>
typedef __rope_RopeFunction<charT,Alloc> rope::RopeFunction [protected]
 

Definition at line 977 of file stl_rope.h.

template<class charT, class Alloc>
typedef __rope_RopeLeaf<charT,Alloc> rope::RopeLeaf [protected]
 

Definition at line 976 of file stl_rope.h.

template<class charT, class Alloc>
typedef __rope_RopeSubstring<charT,Alloc> rope::RopeSubstring [protected]
 

Definition at line 978 of file stl_rope.h.

template<class charT, class Alloc>
typedef simple_alloc<__rope_RopeSubstring<charT,Alloc>, Alloc> rope::SAlloc [protected]
 

Definition at line 968 of file stl_rope.h.

template<class charT, class Alloc>
typedef __rope_self_destruct_ptr<charT,Alloc> rope::self_destruct_ptr [protected]
 

Definition at line 1021 of file stl_rope.h.

template<class charT, class Alloc>
typedef size_t rope::size_type
 

Definition at line 910 of file stl_rope.h.

Referenced by at, copy, find, length, max_size, mutable_reference_at, operator[], and size.

template<class charT, class Alloc>
typedef charT rope::value_type
 

Definition at line 908 of file stl_rope.h.


Member Enumeration Documentation

template<class charT, class Alloc>
anonymous enum [protected]
 

Enumeration values:
copy_max 

Definition at line 970 of file stl_rope.h.

00970 { copy_max = 23 };


Constructor & Destructor Documentation

template<class charT, class Alloc>
rope< charT, Alloc >::rope RopeBase   t [inline, protected]
 

Definition at line 1148 of file stl_rope.h.

01148 : tree_ptr(t) { }

template<class charT, class Alloc>
rope< charT, Alloc >::rope const charT *    s [inline]
 

Definition at line 1214 of file stl_rope.h.

References __stl_assert, char_ptr_len, and RopeLeaf_from_unowned_char_ptr.

01215         {
01216             size_t len = char_ptr_len(s);
01217 
01218             if (0 == len) {
01219                 tree_ptr = 0;
01220             } else {
01221                 tree_ptr = RopeLeaf_from_unowned_char_ptr(s, len);
01222 #               ifndef __GC
01223                   __stl_assert(1 == tree_ptr -> refcount);
01224 #               endif
01225             }
01226         }

template<class charT, class Alloc>
rope< charT, Alloc >::rope const charT *    s,
size_t    len
[inline]
 

Definition at line 1228 of file stl_rope.h.

References RopeLeaf_from_unowned_char_ptr.

01229         {
01230             if (0 == len) {
01231                 tree_ptr = 0;
01232             } else {
01233                 tree_ptr = RopeLeaf_from_unowned_char_ptr(s, len);
01234             }
01235         }

template<class charT, class Alloc>
rope< charT, Alloc >::rope const charT *    s,
charT *    e
[inline]
 

Definition at line 1237 of file stl_rope.h.

References RopeLeaf_from_unowned_char_ptr.

01238         {
01239             size_t len = e - s;
01240 
01241             if (0 == len) {
01242                 tree_ptr = 0;
01243             } else {
01244                 tree_ptr = RopeLeaf_from_unowned_char_ptr(s, len);
01245             }
01246         }

template<class charT, class Alloc>
rope< charT, Alloc >::rope const const_iterator   s,
const const_iterator   e
[inline]
 

Definition at line 1248 of file stl_rope.h.

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

01249         {
01250             tree_ptr = substring(s.root, s.current_pos, e.current_pos);
01251         }

template<class charT, class Alloc>
rope< charT, Alloc >::rope const iterator   s,
const iterator   e
[inline]
 

Definition at line 1253 of file stl_rope.h.

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

01254         {
01255             tree_ptr = substring(s.root, s.current_pos, e.current_pos);
01256         }

template<class charT, class Alloc>
rope< charT, Alloc >::rope charT    c [inline]
 

Definition at line 1258 of file stl_rope.h.

References __STL_TRY, __STL_UNWIND, construct, RopeLeaf_from_char_ptr, and rounded_up_size.

01259         {
01260             charT * buf = DataAlloc::allocate(rounded_up_size(1));
01261 
01262             construct(buf, c);
01263             __STL_TRY {
01264                 tree_ptr = RopeLeaf_from_char_ptr(buf, 1);
01265             }
01266             __STL_UNWIND(RopeBase::free_string(buf, 1))
01267         }

template<class charT, class Alloc>
rope< charT, Alloc >::rope size_t    n,
charT    c
 

template<class charT, class Alloc>
rope< charT, Alloc >::rope const charT *    i,
const charT *    j
[inline]
 

Definition at line 1274 of file stl_rope.h.

References RopeLeaf_from_unowned_char_ptr.

01275         {
01276             if (i == j) {
01277                 tree_ptr = 0;
01278             } else {
01279                 size_t len = j - i;
01280                 tree_ptr = RopeLeaf_from_unowned_char_ptr(i, len);
01281             }
01282         }

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

Definition at line 1284 of file stl_rope.h.

01285         {
01286             tree_ptr = 0;
01287         }

template<class charT, class Alloc>
rope< charT, Alloc >::rope char_producer< charT > *    fn,
size_t    len,
bool    delete_fn
[inline]
 

Definition at line 1290 of file stl_rope.h.

References RopeFunction_from_fn.

01291         {
01292             tree_ptr = RopeFunction_from_fn(fn, len, delete_fn);
01293         }

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

Definition at line 1295 of file stl_rope.h.

References ref, and tree_ptr.

01296         {
01297             tree_ptr = x.tree_ptr;
01298             ref(tree_ptr);
01299         }

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

Definition at line 1301 of file stl_rope.h.

References unref.

01302         {
01303             unref(tree_ptr);
01304         }


Member Function Documentation

template<class charT, class Alloc>
void rope< charT, Alloc >::add_leaf_to_forest RopeBase   r,
RopeBase **    forest
[static, protected]
 

template<class charT, class Alloc>
void rope< charT, Alloc >::add_to_forest RopeBase   r,
RopeBase **    forest
[static, protected]
 

template<class charT, class Alloc>
charT* rope< charT, Alloc >::alloc_copy const charT *    s,
size_t    size
[inline, static, protected]
 

Definition at line 1072 of file stl_rope.h.

References __cond_store_eos, rounded_up_size, size, and uninitialized_copy_n.

Referenced by RopeLeaf_from_unowned_char_ptr.

01073         {
01074             charT * result = DataAlloc::allocate(rounded_up_size(size));
01075 
01076             uninitialized_copy_n(s, size, result);
01077             __cond_store_eos(result[size]);
01078             return(result);
01079         }

template<class charT, class Alloc>
size_t rope< charT, Alloc >::allocated_capacity size_t    n [inline, static, protected]
 

Definition at line 1062 of file stl_rope.h.

References __is_basic_char_type, and rounded_up_size.

01062                                                    {
01063             if (__is_basic_char_type((charT *)0)) {
01064                 return rounded_up_size(n) - 1;
01065             } else {
01066                 return rounded_up_size(n);
01067             }
01068         }

template<class charT, class Alloc>
rope& rope< charT, Alloc >::append size_t    n,
charT    c
[inline]
 

Definition at line 1545 of file stl_rope.h.

References append.

01545                                         {
01546             rope<charT,Alloc> last(n, c);
01547             return append(last);
01548         }

template<class charT, class Alloc>
rope& rope< charT, Alloc >::append const rope< charT, Alloc > &    y [inline]
 

Definition at line 1538 of file stl_rope.h.

References concat, tree_ptr, and unref.

01538                                     {
01539             RopeBase* result = concat(tree_ptr, y.tree_ptr);
01540             unref(tree_ptr);
01541             tree_ptr = result;
01542             return *this;
01543         }

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

Definition at line 1536 of file stl_rope.h.

Referenced by append.

01536 { return append(charT()); }

template<class charT, class Alloc>
rope& rope< charT, Alloc >::append charT    c [inline]
 

Definition at line 1529 of file stl_rope.h.

References destr_concat_char_iter, and unref.

01529                               {
01530             RopeBase* result = destr_concat_char_iter(tree_ptr, &c, 1);
01531             unref(tree_ptr);
01532             tree_ptr = result;
01533             return *this;
01534         }

template<class charT, class Alloc>
rope& rope< charT, Alloc >::append const_iterator    s,
const_iterator    e
[inline]
 

Definition at line 1519 of file stl_rope.h.

References __stl_assert, concat, __rope_iterator_base::current_pos, __rope_iterator_base::root, substring, and unref.

01519                                                          {
01520             __stl_assert(s.root == e.root);
01521             self_destruct_ptr appendee(substring(s.root, s.current_pos,
01522                                                  e.current_pos));
01523             RopeBase* result = concat(tree_ptr, (RopeBase *)appendee);
01524             unref(tree_ptr);
01525             tree_ptr = result;
01526             return *this;
01527         }

template<class charT, class Alloc>
rope& rope< charT, Alloc >::append const charT *    s,
const charT *    e
[inline]
 

Definition at line 1511 of file stl_rope.h.

References destr_concat_char_iter, and unref.

01511                                                      {
01512             RopeBase* result =
01513                         destr_concat_char_iter(tree_ptr, s, e - s);
01514             unref(tree_ptr);
01515             tree_ptr = result;
01516             return *this;
01517         }

template<class charT, class Alloc>
rope& rope< charT, Alloc >::append const charT *    c_string [inline]
 

Definition at line 1505 of file stl_rope.h.

References append, and char_ptr_len.

01505                                             {
01506             size_t len = char_ptr_len(c_string);
01507             append(c_string, len);
01508             return(*this);
01509         }

template<class charT, class Alloc>
rope& rope< charT, Alloc >::append const charT *    iter,
size_t    n
[inline]
 

Definition at line 1498 of file stl_rope.h.

References destr_concat_char_iter, and unref.

Referenced by operator+, and operator<.

01498                                                   {
01499             RopeBase* result = destr_concat_char_iter(tree_ptr, iter, n);
01500             unref(tree_ptr);
01501             tree_ptr = result;
01502             return *this;
01503         }

template<class charT, class Alloc>
void rope< charT, Alloc >::apply_to_pieces size_t    begin,
size_t    end,
__rope_char_consumer< charT > &    c
const [inline]
 

Definition at line 1050 of file stl_rope.h.

References apply_to_pieces, begin, and end.

01051                                                                     {
01052             apply_to_pieces(c, tree_ptr, begin, end);
01053         }

template<class charT, class Alloc>
bool rope< charT, Alloc >::apply_to_pieces __rope_char_consumer< charT > &    c,
const RopeBase   r,
size_t    begin,
size_t    end
[static, protected]
 

Referenced by apply_to_pieces.

template<class charT, class Alloc>
charT rope< charT, Alloc >::at size_type    pos const [inline]
 

Definition at line 1420 of file stl_rope.h.

References size_type.

01420                                       {
01421            // if (pos >= size()) throw out_of_range;
01422            return (*this)[pos];
01423         }

template<class charT, class Alloc>
cstrptr rope< charT, Alloc >::atomic_swap cstrptr   p,
cstrptr    q
[inline, static, protected]
 

Definition at line 955 of file stl_rope.h.

References cstrptr.

00955                                                               {
00956                 cstrptr result = *p;
00957                 *p = q;
00958                 return result;
00959             }

template<class charT, class Alloc>
charT rope< charT, Alloc >::back   const [inline]
 

Definition at line 1329 of file stl_rope.h.

References fetch, and size.

01330         {
01331             return fetch(tree_ptr, tree_ptr -> size - 1);
01332         }

template<class charT, class Alloc>
void rope< charT, Alloc >::balance   [inline]
 

Definition at line 1360 of file stl_rope.h.

References unref.

01361         {
01362             RopeBase *old = tree_ptr;
01363             tree_ptr = balance(tree_ptr);
01364             unref(old);
01365         }

template<class charT, class Alloc>
RopeBase* rope< charT, Alloc >::balance RopeBase   r [static, protected]
 

template<class charT, class Alloc>
const_iterator rope< charT, Alloc >::begin   [inline]
 

Definition at line 1884 of file stl_rope.h.

References const_begin.

01884 { return const_begin(); }

template<class charT, class Alloc>
const_iterator rope< charT, Alloc >::begin   const [inline]
 

Definition at line 1425 of file stl_rope.h.

References const_iterator.

Referenced by apply_to_pieces, const_rend, and rend.

01425                                      {
01426             return(const_iterator(tree_ptr, 0));
01427         }

template<class charT, class Alloc>
const charT* rope< charT, Alloc >::c_str   const
 

template<class charT, class Alloc>
size_t rope< charT, Alloc >::char_ptr_len const charT *    s [static, protected]
 

Referenced by append, find, insert, operator+=, and rope.

template<class charT, class Alloc>
int rope< charT, Alloc >::compare const rope< charT, Alloc > &    y const [inline]
 

Definition at line 1210 of file stl_rope.h.

References compare, and tree_ptr.

01210                                          {
01211             return compare(tree_ptr, y.tree_ptr);
01212         }

template<class charT, class Alloc>
int rope< charT, Alloc >::compare const RopeBase   x,
const RopeBase   y
[static, protected]
 

Referenced by compare.

template<class charT, class Alloc>
RopeBase* rope< charT, Alloc >::concat RopeBase   left,
RopeBase   right
[static, protected]
 

Referenced by append, concat_and_set_balanced, insert, operator+=, push_front, and replace.

template<class charT, class Alloc>
RopeBase* rope< charT, Alloc >::concat_and_set_balanced RopeBase   left,
RopeBase   right
[inline, static, protected]
 

Definition at line 1176 of file stl_rope.h.

References concat, and is_balanced.

01178         {
01179             RopeBase * result = concat(left, right);
01180             if (is_balanced(result)) result -> is_balanced = true;
01181             return result;
01182         }

template<class charT, class Alloc>
RopeBase* rope< charT, Alloc >::concat_char_iter RopeBase   r,
const charT *    iter,
size_t    slen
[static, protected]
 

Referenced by insert, operator+=, and push_back.

template<class charT, class Alloc>
const_iterator rope< charT, Alloc >::const_begin   const [inline]
 

Definition at line 1430 of file stl_rope.h.

References const_iterator.

Referenced by begin, and find.

01430                                            {
01431             return(const_iterator(tree_ptr, 0));
01432         }

template<class charT, class Alloc>
const_iterator rope< charT, Alloc >::const_end   const [inline]
 

Definition at line 1438 of file stl_rope.h.

References const_iterator, and size.

Referenced by end, and find.

01438                                          {
01439             return(const_iterator(tree_ptr, size()));
01440         }

template<class charT, class Alloc>
const_reverse_iterator rope< charT, Alloc >::const_rbegin   const [inline]
 

Definition at line 1468 of file stl_rope.h.

References const_reverse_iterator, and end.

Referenced by rbegin.

01468                                                     {
01469             return const_reverse_iterator(end());
01470         }

template<class charT, class Alloc>
const_reverse_iterator rope< charT, Alloc >::const_rend   const [inline]
 

Definition at line 1476 of file stl_rope.h.

References begin, and const_reverse_iterator.

Referenced by rend.

01476                                                   {
01477             return const_reverse_iterator(begin());
01478         }

template<class charT, class Alloc>
size_type rope< charT, Alloc >::copy size_type    pos,
size_type    n,
charT *    buffer
const [inline]
 

Definition at line 1377 of file stl_rope.h.

References destroy, flatten, size, and size_type.

01377                                                                         {
01378             size_t sz = size();
01379             size_t len = (pos + n > sz? sz - pos : n);
01380 
01381             destroy(buffer, buffer + len);
01382             flatten(tree_ptr, pos, len, buffer);
01383             return len;
01384         }

template<class charT, class Alloc>
void rope< charT, Alloc >::copy charT *    buffer const [inline]
 

Definition at line 1367 of file stl_rope.h.

References destroy, flatten, and size.

01367                                         {
01368             destroy(buffer, buffer + size());
01369             flatten(tree_ptr, buffer);
01370         }

template<class charT, class Alloc>
void rope< charT, Alloc >::delete_c_str   [inline]
 

Definition at line 1403 of file stl_rope.h.

01403                              {
01404             if (0 == tree_ptr) return;
01405             if (RopeBase::leaf == tree_ptr -> tag
01406                 && ((RopeLeaf *)tree_ptr) -> data == tree_ptr -> c_string) {
01407                 // Representation shared
01408                 return;
01409             }
01410 #           ifndef __GC
01411               tree_ptr -> free_c_string();
01412 #           endif
01413             tree_ptr -> c_string = 0;
01414         }

template<class charT, class Alloc>
RopeBase* rope< charT, Alloc >::destr_concat_char_iter RopeBase   r,
const charT *    iter,
size_t    slen
[static, protected]
 

Referenced by append.

template<class charT, class Alloc>
RopeLeaf* rope< charT, Alloc >::destr_leaf_concat_char_iter RopeLeaf   r,
const charT *    iter,
size_t    slen
[static, protected]
 

template<class charT, class Alloc>
void rope< charT, Alloc >::dump   [inline]
 

Definition at line 1388 of file stl_rope.h.

01388                     {
01389             dump(tree_ptr);
01390         }

template<class charT, class Alloc>
void rope< charT, Alloc >::dump RopeBase   r,
int    indent = 0
[static, protected]
 

template<class charT, class Alloc>
bool rope< charT, Alloc >::empty   const [inline]
 

Definition at line 1205 of file stl_rope.h.

01205 { return 0 == tree_ptr; }

template<class charT, class Alloc>
const_iterator rope< charT, Alloc >::end   [inline]
 

Definition at line 1882 of file stl_rope.h.

References const_end.

01882 { return const_end(); }

template<class charT, class Alloc>
const_iterator rope< charT, Alloc >::end   const [inline]
 

Definition at line 1434 of file stl_rope.h.

References const_iterator, and size.

Referenced by apply_to_pieces, const_rbegin, and rbegin.

01434                                    {
01435             return(const_iterator(tree_ptr, size()));
01436         }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::erase const iterator   p [inline]
 

Definition at line 1779 of file stl_rope.h.

References erase, __rope_iterator_base::index, and iterator.

01779                                           {
01780             size_t p_index = p.index();
01781             erase(p_index, 1);
01782             return iterator(this, p_index);
01783         }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::erase const iterator   p,
const iterator   q
[inline]
 

Definition at line 1774 of file stl_rope.h.

References erase, __rope_iterator_base::index, and iterator.

01774                                                              {
01775             size_t p_index = p.index();
01776             erase(p_index, q.index() - p_index);
01777             return iterator(this, p_index);
01778         }

template<class charT, class Alloc>
void rope< charT, Alloc >::erase size_t    p [inline]
 

Definition at line 1709 of file stl_rope.h.

References erase.

01709                              {
01710             erase(p, p + 1);
01711         }

template<class charT, class Alloc>
void rope< charT, Alloc >::erase size_t    p,
size_t    n
[inline]
 

Definition at line 1702 of file stl_rope.h.

References replace, and unref.

Referenced by erase.

01702                                        {
01703             RopeBase * result = replace(tree_ptr, p, p + n, 0);
01704             unref(tree_ptr);
01705             tree_ptr = result;
01706         }

template<class charT, class Alloc>
charT rope< charT, Alloc >::fetch RopeBase   r,
size_type    pos
[static, protected]
 

Referenced by back, front, operator[], and __rope_const_iterator::operator[].

template<class charT, class Alloc>
charT* rope< charT, Alloc >::fetch_ptr RopeBase   r,
size_type    pos
[static, protected]
 

template<class charT, class Alloc>
size_type rope< charT, Alloc >::find charT *    s,
size_type    pos = 0
const [inline]
 

Definition at line 1814 of file stl_rope.h.

References char_ptr_len, const_begin, const_end, __rope_iterator_base::index, search, and size_type.

01814                                                           {
01815             const_iterator result = search(const_begin() + pos, const_end(),
01816                                            s, s + char_ptr_len(s));
01817             return result.index();
01818         }

template<class charT, class Alloc>
size_type rope< charT, Alloc >::find charT    c,
size_type    pos = 0
const
 

template<class charT, class Alloc>
charT* rope< charT, Alloc >::flatten RopeBase   r,
size_t    start,
size_t    len,
charT *    buffer
[static, protected]
 

template<class charT, class Alloc>
charT* rope< charT, Alloc >::flatten RopeBase   r,
charT *    buffer
[static, protected]
 

Referenced by copy.

template<class charT, class Alloc>
charT rope< charT, Alloc >::front   const [inline]
 

Definition at line 1355 of file stl_rope.h.

References fetch.

01356         {
01357             return fetch(tree_ptr, 0);
01358         }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::insert const iterator   p,
const iterator   i,
const iterator   j
[inline]
 

Definition at line 1731 of file stl_rope.h.

References __rope_iterator_base::index, and insert.

01733                 { insert(p.index(), i, j); return p; }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::insert const iterator   p,
const const_iterator   i,
const const_iterator   j
[inline]
 

Definition at line 1728 of file stl_rope.h.

References __rope_iterator_base::index, and insert.

01730                 { insert(p.index(), i, j); return p; }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::insert const iterator   p,
const charT *    i,
const charT *    j
[inline]
 

Definition at line 1726 of file stl_rope.h.

References __rope_iterator_base::index, and insert.

01727                 { insert(p.index(), i, j);  return p; }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::insert const iterator   p,
const charT *    i,
size_t    n
[inline]
 

Definition at line 1724 of file stl_rope.h.

References __rope_iterator_base::index, and insert.

01725                 { insert(p.index(), i, n); return p; }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::insert const iterator   p,
const charT *    c_string
[inline]
 

Definition at line 1722 of file stl_rope.h.

References __rope_iterator_base::index, and insert.

01723                 { insert(p.index(), c_string); return p; }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::insert const iterator   p [inline]
 

Definition at line 1720 of file stl_rope.h.

References __rope_iterator_base::index, and insert.

01721                 { insert(p.index()); return p; }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::insert const iterator   p,
charT    c
[inline]
 

Definition at line 1718 of file stl_rope.h.

References __rope_iterator_base::index, and insert.

01719                 { insert(p.index(), c); return p; }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::insert const iterator   p,
size_t    n,
charT    c
[inline]
 

Definition at line 1716 of file stl_rope.h.

References __rope_iterator_base::index, and insert.

01717                 { insert(p.index(), n, c); return p; }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::insert const iterator   p,
const rope< charT, Alloc > &    r
[inline]
 

Definition at line 1714 of file stl_rope.h.

References __rope_iterator_base::index, and insert.

01715                 { insert(p.index(), r); return p; }

template<class charT, class Alloc>
void rope< charT, Alloc >::insert size_t    p,
const iterator   i,
const iterator   j
[inline]
 

Definition at line 1622 of file stl_rope.h.

References insert.

01623                                                  {
01624             rope r(i, j);
01625             insert(p, r);
01626         }

template<class charT, class Alloc>
void rope< charT, Alloc >::insert size_t    p,
const const_iterator   i,
const const_iterator   j
[inline]
 

Definition at line 1616 of file stl_rope.h.

References insert.

01617                                                        {
01618             rope r(i, j);
01619             insert(p, r);
01620         }

template<class charT, class Alloc>
void rope< charT, Alloc >::insert size_t    p,
const charT *    i,
const charT *    j
[inline]
 

Definition at line 1611 of file stl_rope.h.

References insert.

01611                                                               {
01612             rope r(i, j);
01613             insert(p, r);
01614         }

template<class charT, class Alloc>
void rope< charT, Alloc >::insert size_t    p [inline]
 

Definition at line 1606 of file stl_rope.h.

References insert.

01606                               {
01607             charT c = charT();
01608             insert(p, &c, 1);
01609         }

template<class charT, class Alloc>
void rope< charT, Alloc >::insert size_t    p,
charT    c
[inline]
 

Definition at line 1602 of file stl_rope.h.

References insert.

01602                                        {
01603             insert(p, &c, 1);
01604         }

template<class charT, class Alloc>
void rope< charT, Alloc >::insert size_t    p,
const charT *    c_string
[inline]
 

Definition at line 1598 of file stl_rope.h.

References char_ptr_len, and insert.

01598                                                       {
01599             insert(p, c_string, char_ptr_len(c_string));
01600         }

template<class charT, class Alloc>
void rope< charT, Alloc >::insert size_t    p,
const charT *    i,
size_t    n
[inline]
 

Definition at line 1588 of file stl_rope.h.

References concat, concat_char_iter, size, substring, and unref.

01588                                                          {
01589             self_destruct_ptr left(substring(tree_ptr, 0, p));
01590             self_destruct_ptr right(substring(tree_ptr, p, size()));
01591             self_destruct_ptr left_result(concat_char_iter(left, i, n));
01592             RopeBase * result =
01593                                 concat(left_result, right);
01594             unref(tree_ptr);
01595             tree_ptr = result;
01596         }

template<class charT, class Alloc>
void rope< charT, Alloc >::insert size_t    p,
size_t    n,
charT    c
[inline]
 

Definition at line 1583 of file stl_rope.h.

References insert.

01583                                                  {
01584             rope<charT,Alloc> r(n,c);
01585             insert(p, r);
01586         }

template<class charT, class Alloc>
void rope< charT, Alloc >::insert size_t    p,
const rope< charT, Alloc > &    r
[inline]
 

Definition at line 1576 of file stl_rope.h.

References replace, tree_ptr, and unref.

Referenced by insert.

01576                                              {
01577             RopeBase * result = replace(tree_ptr, p, p,
01578                                                r.tree_ptr);
01579             unref(tree_ptr);
01580             tree_ptr = result;
01581         }

template<class charT, class Alloc>
bool rope< charT, Alloc >::is0 charT    c [inline, static, protected]
 

Definition at line 969 of file stl_rope.h.

References __eos.

00969 { return c == __eos((charT *)0); }

template<class charT, class Alloc>
bool rope< charT, Alloc >::is_almost_balanced RopeBase   r [inline, static, protected]
 

Definition at line 1167 of file stl_rope.h.

References min_len, and size.

01168                 { return (r -> depth == 0 ||
01169                           r -> size >= min_len[r -> depth - 1]); }

template<class charT, class Alloc>
bool rope< charT, Alloc >::is_balanced RopeBase   r [inline, static, protected]
 

Definition at line 1164 of file stl_rope.h.

References min_len, and size.

Referenced by concat_and_set_balanced.

01165                 { return (r -> size >= min_len[r -> depth]); }

template<class charT, class Alloc>
bool rope< charT, Alloc >::is_roughly_balanced RopeBase   r [inline, static, protected]
 

Definition at line 1171 of file stl_rope.h.

References min_len, and size.

01172                 { return (r -> depth <= 1 ||
01173                           r -> size >= min_len[r -> depth - 2]); }

template<class charT, class Alloc>
RopeLeaf* rope< charT, Alloc >::leaf_concat_char_iter RopeLeaf   r,
const charT *    iter,
size_t    slen
[static, protected]
 

template<class charT, class Alloc>
size_type rope< charT, Alloc >::length   const [inline]
 

Definition at line 1446 of file stl_rope.h.

References size, and size_type.

01446                                  {
01447             return size();
01448         }

template<class charT, class Alloc>
size_type rope< charT, Alloc >::max_size   const [inline]
 

Definition at line 1450 of file stl_rope.h.

References min_len, and size_type.

01450                                    {
01451             return min_len[RopeBase::max_rope_depth-1] - 1;
01452             //  Guarantees that the result can be sufficirntly
01453             //  balanced.  Longer ropes will probably still work,
01454             //  but it's harder to make guarantees.
01455         }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::mutable_begin   [inline]
 

Definition at line 1820 of file stl_rope.h.

References iterator.

Referenced by mutable_rend.

01820                                  {
01821             return(iterator(this, 0));
01822         }

template<class charT, class Alloc>
iterator rope< charT, Alloc >::mutable_end   [inline]
 

Definition at line 1824 of file stl_rope.h.

References iterator, and size.

Referenced by mutable_rbegin.

01824                                {
01825             return(iterator(this, size()));
01826         }

template<class charT, class Alloc>
reverse_iterator rope< charT, Alloc >::mutable_rbegin   [inline]
 

Definition at line 1835 of file stl_rope.h.

References mutable_end, and reverse_iterator.

01835                                           {
01836             return reverse_iterator(mutable_end());
01837         }

template<class charT, class Alloc>
reference rope< charT, Alloc >::mutable_reference_at size_type    pos [inline]
 

Definition at line 1843 of file stl_rope.h.

References reference, and size_type.

Referenced by __mutable_reference_at.

01843                                                       {
01844             return reference(this, pos);
01845         }

template<class charT, class Alloc>
reverse_iterator rope< charT, Alloc >::mutable_rend   [inline]
 

Definition at line 1839 of file stl_rope.h.

References mutable_begin, and reverse_iterator.

01839                                         {
01840             return reverse_iterator(mutable_begin());
01841         }

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

Definition at line 1306 of file stl_rope.h.

References ref, tree_ptr, and unref.

01307         {
01308             RopeBase *old = tree_ptr;
01309             tree_ptr = x.tree_ptr;
01310             ref(tree_ptr);
01311             unref(old);
01312             return(*this);
01313         }

template<class charT, class Alloc>
charT rope< charT, Alloc >::operator[] size_type    pos const [inline]
 

Definition at line 1416 of file stl_rope.h.

References fetch, and size_type.

01416                                                {
01417             return fetch(tree_ptr, pos);
01418         }

template<class charT, class Alloc>
void rope< charT, Alloc >::pop_back   [inline]
 

Definition at line 1322 of file stl_rope.h.

References size, substring, and unref.

01323         {
01324             RopeBase *old = tree_ptr;
01325             tree_ptr = substring(tree_ptr, 0, tree_ptr -> size - 1);
01326             unref(old);
01327         }

template<class charT, class Alloc>
void rope< charT, Alloc >::pop_front   [inline]
 

Definition at line 1348 of file stl_rope.h.

References size, substring, and unref.

01349         {
01350             RopeBase *old = tree_ptr;
01351             tree_ptr = substring(tree_ptr, 1, tree_ptr -> size);
01352             unref(old);
01353         }

template<class charT, class Alloc>
void rope< charT, Alloc >::push_back charT    x [inline]
 

Definition at line 1315 of file stl_rope.h.

References concat_char_iter, and unref.

01316         {
01317             RopeBase *old = tree_ptr;
01318             tree_ptr = concat_char_iter(tree_ptr, &x, 1);
01319             unref(old);
01320         }

template<class charT, class Alloc>
void rope< charT, Alloc >::push_front charT    x [inline]
 

Definition at line 1334 of file stl_rope.h.

References __STL_TRY, __STL_UNWIND, concat, RopeLeaf_from_unowned_char_ptr, and unref.

01335         {
01336             RopeBase *old = tree_ptr;
01337             RopeBase *left;
01338 
01339             left = RopeLeaf_from_unowned_char_ptr(&x, 1);
01340             __STL_TRY {
01341               tree_ptr = concat(left, tree_ptr);
01342               unref(old);
01343               unref(left);
01344             }
01345             __STL_UNWIND(unref(left))
01346         }

template<class charT, class Alloc>
const_reverse_iterator rope< charT, Alloc >::rbegin   [inline]
 

Definition at line 1888 of file stl_rope.h.

References const_rbegin.

01888 { return const_rbegin(); }

template<class charT, class Alloc>
const_reverse_iterator rope< charT, Alloc >::rbegin   const [inline]
 

Definition at line 1464 of file stl_rope.h.

References const_reverse_iterator, and end.

01464                                               {
01465             return const_reverse_iterator(end());
01466         }

template<class charT, class Alloc>
void rope< charT, Alloc >::ref RopeBase   t [inline, static, protected]
 

Definition at line 1008 of file stl_rope.h.

Referenced by operator=, replace, and rope.

01009           {
01010               RopeBase::ref(t);
01011           }

template<class charT, class Alloc>
const_reverse_iterator rope< charT, Alloc >::rend   [inline]
 

Definition at line 1886 of file stl_rope.h.

References const_rend.

01886 { return const_rend(); }

template<class charT, class Alloc>
const_reverse_iterator rope< charT, Alloc >::rend   const [inline]
 

Definition at line 1472 of file stl_rope.h.

References begin, and const_reverse_iterator.

01472                                             {
01473             return const_reverse_iterator(begin());
01474         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
iterator    i,
iterator    j
[inline]
 

Definition at line 1770 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01771                 { replace(p.index(), i, j); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const_iterator    i,
const_iterator    j
[inline]
 

Definition at line 1768 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01769                 { replace(p.index(), i, j); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const charT *    i,
const charT *    j
[inline]
 

Definition at line 1766 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01767                 { replace(p.index(), i, j); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const charT *    i,
size_t    n
[inline]
 

Definition at line 1764 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01765                 { replace(p.index(), i, n); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const charT *    c_string
[inline]
 

Definition at line 1762 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01763                 { replace(p.index(), c_string); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
charT    c
[inline]
 

Definition at line 1760 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01761                 { replace(p.index(), c); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const rope< charT, Alloc > &    r
[inline]
 

Definition at line 1758 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01759                 { replace(p.index(), r); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const iterator   q,
const iterator   i,
const iterator   j
[inline]
 

Definition at line 1753 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01755                 { replace(p.index(), q.index() - p.index(), i, j); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const iterator   q,
const const_iterator   i,
const const_iterator   j
[inline]
 

Definition at line 1750 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01752                 { replace(p.index(), q.index() - p.index(), i, j); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const iterator   q,
const charT *    i,
const charT *    j
[inline]
 

Definition at line 1747 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01749                 { replace(p.index(), q.index() - p.index(), i, j); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const iterator   q,
const charT *    i,
size_t    n
[inline]
 

Definition at line 1744 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01746                 { replace(p.index(), q.index() - p.index(), i, n); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const iterator   q,
const charT *    c_string
[inline]
 

Definition at line 1741 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01743                 { replace(p.index(), q.index() - p.index(), c_string); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const iterator   q,
charT    c
[inline]
 

Definition at line 1739 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01740                 { replace(p.index(), q.index() - p.index(), c); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace const iterator   p,
const iterator   q,
const rope< charT, Alloc > &    r
[inline]
 

Definition at line 1736 of file stl_rope.h.

References __rope_iterator_base::index, and replace.

01738                 { replace(p.index(), q.index() - p.index(), r); }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
const iterator   i,
const iterator   j
[inline]
 

Definition at line 1696 of file stl_rope.h.

References replace.

01697                                                   {
01698             replace(p, 1, i, j);
01699         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
const const_iterator   i,
const const_iterator   j
[inline]
 

Definition at line 1691 of file stl_rope.h.

References replace.

01692                                                         {
01693             replace(p, 1, i, j);
01694         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
const charT *    i,
const charT *    j
[inline]
 

Definition at line 1687 of file stl_rope.h.

References replace.

01687                                                                {
01688             replace(p, 1, i, j);
01689         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
const charT *    c_string
[inline]
 

Definition at line 1683 of file stl_rope.h.

References replace.

01683                                                       {
01684             replace(p, 1, c_string);
01685         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
const charT *    i,
size_t    i_len
[inline]
 

Definition at line 1679 of file stl_rope.h.

References replace.

01679                                                              {
01680             replace(p, 1, i, i_len);
01681         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
const rope< charT, Alloc > &    r
[inline]
 

Definition at line 1675 of file stl_rope.h.

References replace.

01675                                               {
01676             replace(p, 1, r);
01677         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
charT    c
[inline]
 

Definition at line 1670 of file stl_rope.h.

01670                                         {
01671             iterator i(this, p);
01672             *i = c;
01673         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
size_t    n,
const iterator   i,
const iterator   j
[inline]
 

Definition at line 1663 of file stl_rope.h.

References replace.

01664                                                            {
01665             rope r(i, j);
01666             replace(p, n, r);
01667         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
size_t    n,
const const_iterator   i,
const const_iterator   j
[inline]
 

Definition at line 1657 of file stl_rope.h.

References replace.

01658                                                                        {
01659             rope r(i, j);
01660             replace(p, n, r);
01661         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
size_t    n,
const charT *    i,
const charT *    j
[inline]
 

Definition at line 1652 of file stl_rope.h.

References replace.

01652                                                                          {
01653             rope r(i, j);
01654             replace(p, n, r);
01655         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
size_t    n,
const charT *    c_string
[inline]
 

Definition at line 1647 of file stl_rope.h.

References replace.

01647                                                                 {
01648             rope r(c_string);
01649             replace(p, n, r);
01650         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
size_t    n,
charT    c
[inline]
 

Definition at line 1642 of file stl_rope.h.

References replace.

01642                                                   {
01643             rope r(c);
01644             replace(p, n, r);
01645         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
size_t    n,
const charT *    i,
size_t    i_len
[inline]
 

Definition at line 1637 of file stl_rope.h.

References replace.

01637                                                                        {
01638             rope r(i, i_len);
01639             replace(p, n, r);
01640         }

template<class charT, class Alloc>
void rope< charT, Alloc >::replace size_t    p,
size_t    n,
const rope< charT, Alloc > &    r
[inline]
 

Definition at line 1630 of file stl_rope.h.

References replace, tree_ptr, and unref.

01630                                                         {
01631             RopeBase * result = replace(tree_ptr, p, p + n,
01632                                                r.tree_ptr);
01633             unref(tree_ptr);
01634             tree_ptr = result;
01635         }

template<class charT, class Alloc>
RopeBase* rope< charT, Alloc >::replace RopeBase   old,
size_t    pos1,
size_t    pos2,
RopeBase   r
[inline, static, protected]
 

Definition at line 1559 of file stl_rope.h.

References concat, ref, size, and substring.

Referenced by erase, insert, and replace.

01560                                                             {
01561             if (0 == old) { ref(r); return r; }
01562             self_destruct_ptr left(substring(old, 0, pos1));
01563             self_destruct_ptr right(substring(old, pos2, old -> size));
01564             RopeBase * result;
01565 
01566             if (0 == r) {
01567                 result = concat(left, right);
01568             } else {
01569                 self_destruct_ptr left_result(concat(left, r));
01570                 result = concat(left_result, right);
01571             }
01572             return result;
01573         }

template<class charT, class Alloc>
const charT* rope< charT, Alloc >::replace_with_c_str  
 

template<class charT, class Alloc>
RopeFunction* rope< charT, Alloc >::RopeFunction_from_fn char_producer< charT > *    fn,
size_t    size,
bool    delete_fn
[static, protected]
 

Referenced by rope.

template<class charT, class Alloc>
RopeLeaf* rope< charT, Alloc >::RopeLeaf_from_char_ptr __GC_CONST charT *    s,
size_t    size
[static, protected]
 

Referenced by rope, and RopeLeaf_from_unowned_char_ptr.

template<class charT, class Alloc>
RopeLeaf* rope< charT, Alloc >::RopeLeaf_from_unowned_char_ptr const charT *    s,
size_t    size
[inline, static, protected]
 

Definition at line 1092 of file stl_rope.h.

References __STL_TRY, __STL_UNWIND, alloc_copy, RopeLeaf_from_char_ptr, and size.

Referenced by push_front, and rope.

01093                                                                       {
01094             charT * buf = alloc_copy(s, size);
01095             __STL_TRY {
01096               return RopeLeaf_from_char_ptr(buf, size);
01097             }
01098             __STL_UNWIND(RopeBase::free_string(buf, size))
01099         }

template<class charT, class Alloc>
size_t rope< charT, Alloc >::rounded_up_size size_t    n [inline, static, protected]
 

Definition at line 1058 of file stl_rope.h.

Referenced by alloc_copy, allocated_capacity, and rope.

01058                                                 {
01059             return RopeBase::rounded_up_size(n);
01060         }

template<class charT, class Alloc>
size_type rope< charT, Alloc >::size   const [inline]
 

Definition at line 1442 of file stl_rope.h.

References size, and size_type.

Referenced by alloc_copy, back, const_end, copy, end, insert, is_almost_balanced, is_balanced, is_roughly_balanced, length, mutable_end, pop_back, pop_front, replace, RopeLeaf_from_unowned_char_ptr, and size.

01442                                { 
01443             return(0 == tree_ptr? 0 : tree_ptr -> size);
01444         }

template<class charT, class Alloc>
rope<charT,Alloc> rope< charT, Alloc >::substr const_iterator    start [inline]
 

Definition at line 1808 of file stl_rope.h.

References __rope_iterator_base::index, and substring.

01808                                                        {
01809             size_t pos = start.index();
01810             return rope<charT,Alloc>(substring(tree_ptr, pos, pos + 1));
01811         }

template<class charT, class Alloc>
rope rope< charT, Alloc >::substr const_iterator    start,
const_iterator    end
const [inline]
 

Definition at line 1801 of file stl_rope.h.

References __rope_iterator_base::index, and substring.

01801                                                                     {
01802             // This might eventually take advantage of the cache in the
01803             // iterator.
01804             return rope<charT,Alloc>
01805                 (substring(tree_ptr, start.index(), end.index()));
01806         }

template<class charT, class Alloc>
rope rope< charT, Alloc >::substr iterator    start const [inline]
 

Definition at line 1795 of file stl_rope.h.

References __rope_iterator_base::index, and substring.

01795                                           {
01796             size_t pos = start.index();
01797             return rope<charT,Alloc>(
01798                         substring(tree_ptr, pos, pos + 1));
01799         }

template<class charT, class Alloc>
rope rope< charT, Alloc >::substr iterator    start,
iterator    end
const [inline]
 

Definition at line 1790 of file stl_rope.h.

References __rope_iterator_base::index, and substring.

01790                                                         {
01791             return rope<charT,Alloc>(
01792                         substring(tree_ptr, start.index(), end.index()));
01793         }

template<class charT, class Alloc>
rope rope< charT, Alloc >::substr size_t    start,
size_t    len = 1
const [inline]
 

Definition at line 1785 of file stl_rope.h.

References substring.

01785                                                         {
01786             return rope<charT,Alloc>(
01787                         substring(tree_ptr, start, start + len));
01788         }

template<class charT, class Alloc>
RopeBase* rope< charT, Alloc >::substring RopeBase   base,
size_t    start,
size_t    endp1
[static, protected]
 

Referenced by append, insert, pop_back, pop_front, replace, rope, and substr.

template<class charT, class Alloc>
void rope< charT, Alloc >::swap rope< charT, Alloc > &    b [inline]
 

Definition at line 1550 of file stl_rope.h.

References tree_ptr.

Referenced by hash< crope >::operator(), and swap.

01550                            {
01551             RopeBase * tmp = tree_ptr;
01552             tree_ptr = b.tree_ptr;
01553             b.tree_ptr = tmp;
01554         }

template<class charT, class Alloc>
RopeBase* rope< charT, Alloc >::tree_concat RopeBase   left,
RopeBase   right
[static, protected]
 

template<class charT, class Alloc>
void rope< charT, Alloc >::unref RopeBase   t [inline, static, protected]
 

Definition at line 1004 of file stl_rope.h.

Referenced by append, balance, erase, insert, operator=, pop_back, pop_front, push_back, push_front, replace, and ~rope.

01005           {
01006               RopeBase::unref(t);
01007           }


Friends And Related Function Documentation

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

Definition at line 922 of file stl_rope.h.

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

Definition at line 923 of file stl_rope.h.

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

Definition at line 919 of file stl_rope.h.

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

Definition at line 918 of file stl_rope.h.

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

Definition at line 921 of file stl_rope.h.

template<class charT, class Alloc>
friend struct __rope_RopeBase< charT, Alloc > [friend]
 

Definition at line 920 of file stl_rope.h.

template<class charT, class Alloc>
friend struct __rope_RopeSubstring< charT, Alloc > [friend]
 

Definition at line 924 of file stl_rope.h.

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

Definition at line 1143 of file stl_rope.h.

01143 { return rope<charT,Alloc>(); }

template<class charT, class Alloc>
rope<charT,Alloc> operator+__STL_NULL_TMPL_ARGS const rope< charT, Alloc > &    left,
charT    right
[friend]
 

template<class charT, class Alloc>
rope<charT,Alloc> operator+__STL_NULL_TMPL_ARGS const rope< charT, Alloc > &    left,
const charT *    right
[friend]
 

template<class charT, class Alloc>
rope<charT,Alloc> operator+__STL_NULL_TMPL_ARGS const rope< charT, Alloc > &    left,
const rope< charT, Alloc > &    right
[friend]
 

template<class charT, class Alloc>
friend struct rope< charT, Alloc >::concat_fn [friend]
 

Definition at line 1133 of file stl_rope.h.


Member Data Documentation

template<class charT, class Alloc>
charT rope::empty_c_str[1] [static, protected]
 

Definition at line 962 of file stl_rope.h.

template<class charT, class Alloc>
const unsigned long rope::min_len[RopeBase::max_rope_depth + 1] [static, protected]
 

Definition at line 1162 of file stl_rope.h.

Referenced by is_almost_balanced, is_balanced, is_roughly_balanced, and max_size.

template<class charT, class Alloc>
RopeBase* rope::tree_ptr [protected]
 

Definition at line 981 of file stl_rope.h.

Referenced by append, compare, insert, operator+=, operator=, replace, rope, and swap.


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

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

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