History log of /haiku/headers/private/kernel/util/OpenHashTable.h
Revision Date Author Comments
# d1aa4a42 29-Apr-2023 PulkoMandy <pulkomandy@pulkomandy.tk>

Fix typo

Change-Id: I38b5496f8f1afac24e41f3408b10371e932a47f5


# 58852727 12-Feb-2019 Augustin Cavalier <waddlesplash@gmail.com>

BOpenHashTable: We need std::nothrow, so don't depend on others to include it.

Change-Id: Ibe21cef215a730f88eeea499c305a54ce397aeba
Reviewed-on: https://review.haiku-os.org/c/1039
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>


# f9a8f3e7 05-Jul-2015 Michael Lotz <mmlr@mlotz.ch>

Clean up various whitespace and fix one header guard.


# 9d053f59 13-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

BOpenHashTable: document some subtleties

Mainly the interaction of resizing the table with iterators.


# 955d5259 09-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

Rewrite sample HashTable description to use the typedefs

This makes the code more readable (as KeyType and ValueType are clearer
than int and Foo) and easier to copypaste and edit.


# 94089b90 19-Apr-2014 Oliver Tappe <zooey@hirschkaefer.de>

Revert 6f68e52 and fix the gcc2 build via template.

* Instead of forcing the hash-table to use a copy of the key,
introduce and use TypeOperation template to avoid taking a
reference of a reference type (which gcc2 doesn't allow).


# 1eda8517 27-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BOpenHashTable: Add IsEmpty()


# 274ca38f 18-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BOpenHashTable::Clear(): Set fItemCount to 0

If not empty, the count would afterwards be out of sync with reality.


# 7fa36995 18-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BOpenHashTable::Clear(): Set fItemCount to 0

If not empty, the count would afterwards be out of sync with reality.


# 4535495d 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b20de45e 24-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added optional allocator template parameter.
* Added optional parameter "void** oldTable" to Resize(). If given the old
allocation for the table is returned instead of freeing it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5f679d1c 21-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Resize(): Added boolean "force" parameter that allows to force setting the
new memory, even if it isn't needed at that time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35231 a95241bf-73f2-0310-859d-f6bbb57e9c96


# db28a227 09-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added GetIterator() version that takes a key and returns an iterator to the
respective element (if in the table).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34977 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5147963d 26-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

headers/private/kernel/util/OpenHashTable.h, Hugo's version, is a bit nicer than
Tracker's OpenHashTable.h which it should eventually replace. We've renamed the
class to BOpenHashTable and changed the interface slightly so that HashTableLink
became superfluous.
Adapted all the code that used it. Since the OpenHashTables no longer clash,
this should fix the GCC4 build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31791 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 57e7daa5 25-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing include.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30404 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2d4fb82c 07-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added TableSize(), CountElements(), and Clear() methods.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29428 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 595d8a3b 27-Feb-2009 François Revol <revol@free.fr>

Fix for gcc4 build. Thx Monni.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29340 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 42ef5213 27-Feb-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Made usable from userland.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29335 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fc06a3f8 21-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added methods that allow asynchronous resizing of the hash table.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27121 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9445c739 21-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed spelling typo.
* Switched from new[]/delete[] to malloc()/free().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27119 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 30e5affa 09-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Added comment about a missing Remove() variant.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26367 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 276aa463 24-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Replaced the useless InitCheck() method in {Open,Multi}HashTable (it
always returned B_OK) by a Init() method, which sets the initial size
and returns an error, if that fails.
* Adjusted code using the classes accordingly. Replaced a few
InitCheck() methods in the network code by Init().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26127 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84052230 31-Jul-2007 Axel Dörfler <axeld@pinc-software.de>

axeld+bonefish: Got rid of the ParentType in the HashTableDefinition; it doesn't really
belong there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21766 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f6cfc5af 02-May-2007 Hugo Santos <hugosantos@nowhere.fake>

set ValueIterator's fIndex to the next slot so OpenHashTable's Iterator properly gets it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20974 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8465a069 30-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

added a ValueIterator to MultiHashTable to present a limited view in result of Lookup()s.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20946 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0e30c21c 29-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

ipv4: changed the multicast filter to use an hash table to keep source states.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20920 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 505e9853 27-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

introduced MultiHashTable, similiar to multimap, but with hash table semantics.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20864 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 01a10fc5 27-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

fixed OpenHashTable::Iterator, it wasn't working for a single item.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20862 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ac2dba3 27-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

added iterator to OpenHashTable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20853 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 81bc5709 26-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

assorted slab fixes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20833 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 77e70865 25-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

moved the storage requirements (i.e. ParentType *) to OpenHashTable's Definition which we now instantiate per OpenHashTable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20824 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2586c25e 25-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

use Chaining in OpenHashTable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20822 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 53f23f85 25-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

partially rewrote TCP's endpoint manager. Fixes #1173


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20814 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 85dbe747 24-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

open addressing self-extending hash table implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20791 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f9a8f3e72773095d5d7b2f2e1ff3eb3e58122f14 05-Jul-2015 Michael Lotz <mmlr@mlotz.ch>

Clean up various whitespace and fix one header guard.


# 9d053f5975230e98e3a570697381a27ca6d51094 13-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

BOpenHashTable: document some subtleties

Mainly the interaction of resizing the table with iterators.


# 955d5259d0d83f8ffbf221dcea3cea5e6764199b 09-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

Rewrite sample HashTable description to use the typedefs

This makes the code more readable (as KeyType and ValueType are clearer
than int and Foo) and easier to copypaste and edit.


# 94089b909d29108f22f7f59f0be038cf9fa5d51e 19-Apr-2014 Oliver Tappe <zooey@hirschkaefer.de>

Revert 6f68e52 and fix the gcc2 build via template.

* Instead of forcing the hash-table to use a copy of the key,
introduce and use TypeOperation template to avoid taking a
reference of a reference type (which gcc2 doesn't allow).


# 1eda8517f126fed1af44d199a9c06d6f4584ac8d 27-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BOpenHashTable: Add IsEmpty()


# 274ca38fd1de0bd5e41999d5c1d665aeea62b034 18-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BOpenHashTable::Clear(): Set fItemCount to 0

If not empty, the count would afterwards be out of sync with reality.


# 7fa369956e1b30f61679ae5552b5f018a9e76578 18-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BOpenHashTable::Clear(): Set fItemCount to 0

If not empty, the count would afterwards be out of sync with reality.


# 4535495d80c86e19e2610e7444a4fcefe3e0f8e6 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b20de45ebd183ba67160b79bfa83f7e207d83685 24-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added optional allocator template parameter.
* Added optional parameter "void** oldTable" to Resize(). If given the old
allocation for the table is returned instead of freeing it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5f679d1cd3eae30470744608fd91d8943dd2ad8b 21-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Resize(): Added boolean "force" parameter that allows to force setting the
new memory, even if it isn't needed at that time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35231 a95241bf-73f2-0310-859d-f6bbb57e9c96


# db28a227c41f7f1a91b2f118684be2a39b40074c 09-Jan-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added GetIterator() version that takes a key and returns an iterator to the
respective element (if in the table).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34977 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5147963dcd57fefa4f63c484eb88e9eaf4002976 26-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

headers/private/kernel/util/OpenHashTable.h, Hugo's version, is a bit nicer than
Tracker's OpenHashTable.h which it should eventually replace. We've renamed the
class to BOpenHashTable and changed the interface slightly so that HashTableLink
became superfluous.
Adapted all the code that used it. Since the OpenHashTables no longer clash,
this should fix the GCC4 build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31791 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 57e7daa5a48e55024b476cf29ac32fee8789e7de 25-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing include.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30404 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2d4fb82c0faf1bbe8c7a163227be83f347bb605f 07-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added TableSize(), CountElements(), and Clear() methods.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29428 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 595d8a3b9ca86e22667038501a32ec895e2f8e0f 27-Feb-2009 François Revol <revol@free.fr>

Fix for gcc4 build. Thx Monni.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29340 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 42ef52132a1ac49ea1d370c92eb133cbd2d16382 27-Feb-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Made usable from userland.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29335 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fc06a3f822d77a81d236a461d5d9e1180e8a01c1 21-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added methods that allow asynchronous resizing of the hash table.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27121 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9445c73970cd087b03ba3887f37a462d32c02e63 21-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed spelling typo.
* Switched from new[]/delete[] to malloc()/free().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27119 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 30e5affa9f8a92fdca36674d69157dbca7f9d4e2 09-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Added comment about a missing Remove() variant.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26367 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 276aa463efb0cc5b6562c46b540c01df679f77ba 24-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Replaced the useless InitCheck() method in {Open,Multi}HashTable (it
always returned B_OK) by a Init() method, which sets the initial size
and returns an error, if that fails.
* Adjusted code using the classes accordingly. Replaced a few
InitCheck() methods in the network code by Init().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26127 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84052230379abf8e556e20e499d9a6040157f4a6 31-Jul-2007 Axel Dörfler <axeld@pinc-software.de>

axeld+bonefish: Got rid of the ParentType in the HashTableDefinition; it doesn't really
belong there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21766 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f6cfc5af194a8f078022f793a00712d925d44984 02-May-2007 Hugo Santos <hugosantos@nowhere.fake>

set ValueIterator's fIndex to the next slot so OpenHashTable's Iterator properly gets it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20974 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8465a069104e40de35a4a56225b26ca5ba5c74f9 30-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

added a ValueIterator to MultiHashTable to present a limited view in result of Lookup()s.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20946 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0e30c21c70428fc9536b49c257aea9e846c108fd 29-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

ipv4: changed the multicast filter to use an hash table to keep source states.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20920 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 505e98538a07903c0b1587035b7ef42e95a3501e 27-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

introduced MultiHashTable, similiar to multimap, but with hash table semantics.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20864 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 01a10fc52714baa2d2385d92227906e97802b3b9 27-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

fixed OpenHashTable::Iterator, it wasn't working for a single item.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20862 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ac2dba3312a878c97138c3b814ecf2b3528a933 27-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

added iterator to OpenHashTable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20853 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 81bc5709221d7cfd6696e1422b388fd01e5cbff6 26-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

assorted slab fixes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20833 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 77e70865e17399a31813cca47bcaca80f271b341 25-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

moved the storage requirements (i.e. ParentType *) to OpenHashTable's Definition which we now instantiate per OpenHashTable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20824 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2586c25e318e1f71ff45889b9b0d047ce03043d1 25-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

use Chaining in OpenHashTable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20822 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 53f23f85a2725c8fc31c7a874256084c7c623d86 25-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

partially rewrote TCP's endpoint manager. Fixes #1173


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20814 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 85dbe747c488168be4c3f9ac541cf0b77532daa6 24-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

open addressing self-extending hash table implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20791 a95241bf-73f2-0310-859d-f6bbb57e9c96