|
OpenTTD Source 20260304-master-g1baaa74679
|
Public Types | |
| typedef TItem::Key | Key |
| Make Titem::Key a property of HashTable. | |
Public Member Functions | |
| void | Clear () |
| Clears the slot by simple forgetting its items. | |
| const TItem * | Find (const Key &key) const |
| Linear search for item with given key through the given blob. | |
| TItem * | Find (const Key &key) |
| Linear search for item with given key through the given blob. | |
| void | Attach (TItem &new_item) |
| Add new item to the slot. | |
| bool | Detach (TItem &item_to_remove) |
| Remove item from a slot. | |
| TItem * | Detach (const Key &key) |
| Remove and return item from a slot. | |
Data Fields | |
| TItem * | first_item = nullptr |
Definition at line 14 of file hashtable.hpp.
| typedef TItem::Key HashTableSlot< TItem >::Key |
Make Titem::Key a property of HashTable.
Definition at line 15 of file hashtable.hpp.
|
inline |
Add new item to the slot.
| new_item | The item to insert. |
Definition at line 61 of file hashtable.hpp.
Referenced by HashTable< Titem, Thash_bits_ >::Push().
|
inline |
Clears the slot by simple forgetting its items.
Definition at line 20 of file hashtable.hpp.
|
inline |
Remove and return item from a slot.
| key | The key to search for. |
nullptr when nothing was removed. Definition at line 99 of file hashtable.hpp.
|
inline |
Remove item from a slot.
| item_to_remove | The item to remove. |
true iff the item could be removed. Definition at line 73 of file hashtable.hpp.
Referenced by HashTable< Titem, Thash_bits_ >::TryPop(), and HashTable< Titem, Thash_bits_ >::TryPop().
|
inline |
Linear search for item with given key through the given blob.
| key | The key to find. |
nullptr. Definition at line 46 of file hashtable.hpp.
|
inline |
Linear search for item with given key through the given blob.
| key | The key to find. |
nullptr. Definition at line 30 of file hashtable.hpp.
Referenced by HashTable< Titem, Thash_bits_ >::Find(), HashTable< Titem, Thash_bits_ >::Find(), and HashTable< Titem, Thash_bits_ >::Push().
| TItem* HashTableSlot< TItem >::first_item = nullptr |
Definition at line 17 of file hashtable.hpp.