TdZdd  1.1
A top-down/breadth-first decision diagram manipulation framework
Public Member Functions | Protected Attributes | List of all members
tdzdd::MyHashTable< T, Hash, Equal > Class Template Reference

Closed hash table implementation. More...

#include <MyHashTable.hpp>

Public Member Functions

 MyHashTable (Hash const &hash=Hash(), Equal const &equal=Equal())
 Default constructor.
 
 MyHashTable (size_t n, Hash const &hash=Hash(), Equal const &equal=Equal())
 Constructor. More...
 
 MyHashTable (MyHashTable const &o, size_t n=1)
 Copy constructor. More...
 
void moveAssign (MyHashTable &o)
 Move constructor. More...
 
void clear ()
 Initialize the table to be empty. More...
 
void initialize (size_t n)
 Initialize the table to be empty. More...
 
void rehash (size_t n=1)
 Resize the storage appropriately. More...
 
Entry & add (Entry const &elem)
 Insert an element if no other equivalent element is registered. More...
 
Entry * get (Entry const &elem) const
 Get the element that is already registered. More...
 

Protected Attributes

Hash const hashFunc
 Functor for getting hash codes.
 
Equal const eqFunc
 Functor for checking equivalence.
 
size_t tableCapacity_
 Size of the hash table storage.
 
size_t tableSize_
 Size of the hash table.
 
size_t maxSize_
 The maximum number of elements.
 
size_t size_
 The number of elements.
 
Entry * table
 Pointer to the storage.
 

Detailed Description

template<typename T, typename Hash = MyHashDefault<T>, typename Equal = MyHashDefault<T>>
class tdzdd::MyHashTable< T, Hash, Equal >

Closed hash table implementation.

The default value T() cannot be added in the table.

Parameters
Ttype of elements.

Definition at line 147 of file MyHashTable.hpp.

Constructor & Destructor Documentation

◆ MyHashTable() [1/2]

template<typename T, typename Hash = MyHashDefault<T>, typename Equal = MyHashDefault<T>>
tdzdd::MyHashTable< T, Hash, Equal >::MyHashTable ( size_t  n,
Hash const &  hash = Hash(),
Equal const &  equal = Equal() 
)
inline

Constructor.

Parameters
ninitial table size.
hashhash function.
equalequality function

Definition at line 176 of file MyHashTable.hpp.

◆ MyHashTable() [2/2]

template<typename T, typename Hash = MyHashDefault<T>, typename Equal = MyHashDefault<T>>
tdzdd::MyHashTable< T, Hash, Equal >::MyHashTable ( MyHashTable< T, Hash, Equal > const &  o,
size_t  n = 1 
)
inline

Copy constructor.

Parameters
oobject to be copied.
nlower bound of initial table size.

Definition at line 188 of file MyHashTable.hpp.

Member Function Documentation

◆ add()

template<typename T, typename Hash = MyHashDefault<T>, typename Equal = MyHashDefault<T>>
Entry& tdzdd::MyHashTable< T, Hash, Equal >::add ( Entry const &  elem)
inline

Insert an element if no other equivalent element is registered.

Parameters
elemthe element to be inserted.
Returns
reference to the element in the table.

Definition at line 336 of file MyHashTable.hpp.

Referenced by tdzdd::DdBuilderMP< S >::construct(), tdzdd::MyHashTable< MyHashMapEntry< K, V >, MyHashMapHashWrapper< K, V, Hash, Equal >, MyHashMapHashWrapper< K, V, Hash, Equal > >::rehash(), tdzdd::ZddSubsetter< S >::subset(), and tdzdd::ZddSubsetterMP< S >::subset().

◆ clear()

template<typename T, typename Hash = MyHashDefault<T>, typename Equal = MyHashDefault<T>>
void tdzdd::MyHashTable< T, Hash, Equal >::clear ( )
inline

Initialize the table to be empty.

The memory is deallocated.

Definition at line 287 of file MyHashTable.hpp.

Referenced by tdzdd::MyHashTable< MyHashMapEntry< K, V >, MyHashMapHashWrapper< K, V, Hash, Equal >, MyHashMapHashWrapper< K, V, Hash, Equal > >::moveAssign().

◆ get()

template<typename T, typename Hash = MyHashDefault<T>, typename Equal = MyHashDefault<T>>
Entry* tdzdd::MyHashTable< T, Hash, Equal >::get ( Entry const &  elem) const
inline

Get the element that is already registered.

Parameters
elemthe element to be searched.
Returns
pointer to the element in the table or null.

Definition at line 367 of file MyHashTable.hpp.

◆ initialize()

template<typename T, typename Hash = MyHashDefault<T>, typename Equal = MyHashDefault<T>>
void tdzdd::MyHashTable< T, Hash, Equal >::initialize ( size_t  n)
inline

Initialize the table to be empty.

Parameters
ninitial table size.

Definition at line 301 of file MyHashTable.hpp.

Referenced by tdzdd::DdBuilderMP< S >::construct(), and tdzdd::ZddSubsetterMP< S >::subset().

◆ moveAssign()

template<typename T, typename Hash = MyHashDefault<T>, typename Equal = MyHashDefault<T>>
void tdzdd::MyHashTable< T, Hash, Equal >::moveAssign ( MyHashTable< T, Hash, Equal > &  o)
inline

Move constructor.

Parameters
oobject to be moved.
nlower bound of initial table size. Move constructor.
oobject to be moved.

Definition at line 247 of file MyHashTable.hpp.

◆ rehash()

template<typename T, typename Hash = MyHashDefault<T>, typename Equal = MyHashDefault<T>>
void tdzdd::MyHashTable< T, Hash, Equal >::rehash ( size_t  n = 1)
inline

Resize the storage appropriately.

Parameters
nhint for the new table size.

Definition at line 323 of file MyHashTable.hpp.


The documentation for this class was generated from the following file: