Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNRopeRep Struct Reference
[Ropes that hold unsigned characters]

#include <MNRopeRep.h>

Inheritance diagram for MNRopeRep:

Inheritance graph
[legend]
Collaboration diagram for MNRopeRep:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ProtectedPtr< uchar_t * > ProtectedUCharPtr
enum  { _S_max_rope_depth = 45 }
enum  _Tag { _S_leaf, _S_concat, _S_substringfn, _S_function }

Public Member Functions

 MNRopeRep (_Tag __t, int __d, bool __b, size_t __size)
virtual ~MNRopeRep ()
void _M_free_c_string ()
void _M_free_tree ()
void _M_unref_nonnil ()
void _M_ref_nonnil ()

Static Public Member Functions

void _S_free_string (uchar_t *, size_t __len)
void _S_unref (MNRopeRep *__t)
void _S_ref (MNRopeRep *__t)
void _S_free_if_unref (MNRopeRep *__t)

Public Attributes

size_t _M_size
_Tag _M_tag:8
bool _M_is_balanced:8
unsigned char _M_depth
ProtectedUCharPtr _M_c_string

Detailed Description

The internal data structure for representing a rope.
This is private to the implementation. A rope is really just a pointer to one of these.

A few basic functions for manipulating this data structure are members of MNRopeRep. Most of the more complex algorithms are implemented as rope members.

Some of the static member functions of MNRopeRep have identically named functions in rope that simply invoke the MNRopeRep versions.

A macro to introduce various allocation and deallocation functions These need to be defined differently depending on whether or not we are using standard conforming allocators, and whether the allocator instances have real state. Thus this macro is invoked repeatedly with different definitions of __ROPE_DEFINE_ALLOC. __ROPE_DEFINE_ALLOC(type,name) defines type * name_allocate(size_t) and void name_deallocate(tipe *, size_t) Both functions may or may not be static.

Internal rope nodes potentially store a copy of the allocator instance used to allocate them. This is mostly redundant. But the alternative would be to pass allocator instances around in some form to nearly all internal functions, since any pointer assignment may result in a zero reference count and thus require deallocation. The _Rope_rep_base class encapsulates the differences between SGI-style allocators and standard-conforming allocators.


Member Typedef Documentation

typedef ProtectedPtr<uchar_t*> MNRopeRep::ProtectedUCharPtr
 


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
_S_max_rope_depth 

enum MNRopeRep::_Tag
 

Enumeration values:
_S_leaf 
_S_concat 
_S_substringfn 
_S_function 


Constructor & Destructor Documentation

MNRopeRep::MNRopeRep _Tag  __t,
int  __d,
bool  __b,
size_t  __size
[inline]
 

virtual MNRopeRep::~MNRopeRep  )  [inline, virtual]
 


Member Function Documentation

void MNRopeRep::_M_free_c_string  ) 
 

void MNRopeRep::_M_free_tree  ) 
 

void MNRopeRep::_M_ref_nonnil  )  [inline]
 

void MNRopeRep::_M_unref_nonnil  )  [inline]
 

void MNRopeRep::_S_free_if_unref MNRopeRep __t  )  [inline, static]
 

void MNRopeRep::_S_free_string uchar_t *  ,
size_t  __len
[static]
 

void MNRopeRep::_S_ref MNRopeRep __t  )  [inline, static]
 

void MNRopeRep::_S_unref MNRopeRep __t  )  [inline, static]
 


Member Data Documentation

ProtectedUCharPtr MNRopeRep::_M_c_string
 

Flattened version of string, if needed.
Typically 0. If it's not 0, then the memory is owned by this node. In the case of a leaf, this may point to the same memory as the data field.

unsigned char MNRopeRep::_M_depth
 

bool MNRopeRep::_M_is_balanced
 

size_t MNRopeRep::_M_size
 

_Tag MNRopeRep::_M_tag
 


The documentation for this struct was generated from the following file:
Generated on Sun Mar 6 13:35:58 2005 for Komssys by doxygen 1.3.8