A hashtable for fast exact name lookup. More...
#include <daemon/table/name-tree-hashtable.hpp>
Public Types | |
using | Options = HashtableOptions |
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 150 of file name-tree-hashtable.hpp.
Definition at line 153 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 181 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 190 of file name-tree-hashtable.hpp.
|
inline |
Definition at line 173 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 165 of file name-tree-hashtable.hpp.