Xalan-C++ API Reference 1.12.0
xalanc::XalanDOMStringPool Class Reference

#include <xalanc/PlatformSupport/XalanDOMStringPool.hpp>

Inheritance diagram for xalanc::XalanDOMStringPool:
[legend]

Public Types

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

Public Member Functions

 XalanDOMStringPool (MemoryManager &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 XalanDOMStringget (const XalanDOMString &theString)
 Get a pooled string.
virtual const XalanDOMStringget (const XalanDOMChar *theString, XalanDOMString::size_type theLength=XalanDOMString::npos)
 Get a pooled string.
const XalanDOMStringHashTablegetHashTable () const
 Get a reference to the pool's hash table.
MemoryManager & getMemoryManager ()
const MemoryManager & getMemoryManager () const

Static Public Member Functions

static XalanDOMStringPoolcreate (MemoryManager &theManager, block_size_type theBlockSize=eDefaultBlockSize, bucket_count_type theBucketCount=eDefaultBucketCount, bucket_size_type theBucketSize=eDefaultBucketSize)

Detailed Description

Definition at line 39 of file XalanDOMStringPool.hpp.

Member Typedef Documentation

◆ AllocatorType

◆ block_size_type

◆ bucket_count_type

Definition at line 50 of file XalanDOMStringPool.hpp.

◆ bucket_size_type

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eDefaultBlockSize 
eDefaultBucketCount 
eDefaultBucketSize 

Definition at line 43 of file XalanDOMStringPool.hpp.

Constructor & Destructor Documentation

◆ XalanDOMStringPool()

xalanc::XalanDOMStringPool::XalanDOMStringPool ( MemoryManager & theManager,
block_size_type theBlockSize = eDefaultBlockSize,
bucket_count_type theBucketCount = eDefaultBucketCount,
bucket_size_type theBucketSize = eDefaultBucketSize )
explicit

Create a string pool.

Parameters
theBlockSizeThe block size for the allocator.
theBucketCountThe number of buckets to use for the hash table. This should be a prime number for best results.
theBucketSizeThe initial size of each bucket in the hash table.

References eDefaultBlockSize, eDefaultBucketCount, eDefaultBucketSize, and XalanDOMStringPool().

Referenced by XalanDOMStringPool().

◆ ~XalanDOMStringPool()

virtual xalanc::XalanDOMStringPool::~XalanDOMStringPool ( )
virtual

Member Function Documentation

◆ clear()

virtual void xalanc::XalanDOMStringPool::clear ( )
virtual

Clear the pool.

Reimplemented in xalanc::XercesLiaisonXalanDOMStringPool.

◆ create()

XalanDOMStringPool * xalanc::XalanDOMStringPool::create ( MemoryManager & theManager,
block_size_type theBlockSize = eDefaultBlockSize,
bucket_count_type theBucketCount = eDefaultBucketCount,
bucket_size_type theBucketSize = eDefaultBucketSize )
static

◆ get() [1/2]

virtual const XalanDOMString & xalanc::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
theStringThe string to pool.
theLengthThe 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 xalanc::XercesLiaisonXalanDOMStringPool.

References xalanc::XalanDOMString::npos.

◆ get() [2/2]

virtual const XalanDOMString & xalanc::XalanDOMStringPool::get ( const XalanDOMString & theString)
virtual

Get a pooled string.

If the string is not pooled, it is added.

Parameters
theStringThe string to pool.
Returns
a const reference to the pooled string.

Reimplemented in xalanc::XercesLiaisonXalanDOMStringPool.

◆ getHashTable()

const XalanDOMStringHashTable & xalanc::XalanDOMStringPool::getHashTable ( ) const
inline

Get a reference to the pool's hash table.

Useful for diagnostic purposes.

Returns
a const reference to the hash table.

Definition at line 121 of file XalanDOMStringPool.hpp.

◆ getMemoryManager() [1/2]

MemoryManager & xalanc::XalanDOMStringPool::getMemoryManager ( )
inline

Definition at line 127 of file XalanDOMStringPool.hpp.

◆ getMemoryManager() [2/2]

const MemoryManager & xalanc::XalanDOMStringPool::getMemoryManager ( ) const
inline

Definition at line 133 of file XalanDOMStringPool.hpp.

◆ size()

virtual size_t xalanc::XalanDOMStringPool::size ( ) const
virtual

Get the number of strings in the pool.

Returns
the size of the pool.

Reimplemented in xalanc::XercesLiaisonXalanDOMStringPool.


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