Base Framework
Public Member Functions | List of all members
HashTable< KEY, VALUE >::HashTableImpl Class Reference

Inherits ReferenceCountedObject.

Public Member Functions

Node ** getBuckets () noexcept
 
const Node *const * getBuckets () const noexcept
 
 HashTableImpl (MemorySize capacity)
 
 HashTableImpl (const HashTableImpl &copy)
 
void grow ()
 
void shrink () noexcept
 
MemorySize getCapacity () const noexcept
 
MemorySize getSize () const noexcept
 
bool hasKey (const Key &key) noexcept
 
bool hasKey (const Key &key) const noexcept
 
Valuefind (const Key &key)
 
const Valuefind (const Key &key) const
 
ValuegetValue (const Key &key)
 
const ValuegetValue (const Key &key) const
 
void add (const Key &key, const Value &value)
 
void dump ()
 
void remove (const Key &key)
 
 ~HashTableImpl ()
 
- Public Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject () noexcept
 
 ReferenceCountedObject (const ReferenceCountedObject &copy) noexcept
 
 ReferenceCountedObject (ReferenceCountedObject &&move) noexcept
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &copy) noexcept
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&move) noexcept
 
MemorySize getNumberOfReferences_INTERNAL () const noexcept
 
virtual bool useGarbageCollector () const noexcept
 
- Public Member Functions inherited from DynamicObject
 DynamicObject () noexcept
 
bool isValidObject () const noexcept
 
virtual ~DynamicObject () noexcept(false)
 
 _COM_AZURE_DEV__BASE__OVERRIDE_ALLOC ()
 

Constructor & Destructor Documentation

◆ HashTableImpl() [1/2]

template<class KEY , class VALUE >
HashTable< KEY, VALUE >::HashTableImpl::HashTableImpl ( MemorySize  capacity)
inline

Initializes the hash table with the specified capacity.

◆ HashTableImpl() [2/2]

template<class KEY , class VALUE >
HashTable< KEY, VALUE >::HashTableImpl::HashTableImpl ( const HashTableImpl copy)
inline

Initializes the hash table from another hash table.

◆ ~HashTableImpl()

template<class KEY , class VALUE >
HashTable< KEY, VALUE >::HashTableImpl::~HashTableImpl ( )
inline

Destroys the hash table.

Member Function Documentation

◆ add()

template<class KEY , class VALUE >
void HashTable< KEY, VALUE >::HashTableImpl::add ( const Key key,
const Value value 
)
inline

Adds the element to the table.

◆ find() [1/2]

template<class KEY , class VALUE >
Value* HashTable< KEY, VALUE >::HashTableImpl::find ( const Key key)
inline

Returns the value associated with the specified key.

Parameters
keyThe key of the value.
Returns
nullptr is key doesn't exist.

◆ find() [2/2]

template<class KEY , class VALUE >
const Value* HashTable< KEY, VALUE >::HashTableImpl::find ( const Key key) const
inline

Returns the value associated with the specified key.

Parameters
keyThe key of the value.
Returns
nullptr is key doesn't exist.

◆ getBuckets() [1/2]

template<class KEY , class VALUE >
const Node* const* HashTable< KEY, VALUE >::HashTableImpl::getBuckets ( ) const
inlinenoexcept

Returns the buckets for non-modifying access.

◆ getBuckets() [2/2]

template<class KEY , class VALUE >
Node** HashTable< KEY, VALUE >::HashTableImpl::getBuckets ( )
inlinenoexcept

Returns the buckets for modifying access.

◆ getCapacity()

template<class KEY , class VALUE >
MemorySize HashTable< KEY, VALUE >::HashTableImpl::getCapacity ( ) const
inlinenoexcept

Returns the capacity of the hash table.

◆ getSize()

template<class KEY , class VALUE >
MemorySize HashTable< KEY, VALUE >::HashTableImpl::getSize ( ) const
inlinenoexcept

Returns the number of elements in the hash table.

◆ getValue() [1/2]

template<class KEY , class VALUE >
Value& HashTable< KEY, VALUE >::HashTableImpl::getValue ( const Key key)
inline

Returns the value associated with the specified key.

◆ getValue() [2/2]

template<class KEY , class VALUE >
const Value& HashTable< KEY, VALUE >::HashTableImpl::getValue ( const Key key) const
inline

Returns the value associated with the specified key.

◆ grow()

template<class KEY , class VALUE >
void HashTable< KEY, VALUE >::HashTableImpl::grow ( )
inline

Increases the capacity of the hash table.

◆ hasKey() [1/2]

template<class KEY , class VALUE >
bool HashTable< KEY, VALUE >::HashTableImpl::hasKey ( const Key key) const
inlinenoexcept

Returns true if the specified value is a key in the hash table.

◆ hasKey() [2/2]

template<class KEY , class VALUE >
bool HashTable< KEY, VALUE >::HashTableImpl::hasKey ( const Key key)
inlinenoexcept

Returns true if the specified value is a key in the hash table.

◆ remove()

template<class KEY , class VALUE >
void HashTable< KEY, VALUE >::HashTableImpl::remove ( const Key key)
inline

Removes the element with the specified key from the table.

◆ shrink()

template<class KEY , class VALUE >
void HashTable< KEY, VALUE >::HashTableImpl::shrink ( )
inlinenoexcept

Reduces the capacity of the hash table.