Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


Public Types | Public Member Functions | Static Public Member Functions | List of all members
XalanDOMStringPool Class Reference

#include <XalanDOMStringPool.hpp>

Inherited by XercesLiaisonXalanDOMStringPool.

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. More...
 
virtual ~XalanDOMStringPool ()
 
virtual void clear ()
 Clear the pool. More...
 
virtual size_t size () const
 Get the number of strings in the pool. More...
 
virtual const XalanDOMStringget (const XalanDOMString &theString)
 Get a pooled string. More...
 
virtual const XalanDOMStringget (const XalanDOMChar *theString, XalanDOMString::size_type theLength=XalanDOMString::npos)
 Get a pooled string. More...
 
const XalanDOMStringHashTablegetHashTable () const
 Get a reference to the pool's hash table. More...
 
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

Definition at line 47 of file XalanDOMStringPool.hpp.

◆ block_size_type

Definition at line 49 of file XalanDOMStringPool.hpp.

◆ bucket_count_type

Definition at line 50 of file XalanDOMStringPool.hpp.

◆ bucket_size_type

Definition at line 51 of file XalanDOMStringPool.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eDefaultBlockSize 
eDefaultBucketCount 
eDefaultBucketSize 

Definition at line 43 of file XalanDOMStringPool.hpp.

Constructor & Destructor Documentation

◆ XalanDOMStringPool()

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.

◆ ~XalanDOMStringPool()

virtual XalanDOMStringPool::~XalanDOMStringPool ( )
virtual

Member Function Documentation

◆ clear()

virtual void XalanDOMStringPool::clear ( )
virtual

Clear the pool.

Reimplemented in XercesLiaisonXalanDOMStringPool.

◆ create()

static XalanDOMStringPool* 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& 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 XercesLiaisonXalanDOMStringPool.

◆ get() [2/2]

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
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 XercesLiaisonXalanDOMStringPool.

◆ getHashTable()

const XalanDOMStringHashTable& 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& XalanDOMStringPool::getMemoryManager ( )
inline

Definition at line 127 of file XalanDOMStringPool.hpp.

◆ getMemoryManager() [2/2]

const MemoryManager& XalanDOMStringPool::getMemoryManager ( ) const
inline

Definition at line 133 of file XalanDOMStringPool.hpp.

◆ size()

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:

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.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo