a hashtable for fast exact name lookup More...
#include <daemon/table/name-tree-hashtable.hpp>
Public Types | |
typedef HashtableOptions | Options |
Public Member Functions | |
Hashtable (const Options &options) | |
~Hashtable () | |
deallocates all nodes More... | |
size_t | computeBucketIndex (HashValue h) const |
void | erase (Node *node) |
delete node More... | |
const Node * | find (const Name &name, size_t prefixLen) const |
find node for name.getPrefix(prefixLen) More... | |
const Node * | find (const Name &name, size_t prefixLen, const HashSequence &hashes) const |
find node for name.getPrefix(prefixLen) More... | |
const Node * | getBucket (size_t bucket) const |
size_t | getNBuckets () const |
std::pair< const Node *, bool > | insert (const Name &name, size_t prefixLen, const HashSequence &hashes) |
find or insert node for name.getPrefix(prefixLen) More... | |
size_t | size () const |
a hashtable for fast exact name lookup
The Hashtable contains a number of buckets. Each node is placed into a bucket determined by a hash value computed from its name. Hash collision is resolved through a doubly linked list in each bucket. The number of buckets is adjusted according to how many nodes are stored.
Definition at line 149 of file name-tree-hashtable.hpp.
Definition at line 152 of file name-tree-hashtable.hpp.
|
explicit |
Definition at line 118 of file name-tree-hashtable.cpp.
nfd::name_tree::Hashtable::~Hashtable | ( | ) |
deallocates all nodes
Definition at line 136 of file name-tree-hashtable.cpp.
|
inline |
Definition at line 180 of file name-tree-hashtable.hpp.
void nfd::name_tree::Hashtable::erase | ( | Node * | node | ) |
delete node
Definition at line 231 of file name-tree-hashtable.cpp.
const Node * nfd::name_tree::Hashtable::find | ( | const Name & | name, |
size_t | prefixLen | ||
) | const |
find node for name.getPrefix(prefixLen)
Definition at line 210 of file name-tree-hashtable.cpp.
const Node * nfd::name_tree::Hashtable::find | ( | const Name & | name, |
size_t | prefixLen, | ||
const HashSequence & | hashes | ||
) | const |
find node for name.getPrefix(prefixLen)
Definition at line 217 of file name-tree-hashtable.cpp.
|
inline |
Definition at line 189 of file name-tree-hashtable.hpp.
|
inline |
Definition at line 172 of file name-tree-hashtable.hpp.
std::pair< const Node *, bool > nfd::name_tree::Hashtable::insert | ( | const Name & | name, |
size_t | prefixLen, | ||
const HashSequence & | hashes | ||
) |
find or insert node for name.getPrefix(prefixLen)
Definition at line 224 of file name-tree-hashtable.cpp.
|
inline |
Definition at line 164 of file name-tree-hashtable.hpp.