LoAdSG
SimpleMultiHash< T, D > Class Template Reference

A simple multihash implementation. Is able to store multiple elements with the same hash. More...

#include <simpleMultiHash.h>

Inheritance diagram for SimpleMultiHash< T, D >:

Public Member Functions

 SimpleMultiHash (D depth_, const unsigned long firstTableSize=100, const unsigned long secondTableInitSize=300)
 Construct a new Simple Multi Hash object.
 
bool addPoint (const T &point)
 Will add the given point to the MultiHash. If the same point already exists it will not be added.
 
void addPoint_Unique (const T &point)
 Will add the given point to the MultiHash. If the point already exists inside the Hashmap the behaviour is undefined!!!! Do NOT use this method if you are not absolutly sure that the given point does not already exist. Use addPoint() instead.
 

Private Member Functions

bool checkIfItemInHashgroup (const unsigned long index, const T &item, unsigned long &outFoundPos) const
 Will try to find the given item in the Hashgroup.
 

Detailed Description

template<typename T, typename D>
class SimpleMultiHash< T, D >

A simple multihash implementation. Is able to store multiple elements with the same hash.

Template Parameters
T

Constructor & Destructor Documentation

◆ SimpleMultiHash()

template<typename T , typename D >
SimpleMultiHash< T, D >::SimpleMultiHash ( depth_,
const unsigned long  firstTableSize = 100,
const unsigned long  secondTableInitSize = 300 
)
inline

Construct a new Simple Multi Hash object.

Parameters
hash
firstTableSizeThe size of the first Table
secondTableInitSizeThe initially reserved space of the second table. May expand if set to low but will not shrink.

Member Function Documentation

◆ addPoint()

template<typename T , typename D >
bool SimpleMultiHash< T, D >::addPoint ( const T &  point)
inline

Will add the given point to the MultiHash. If the same point already exists it will not be added.

Parameters
point
Returns
true
false

◆ addPoint_Unique()

template<typename T , typename D >
void SimpleMultiHash< T, D >::addPoint_Unique ( const T &  point)
inline

Will add the given point to the MultiHash. If the point already exists inside the Hashmap the behaviour is undefined!!!! Do NOT use this method if you are not absolutly sure that the given point does not already exist. Use addPoint() instead.

Parameters
point

◆ checkIfItemInHashgroup()

template<typename T , typename D >
bool SimpleMultiHash< T, D >::checkIfItemInHashgroup ( const unsigned long  index,
const T &  item,
unsigned long &  outFoundPos 
) const
inlineprivate

Will try to find the given item in the Hashgroup.

Parameters
index
item
outFoundPoscontains the position at which the item was found. If the item was not found returns the last position of the Hashgroup
Returns
true
false
Here is the caller graph for this function:

The documentation for this class was generated from the following file: