## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.9

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

# XalanDOMStringPool Class Reference

Inheritance diagram for XalanDOMStringPool:

[legend]
Collaboration diagram for XalanDOMStringPool:

[legend]
List of all members.

## Public Types

- typedef XalanDOMStringAllocator AllocatorType
- typedef AllocatorType::size_type block_size_type
- typedef size_t bucket_count_type
- typedef XalanDOMStringHashTable::bucket_size_type bucket_size_type
- enum { eDefaultBlockSize = 32, eDefaultBucketCount = XalanDOMStringHashTable::eDefaultBucketCount, eDefaultBucketSize = XalanDOMStringHashTable::eDefaultBucketSize }

## Public Member Functions

- XalanDOMStringPool (MemoryManagerType &theManager, block_size_type theBlockSize=eDefaultBlockSize, bucket_count_type theBucketCount=eDefaultBucketCount, bucket_size_type theBucketSize=eDefaultBucketSize)
    Create a string pool.
- virtual ~XalanDOMStringPool ()
- virtual void clear ()
    Clear the pool.
- virtual size_t size () const
    Get the number of strings in the pool.
- virtual const XalanDOMString & get (const XalanDOMString &theString)
    Get a pooled string.
- virtual const XalanDOMString & get (const XalanDOMChar *theString, XalanDOMString::size_type theLength=XalanDOMString::npos)
    Get a pooled string.
- const XalanDOMStringHashTable & getHashTable () const
    Get a reference to the pool's hash table.
- MemoryManagerType & getMemoryManager ()
- const MemoryManagerType & getMemoryManager () const

## Static Public Member Functions

- XalanDOMStringPool * create (MemoryManagerType &theManager, block_size_type theBlockSize=eDefaultBlockSize, bucket_count_type theBucketCount=eDefaultBucketCount, bucket_size_type theBucketSize=eDefaultBucketSize)

## Member Typedef Documentation

typedef XalanDOMStringAllocator XalanDOMStringPool::AllocatorType

typedef AllocatorType::size_type XalanDOMStringPool::block_size_type

typedef size_t XalanDOMStringPool::bucket_count_type

typedef XalanDOMStringHashTable::bucket_size_type XalanDOMStringPool::bucket_size_type

## Member Enumeration Documentation

anonymous enum

Enumeration values:

  eDefaultBlockSize |
  eDefaultBucketCount |
  eDefaultBucketSize |

## Constructor & Destructor Documentation

XalanDOMStringPool::XalanDOMStringPool | ( | MemoryManagerType & | theManager,
|  | block_size_type | theBlockSize = eDefaultBlockSize,
|  | bucket_count_type | theBucketCount = eDefaultBucketCount,
|  | bucket_size_type | theBucketSize = eDefaultBucketSize
| ) | `[explicit]`

Create a string pool.

Parameters:

  theBlockSize | The block size for the allocator.
  theBucketCount | The number of buckets to use for the hash table. This should be a prime number for best results.
  theBucketSize | The initial size of each bucket in the hash table.

virtual XalanDOMStringPool::~XalanDOMStringPool | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual void XalanDOMStringPool::clear | ( |  | ) | `[virtual]`

| Clear the pool. Reimplemented in XercesLiaisonXalanDOMStringPool.

XalanDOMStringPool* XalanDOMStringPool::create | ( | MemoryManagerType & | theManager,
|  | block_size_type | theBlockSize = eDefaultBlockSize,
|  | bucket_count_type | theBucketCount = eDefaultBucketCount,
|  | bucket_size_type | theBucketSize = eDefaultBucketSize
| ) | `[static]`

virtual const XalanDOMString& XalanDOMStringPool::get | ( | const XalanDOMChar * | theString,
|  | XalanDOMString::size_type | theLength = XalanDOMString::npos
| ) | `[virtual]`

Get a pooled string.

If the string is not pooled, it is added.

Parameters:

  theString | The string to pool.
  theLength | The length of the string. If XalanDOMString::npos, the string is assumed to be null-terminated.

Returns:
  a const reference to the pooled string.

Reimplemented in XercesLiaisonXalanDOMStringPool.

virtual const XalanDOMString& XalanDOMStringPool::get | ( | const XalanDOMString & | theString | ) | `[virtual]`

Get a pooled string.

If the string is not pooled, it is added.

Parameters:

  theString | The string to pool.

Returns:
  a const reference to the pooled string.

Reimplemented in XercesLiaisonXalanDOMStringPool.

const XalanDOMStringHashTable& XalanDOMStringPool::getHashTable | ( |  | ) | const

Get a reference to the pool's hash table.

Useful for diagnostic purposes.

Returns:
  a const reference to the hash table.

const MemoryManagerType& XalanDOMStringPool::getMemoryManager | ( |  | ) | const

MemoryManagerType& XalanDOMStringPool::getMemoryManager | ( |  | ) |

virtual size_t XalanDOMStringPool::size | ( |  | ) | const`[virtual]`

Get the number of strings in the pool.

Returns:
  the size of the pool.

Reimplemented in XercesLiaisonXalanDOMStringPool.

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

- XalanDOMStringPool.hpp

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.9 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.