Lolly 1.4.27
Loading...
Searching...
No Matches
Private Member Functions | List of all members
hashfunc< T, U > Class Template Reference

A generic hash function class that uses a concrete implementation of a hash function. More...

#include <hashfunc.hpp>

Private Member Functions

 CONCRETE_TEMPLATE_2 (hashfunc, T, U)
 
 hashfunc (U(*func)(T), U init)
 Constructor for hashfunc.
 
operator[] (T x)
 Applies the hash function to the given input.
 

Detailed Description

template<class T, class U>
class hashfunc< T, U >

A generic hash function class that uses a concrete implementation of a hash function.

Template Parameters
TThe input type of the hash function.
UThe output type of the hash function.

Definition at line 44 of file hashfunc.hpp.

Constructor & Destructor Documentation

◆ hashfunc()

template<class T , class U >
hashfunc< T, U >::hashfunc ( U(*)(T) func,
U init )
inlineprivate

Constructor for hashfunc.

Parameters
funcA pointer to the hash function to be used.
initThe initial value for the hash map.

Definition at line 52 of file hashfunc.hpp.

53 : rep (tm_new<hashfunc_rep<T, U>> (func, init)) {}
The list class represents a linked list.
Definition list.hpp:48
C * tm_new()
base class of resources
Definition resource.hpp:23

Member Function Documentation

◆ CONCRETE_TEMPLATE_2()

template<class T , class U >
hashfunc< T, U >::CONCRETE_TEMPLATE_2 ( hashfunc< T, U > ,
T ,
U  )
private

◆ operator[]()

template<class T , class U >
U hashfunc< T, U >::operator[] ( T x)
inlineprivate

Applies the hash function to the given input.

Parameters
xThe input value to be hashed.
Returns
The output of the hash function for the given input.

Definition at line 60 of file hashfunc.hpp.

60{ return rep->apply (x); }

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