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

VectorOfPToContractElement Class Reference

The table that contains the list of contracting character entries. More...

#include <tables.h>

List of all members.

Public Types

enum  EGrowthRate { GROWTH_RATE = 4 }
 The chunk size by which the array is grown. More...


Public Methods

 VectorOfPToContractElement (int32_t initialSize = 0)
 Creates a vector that contains elements of PToContractElement. More...

 VectorOfPToContractElement (const VectorOfPToContractElement& that)
 Copy constructor.

 ~VectorOfPToContractElement ()
 Destructor.

const VectorOfPToContractElement& operator= (const VectorOfPToContractElement& that)
 Assignment operator.

PToContractElement operator[] (int32_t index)
 Return a modifiable smart-pointer to the EntryPair at the given index. More...

PToContractElement at (int32_t index)
EntryPairoperator[] (int32_t index) const
 Return a pointer to the EntryPair at the given index. More...

EntryPairat (int32_t index) const
void atPut ( int32_t index, EntryPair* value)
 Sets the element at the specified index to a different value. More...

void atInsert ( int32_t index, EntryPair* value)
 Inserts a value at the specified index, sliding the rest of the elements in the array over to make room. More...

EntryPairorphanAt (int32_t index)
 "Orphan" the pointer at the specified index. More...

int32_t size (void) const
 Returns the number of elements in the vector. More...

UBool isBogus (void) const
 Checks if this vector object is valid. More...

void streamOut (FileStream* os) const
 The streamIn and streamOut methods read and write objects of this class as binary, platform-dependent data in the iostream. More...

void streamIn (FileStream* is)
void streamOut (UMemoryStream* os) const
void streamIn (UMemoryStream* is)


Detailed Description

The table that contains the list of contracting character entries.

This is a vector class that is designed to be used with pointer types and which implements owning semantics. That is, once a value is placed an element of the vector, the vector is considered to own it and is responsible for disposing it. This will happen both when the element is changed using atPut() or through an PointerTo****, and when the vector itself is disposed.

WARNING: The caller must be careful to avoid holding onto any dangling references after the vector is disposed, and the caller must also be careful not to put the same value into more than one element in the vector (unless the value is NULL).

As with VectorOf***>, the vector grows as necessary to accommodate all elements, the size is one plus the index of the highest element that's been set, and any elements below the highest element that aren't explicitly initialized are initialized to NULL.

Definition at line 576 of file tables.h.


Member Enumeration Documentation

enum VectorOfPToContractElement::EGrowthRate
 

The chunk size by which the array is grown.

This probably shouldn't be in the API

Enumeration values:
GROWTH_RATE  

Definition at line 582 of file tables.h.


Constructor & Destructor Documentation

VectorOfPToContractElement::VectorOfPToContractElement ( int32_t initialSize = 0 )
 

Creates a vector that contains elements of PToContractElement.

Parameters:
initialSize   the initial size of the vector object.

VectorOfPToContractElement::VectorOfPToContractElement ( const VectorOfPToContractElement & that )
 

Copy constructor.

VectorOfPToContractElement::~VectorOfPToContractElement ( )
 

Destructor.


Member Function Documentation

EntryPair * VectorOfPToContractElement::at ( int32_t index ) const [inline]
 

Definition at line 1259 of file tables.h.

PToContractElement VectorOfPToContractElement::at ( int32_t index ) [inline]
 

Definition at line 1265 of file tables.h.

void VectorOfPToContractElement::atInsert ( int32_t index,
EntryPair * value )
 

Inserts a value at the specified index, sliding the rest of the elements in the array over to make room.

Parameters:
index   the specified index.
value   the value.

void VectorOfPToContractElement::atPut ( int32_t index,
EntryPair * value )
 

Sets the element at the specified index to a different value.

If there was aready an object stored at this index, it is deleted.

Parameters:
index   the specified index.
value   the new value.

UBool VectorOfPToContractElement::isBogus ( void ) const
 

Checks if this vector object is valid.

Returns:
TRUE if the vector object is valid, FALSE otherwise.

const VectorOfPToContractElement & VectorOfPToContractElement::operator= ( const VectorOfPToContractElement & that )
 

Assignment operator.

EntryPair * VectorOfPToContractElement::operator[] ( int32_t index ) const [inline]
 

Return a pointer to the EntryPair at the given index.

The pointer itself cannot be modified, but the elements it points to may:

  const VectorOfPToExpandTable foo = ....;
  foo[5] = ....;              // NOT ALLOWED
  foo[5]->entryName = ....;   // ok
 
This does not do range-checking; an invalid index may cause a crash.
Returns:
the accessed element.

Definition at line 1253 of file tables.h.

PToContractElement VectorOfPToContractElement::operator[] ( int32_t index )
 

Return a modifiable smart-pointer to the EntryPair at the given index.

Assigning to this smart pointer will work, e.g.

  PToContractElement foo = ....;
  foo[5] = ...;
 
This does range-checking; access to elements beyond the end of the array will cause the array to grow.

EntryPair * VectorOfPToContractElement::orphanAt ( int32_t index )
 

"Orphan" the pointer at the specified index.

The array will no longer contain a reference to the object, and the caller is now responsible for deleting its storage.

int32_t VectorOfPToContractElement::size ( void ) const [inline]
 

Returns the number of elements in the vector.

Returns:
the size of vector.

Definition at line 1271 of file tables.h.

void VectorOfPToContractElement::streamIn ( UMemoryStream * is )
 

void VectorOfPToContractElement::streamIn ( FileStream * is )
 

void VectorOfPToContractElement::streamOut ( UMemoryStream * os ) const
 

void VectorOfPToContractElement::streamOut ( FileStream * os ) const
 

The streamIn and streamOut methods read and write objects of this class as binary, platform-dependent data in the iostream.

The stream must be in ios::binary mode for this to work. These methods are not intended for general public use; they are used by the framework to improve performance by storing certain objects in binary files.


The documentation for this class was generated from the following file:
Generated at Tue Dec 5 17:56:36 2000 for ICU by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000