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

__rope_RopeSubstring Struct Template Reference

#include <stl_rope.h>

Inheritance diagram for __rope_RopeSubstring:

Inheritance graph
[legend]
Collaboration diagram for __rope_RopeSubstring:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual ~__rope_RopeSubstring ()
virtual void operator() (size_t start_pos, size_t req_len, charT *buffer)
 __rope_RopeSubstring (__rope_RopeBase< charT, Alloc > *b, size_t s, size_t l)

Public Attributes

__rope_RopeBase< charT, Alloc > * base
size_t start

template<class charT, class Alloc>
struct __rope_RopeSubstring< charT, Alloc >


Constructor & Destructor Documentation

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

Definition at line 455 of file stl_rope.h.

00455 {}

template<class charT, class Alloc>
__rope_RopeSubstring< charT, Alloc >::__rope_RopeSubstring __rope_RopeBase< charT, Alloc > *    b,
size_t    s,
size_t    l
[inline]
 

Definition at line 481 of file stl_rope.h.

References __rope_RopeBase::c_string, __rope_RopeBase::depth, __rope_RopeFunction::fn, __rope_RopeBase::init_refcount_lock, __rope_RopeBase::ref_nonnil, __rope_RopeBase::refcount, __rope_RopeBase::size, start, __rope_RopeBase::substringfn, and __rope_RopeBase::tag.

00481                                                                                :
00482         base(b), start(s) {
00483 #       ifndef __GC
00484             refcount = 1;
00485             init_refcount_lock();
00486             base -> ref_nonnil();
00487 #       endif
00488         size = l;
00489         tag = substringfn;
00490         depth = 0;
00491         c_string = 0;
00492         fn = this;
00493     }
};


Member Function Documentation

template<class charT, class Alloc>
virtual void __rope_RopeSubstring< charT, Alloc >::operator() size_t    start_pos,
size_t    req_len,
charT *    buffer
[inline, virtual]
 

Implements char_producer.

Definition at line 456 of file stl_rope.h.

References __GC_CONST, __stl_assert, __rope_RopeFunction::fn, __rope_RopeBase::function, __rope_RopeBase::leaf, __rope_RopeBase::size, start, __rope_RopeBase::substringfn, __rope_RopeBase::tag, and uninitialized_copy_n.

00457                                            {
00458         switch(base -> tag) {
00459             case function:
00460             case substringfn:
00461               {
00462                 char_producer<charT> *fn =
00463                         ((__rope_RopeFunction<charT,Alloc> *)base) -> fn;
00464                 __stl_assert(start_pos + req_len <= size);
00465                 __stl_assert(start + size <= base -> size);
00466                 (*fn)(start_pos + start, req_len, buffer);
00467               }
00468               break;
00469             case leaf:
00470               {
00471                 __GC_CONST charT * s =
00472                         ((__rope_RopeLeaf<charT,Alloc> *)base) -> data;
00473                 uninitialized_copy_n(s + start_pos + start, req_len,
00474                                      buffer);
00475               }
00476               break;
00477             default:
00478               __stl_assert(false);
00479         }
00480     }


Member Data Documentation

template<class charT, class Alloc>
__rope_RopeBase<charT,Alloc>* __rope_RopeSubstring::base
 

Definition at line 453 of file stl_rope.h.

template<class charT, class Alloc>
size_t __rope_RopeSubstring::start
 

Definition at line 454 of file stl_rope.h.

Referenced by __rope_RopeSubstring, and operator().


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

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

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