19#if !defined(XALANMAP_HEADER_GUARD_1357924680)
20#define XALANMAP_HEADER_GUARD_1357924680
43#pragma warning(disable: 4189)
54 const char *byteArray =
reinterpret_cast<const char*
>(&key);
58 for (
size_type i = 0; i <
sizeof(Key); ++i)
60 result = (result << 1) ^ byteArray[i];
106template <
class Value>
114template <
class XalanMapTraits,
class BaseIterator>
119 typedef typename XalanMapTraits::pointer
pointer;
168 return !(theRhs == *
this);
243 MemoryManager& theMemoryManager,
244 double loadFactor = 0.75,
261 MemoryManager& theMemoryManager) :
277 while(entry != theRhs.
end())
362 while (pos != bucket.
end())
364 if (!(*pos)->erased &&
m_equals(key, (*pos)->value->first))
389 return (*pos).second;
395 insert(value.first, value.second);
501 newEntry.erased =
false;
504 const_cast<key_type*
>(&newEntry.value->first),
511 &newEntry.value->second,
518 &newEntry.value->second,
534#if defined(_MSC_VER) && _MSC_VER <= 1300
535 toRemove.value_type::~value_type();
537 toRemove.~value_type();
561 assert(pos !=
end());
580 assert(modulus != 0);
582 return m_hash(key) % modulus;
594 assert(theNewSize != 0);
608 entryPos->value->first,
630 assert(pointer != 0);
632 return reinterpret_cast<value_type*
>(pointer);
648 assert(theExtraCapacity > theCurrentSize);
655 return theCurrentSize == 0 ?
671 while(j != theCurrentBucket.
end())
673 if ((*j)->erased ==
true)
675 j = theCurrentBucket.
erase(j);
687 theCurrentBucket.
size();
690 theCurrentBucket.
capacity() - theCurrentSize;
692 if (theExtraCapacity > theCurrentSize)
707 theCurrentBucket.
swap(theTempBucket);
size_type operator()(const Key &key) const
Xalan implementation of a doubly linked list.
XalanListIteratorBase< XalanListIteratorTraits< value_type >, Node > iterator
Xalan implementation of a hashtable.
MemoryManager * m_memoryManager
data_type & operator[](const key_type &key)
void swap(XalanMap &theRhs)
AttributeVectorType data_type
XalanMapIterator< XalanMapIteratorTraits< value_type >, typename EntryListType::iterator > iterator
MemoryManagedConstructionTraits< const XalanDOMString * >::Constructor FirstConstructor
size_type m_eraseThreshold
const_iterator begin() const
iterator doCreateEntry(const key_type &key, const data_type *data=0)
size_type doHash(const Key &key) const
iterator find(const key_type &key)
const_iterator find(const key_type &key) const
XalanVector< BucketType, ConstructWithMemoryManagerTraits< BucketType > > BucketTableType
size_type erase(const key_type &key)
XalanMapKeyTraits< const XalanDOMString * >::Hasher m_hash
BucketTableType::iterator TableIterator
BucketType::iterator BucketIterator
std::pair< const key_type, data_type > value_type
void insert(const value_type &value)
XalanVector< typename EntryListType::iterator > BucketType
value_type * allocate(size_type size)
void insert(const key_type &key, const data_type &data)
const XalanDOMString * key_type
const_iterator end() const
XalanMap(const XalanMap &theRhs, MemoryManager &theMemoryManager)
MemoryManagedConstructionTraits< AttributeVectorType >::Constructor SecondConstructor
void deallocate(value_type *pointer)
XalanList< Entry > EntryListType
XalanMapKeyTraits< const XalanDOMString * >::Comparator m_equals
XalanMap(MemoryManager &theMemoryManager, double loadFactor=0.75, size_type minBuckets=eDefaultMinBuckets, size_type eraseThreshold=eDefaultEraseThreshold)
XalanMapIterator< XalanMapConstIteratorTraits< value_type >, typename EntryListType::iterator > const_iterator
void doErase(iterator pos)
XalanMap & operator=(const XalanMap &theRhs)
BucketTableType m_buckets
EntryListType::iterator EntryListIterator
const size_type m_minBuckets
void doRemoveEntry(const iterator &toRemovePos)
EntryListType m_freeEntries
size_type doHash(const const XalanDOMString *&key, size_type modulus) const
MemoryManager & getMemoryManager()
static size_type calculateNewBucketCapacity(size_type theCurrentSize, size_type theExtraCapacity)
void swap(ThisType &theOther)
void push_back(const value_type &data)
iterator erase(iterator theFirst, iterator theLast)
size_type capacity() const
static C * construct(C *address, MemoryManager &)
XalanMapTraits::reference reference
bool operator==(const XalanMapIterator &theRhs) const
XalanMapIterator(const BaseIterator &theRhs)
BaseIterator baseIterator
XalanMapTraits::pointer pointer
reference operator*() const
XalanMapIterator< XalanMapIteratorTraits< value_type >, BaseIterator > Iterator
XalanMapIterator(const Iterator &theRhs)
XalanMapTraits::value_type value_type
std::bidirectional_iterator_tag iterator_category
ptrdiff_t difference_type
pointer operator->() const
bool operator!=(const XalanMapIterator &theRhs) const
XalanMapIterator operator++(int)
XalanMapIterator & operator++()
std::equal_to< Key > Comparator
XalanHasher< Key > Hasher
Entry(value_type *theValue)