Xalan-C++ API Documentation
Go to the documentation of this file.
19 #if !defined(XALANMAP_HEADER_GUARD_1357924680)
20 #define XALANMAP_HEADER_GUARD_1357924680
39 XALAN_CPP_NAMESPACE_BEGIN
43 #pragma warning(disable: 4189)
49 class XalanHasher :
public XALAN_STD_QUALIFIER unary_function<Key, size_type>
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];
98 template <
class Value>
106 template <
class Value>
114 template <
class XalanMapTraits,
class BaseIterator>
119 typedef typename XalanMapTraits::pointer
pointer;
168 return !(theRhs == *
this);
201 typedef XALAN_STD_QUALIFIER pair<const key_type, data_type>
value_type;
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;
503 FirstConstructor::construct(
504 const_cast<key_type*
>(&newEntry.value->first),
510 SecondConstructor::construct(
511 &newEntry.value->second,
517 SecondConstructor::construct(
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);
745 #if defined(_MSC_VER)
751 XALAN_CPP_NAMESPACE_END
755 #endif // XALANMAP_HEADER_GUARD_1357924680
void doErase(iterator pos)
XalanMapIterator< XalanMapIteratorTraits< value_type >, typename EntryListType::iterator > iterator
BucketTableType::iterator TableIterator
MemoryManager & getMemoryManager()
const typedef Value & reference
XALAN_STD_QUALIFIER bidirectional_iterator_tag iterator_category
XalanMapIterator(const BaseIterator &theRhs)
iterator doCreateEntry(const key_type &key, const data_type *data=0)
XALAN_STD_QUALIFIER equal_to< Key > Comparator
XalanMapTraits::value_type value_type
data_type & operator[](const key_type &key)
size_type doHash(const Key &key, size_type modulus) const
size_type operator()(const Key &key) const
size_type m_eraseThreshold
ptrdiff_t difference_type
XalanMap(const XalanMap &theRhs, MemoryManager &theMemoryManager)
XalanVector< BucketType, ConstructWithMemoryManagerTraits< BucketType > > BucketTableType
void push_back(const value_type &data)
size_type operator()(const Key &key) const
XalanMapIterator(const Iterator &theRhs)
size_type capacity() const
XalanMap(MemoryManager &theMemoryManager, double loadFactor=0.75, size_type minBuckets=eDefaultMinBuckets, size_type eraseThreshold=eDefaultEraseThreshold)
XalanMapTraits::pointer pointer
MemoryManager * m_memoryManager
iterator find(const key_type &key)
XalanMapIterator & operator++()
bool operator==(const XalanMapIterator &theRhs) const
value_type * allocate(size_type size)
const_iterator find(const key_type &key) const
pointer operator->() const
XalanHasher< Key > Hasher
XalanVector< typename EntryListType::iterator > BucketType
BaseIterator baseIterator
Xalan implementation of a hashtable.
XalanMapIterator operator++(int)
void splice(iterator pos, ThisType &list, iterator toInsert)
size_type operator()(const Key *key) const
iterator erase(iterator theFirst, iterator theLast)
BucketTableType m_buckets
BucketType::iterator BucketIterator
const_iterator end() const
size_type erase(const key_type &key)
Entry(value_type *theValue)
const_iterator begin() const
void insert(const value_type &value)
void insert(iterator thePosition, const_iterator theFirst, const_iterator theLast)
const size_type m_minBuckets
bool operator!=(const XalanMapIterator &theRhs) const
Key key_type
Each map entry is stored in a linked list where an entry consists of a pointer to the key/value pair ...
const typedef Value * pointer
XalanMapTraits::reference reference
void insert(const key_type &key, const data_type &data)
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
KeyTraits::Comparator m_equals
XalanMapIterator< XalanMapConstIteratorTraits< value_type >, typename EntryListType::iterator > const_iterator
void swap(ThisType &theRHS)
void push_back(const value_type &data)
ValueConstructionTraits::Constructor SecondConstructor
EntryListType m_freeEntries
XalanMap & operator=(const XalanMap &theRhs)
XALAN_STD_QUALIFIER pair< const key_type, data_type > value_type
void swap(XalanMap &theRhs)
XalanMapIterator< XalanMapIteratorTraits< value_type >, BaseIterator > Iterator
void deallocate(value_type *pointer)
KeyConstructionTraits::Constructor FirstConstructor
static size_type calculateNewBucketCapacity(size_type theCurrentSize, size_type theExtraCapacity)
reference operator*() const
void doRemoveEntry(const iterator &toRemovePos)
EntryListType::iterator EntryListIterator
void swap(ThisType &theOther)
XalanList< Entry > EntryListType
size_type doHash(const Key &key) const
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.
|
|