mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(hash): support deleting objects from hash table
This commit is contained in:
parent
ce1c33d88b
commit
355733263f
2 changed files with 7 additions and 0 deletions
0
storm/hash/TSExportTableSimple.hpp
Normal file
0
storm/hash/TSExportTableSimple.hpp
Normal file
|
|
@ -14,6 +14,7 @@ class TSHashTable {
|
|||
|
||||
// Member functions
|
||||
void Clear();
|
||||
void Delete(T* ptr);
|
||||
T* Head();
|
||||
void Insert(T* ptr, uint32_t hashval, const TKey& key);
|
||||
T* New(const char* str, size_t extrabytes, uint32_t flags);
|
||||
|
|
@ -61,6 +62,12 @@ void TSHashTable<T, TKey>::Clear() {
|
|||
this->InternalClear(0);
|
||||
}
|
||||
|
||||
template <class T, class TKey>
|
||||
void TSHashTable<T, TKey>::Delete(T* ptr) {
|
||||
this->Unlink(ptr);
|
||||
this->InternalDelete(ptr);
|
||||
}
|
||||
|
||||
template <class T, class TKey>
|
||||
void TSHashTable<T, TKey>::Destroy() {
|
||||
this->InternalClear(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue