#include <xalanc/PlatformSupport/XalanDOMStringHashTable.hpp>
Definition at line 40 of file XalanDOMStringHashTable.hpp.
◆ bucket_size_type
◆ BucketCountsType
◆ BucketType
◆ BucketVectorType
◆ ConstructionTraits
◆ anonymous enum
◆ XalanDOMStringHashTable()
Create a hash table.
- Parameters
-
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. |
◆ ~XalanDOMStringHashTable()
xalanc::XalanDOMStringHashTable::~XalanDOMStringHashTable |
( |
| ) |
|
|
inline |
◆ bucketCount()
size_t xalanc::XalanDOMStringHashTable::bucketCount |
( |
| ) |
const |
|
inline |
◆ clear()
void xalanc::XalanDOMStringHashTable::clear |
( |
| ) |
|
◆ collisions()
size_t xalanc::XalanDOMStringHashTable::collisions |
( |
| ) |
const |
|
inline |
Get the collision count.
Release builds will always return 0.
- Returns
- The number of collisions. Valid only for non-release builds.
Definition at line 110 of file XalanDOMStringHashTable.hpp.
◆ find() [1/2]
Find a string.
If the string is not found, return null. If theBucketIndex is not null, the variable pointed to will be updated with the bucket index that was calculated for the string. This index can be used in a later call to insert() to avoid recalculating the index.
- Parameters
-
theString | The string to find. |
theLength | The number of characters in the string. |
theBucketIndex | A pointer to a parameter to get the bucket index |
- Returns
- a pointer to the string, or null if not found.
◆ find() [2/2]
Find a string.
If the string is not found, return null.
- Parameters
-
theString | The string to find. |
theBucketIndex | The index of the bucket for the string. |
- Returns
- a pointer to the string, or null if not found.
◆ getBucketCounts()
void xalanc::XalanDOMStringHashTable::getBucketCounts |
( |
BucketCountsType & |
theVector | ) |
const |
Get the size of each of the buckets in the table.
- Parameters
-
A | vector to return the bucket counts. |
◆ getMemoryManager() [1/2]
MemoryManager& xalanc::XalanDOMStringHashTable::getMemoryManager |
( |
| ) |
|
|
inline |
◆ getMemoryManager() [2/2]
const MemoryManager& xalanc::XalanDOMStringHashTable::getMemoryManager |
( |
| ) |
const |
|
inline |
◆ insert() [1/2]
void xalanc::XalanDOMStringHashTable::insert |
( |
const XalanDOMString & |
theString | ) |
|
Insert a pointer to a string into the table.
If the string is already present, the string will still be added, but it will never be found, since it will be placed after the identical string.
Note that this class only stores a pointer to a XalanDOMString. It's expected that the string will be allocated and managed outside of the hash table.
- Parameters
-
theString | The string to insert. |
◆ insert() [2/2]
void xalanc::XalanDOMStringHashTable::insert |
( |
const XalanDOMString & |
theString, |
|
|
size_t |
theBucketIndex |
|
) |
| |
Insert a pointer to a string into the table.
If the string is already present, the string will still be added, but it will never be found, since it will be placed after the identical string. theBucketIndex must be the index returned from a previous call to find. If not, then the behavior is undefined. This is meant as an optimization to avoid re-hashing the string.
Note that this class only stores a pointer to a XalanDOMString. It's expected that the string will be allocated and managed outside of the hash table.
- Parameters
-
theString | The string to insert. |
theBucketIndex | The index of the bucket for the string. |
◆ size()
size_t xalanc::XalanDOMStringHashTable::size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: