nfd::name_tree::HashtableOptions Struct Reference

Provides options for Hashtable. More...

#include <daemon/table/name-tree-hashtable.hpp>

+ Collaboration diagram for nfd::name_tree::HashtableOptions:

Public Member Functions

 HashtableOptions (size_t size=16)
 Constructor. More...
 

Public Attributes

float expandFactor = 2.0f
 When the hashtable is expanded, its new size will be nBuckets*expandFactor. More...
 
float expandLoadFactor = 0.5f
 If the hashtable has more than nBuckets*expandLoadFactor nodes, it will be expanded. More...
 
size_t initialSize
 Initial number of buckets. More...
 
size_t minSize
 Minimal number of buckets. More...
 
float shrinkFactor = 0.5f
 When the hashtable is shrunk, its new size will be max(nBuckets*shrinkFactor, minSize). More...
 
float shrinkLoadFactor = 0.1f
 If the hashtable has less than nBuckets*shrinkLoadFactor nodes, it will be shrunk. More...
 

Detailed Description

Provides options for Hashtable.

Definition at line 108 of file name-tree-hashtable.hpp.

Constructor & Destructor Documentation

◆ HashtableOptions()

nfd::name_tree::HashtableOptions::HashtableOptions ( size_t  size = 16)
explicit

Constructor.

Postcondition
initialSize == size
minSize == size

Definition at line 112 of file name-tree-hashtable.cpp.

Member Data Documentation

◆ expandFactor

float nfd::name_tree::HashtableOptions::expandFactor = 2.0f

When the hashtable is expanded, its new size will be nBuckets*expandFactor.

Definition at line 131 of file name-tree-hashtable.hpp.

◆ expandLoadFactor

float nfd::name_tree::HashtableOptions::expandLoadFactor = 0.5f

If the hashtable has more than nBuckets*expandLoadFactor nodes, it will be expanded.

Definition at line 127 of file name-tree-hashtable.hpp.

◆ initialSize

size_t nfd::name_tree::HashtableOptions::initialSize

Initial number of buckets.

Definition at line 119 of file name-tree-hashtable.hpp.

◆ minSize

size_t nfd::name_tree::HashtableOptions::minSize

Minimal number of buckets.

Definition at line 123 of file name-tree-hashtable.hpp.

◆ shrinkFactor

float nfd::name_tree::HashtableOptions::shrinkFactor = 0.5f

When the hashtable is shrunk, its new size will be max(nBuckets*shrinkFactor, minSize).

Definition at line 139 of file name-tree-hashtable.hpp.

◆ shrinkLoadFactor

float nfd::name_tree::HashtableOptions::shrinkLoadFactor = 0.1f

If the hashtable has less than nBuckets*shrinkLoadFactor nodes, it will be shrunk.

Definition at line 135 of file name-tree-hashtable.hpp.