|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
38 template<
class KeyType,
class ItemType>
class AbaHash;
40 template <
class KeyType,
class ItemType>
42 template <
class KeyType,
class ItemType>
45 template <
class KeyType,
class ItemType>
48 template <
class KeyType,
class ItemType>
56 template <
class KeyType,
class ItemType>
67 AbaHashItem(
const KeyType &key,
const ItemType &item);
74 friend std::ostream &operator<< <> (std::ostream &,
123 template <
class KeyType,
class ItemType>
151 friend std::ostream &operator<< <> (std::ostream &out,
163 void insert(
const KeyType &newKey,
const ItemType &newItem);
173 void overWrite(
const KeyType &newKey,
const ItemType &newItem);
184 const ItemType *
find(
const KeyType &key)
const;
195 ItemType *
find(
const KeyType &key);
204 bool find(
const KeyType &key,
const ItemType &item)
const;
243 ItemType *
next(
const KeyType &key);
258 const ItemType *
next(
const KeyType &key)
const;
268 int remove(
const KeyType &key);
278 int remove(
const KeyType &key,
const ItemType &item);
301 int hf(
int key)
const;
304 int hf(
unsigned key)
const;
310 int hf(
const string &str)
const;
ItemType * initializeIteration(const KeyType &key)
This function retrieves the first item.
AbaHash(int size)
Initializes each slot with a 0-pointer to indicate that the linked list of hash items of this slot is...
void resize(int newSize)
Can be used to change the size of the hash table.
ItemType * next(const KeyType &key)
This function can be used to go to the next item in the hash table with key key.
std::ostream & operator<<(std::ostream &out, const Active< BaseType, CoType > &rhs)
const ItemType * find(const KeyType &key) const
Looks for an item in the hash table with a given key.
int size_
The length of the hash table.
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
int nCollisions_
The number of collisions on calls of insert() and overWrite().
int remove(const KeyType &key)
Removes the first item with a given key from the hash table.
AbaHash & operator=(const AbaHash &rhs)
Base class of all other classes of ABACUS.
AbaHashItem(const KeyType &key, const ItemType &item)
The constructor.
AbaHashItem< KeyType, ItemType > * iter_
An iterator for all items stored in a slot.
int size() const
Returns the length of the hash table.
AbaHashItem< KeyType, ItemType > * next()
Returns a pointer to the next hash-item stored in the linked list corresponding to the slot of this i...
int nCollisions() const
Returns the number of collisions which occurred during all previous calls of the functions insert() a...
~AbaHash()
The destructor.
void insert(const KeyType &newKey, const ItemType &newItem)
Adds an item to the hash table.
void overWrite(const KeyType &newKey, const ItemType &newItem)
Adds a item to the has table (with overwrite).
AbaHashItem< KeyType, ItemType > ** table_
The hash table storing a linked list of hash items in each slot.
static uint32_t hash(uint32_t x)
int hf(int key) const
Computes the hash value of key.
AbaHashItem< KeyType, ItemType > * next_