Lolly 1.4.28
Loading...
Searching...
No Matches
Private Member Functions | Static Private Attributes | List of all members
hashmap< T, U > Class Template Reference

A simple hashmap class implementation. More...

#include <hashmap.hpp>

Inheritance diagram for hashmap< T, U >:
Inheritance graph
[legend]
Collaboration diagram for hashmap< T, U >:
Collaboration graph
[legend]

Private Member Functions

 CONCRETE_TEMPLATE_2 (hashmap, T, U)
 
 hashmap ()
 Default constructor that initializes the hashmap with default parameters.
 
 hashmap (U init, int n=1, int max=1)
 Constructor that allows custom initial value, size, and maximum load factor.
 
operator[] (T x)
 Read-only access operator.
 
U & operator() (T x)
 Read-write access to the value mapped by the key x.
 

Static Private Attributes

static hashmap< T, U > init
 

Detailed Description

template<class T, class U>
class hashmap< T, U >

A simple hashmap class implementation.

Template Parameters
TThe type of the key in the hashmap.
UThe type of the value in the hashmap.

Definition at line 176 of file hashmap.hpp.

Constructor & Destructor Documentation

◆ hashmap() [1/2]

template<class T , class U >
hashmap< T, U >::hashmap ( )
inlineprivate

Default constructor that initializes the hashmap with default parameters.

Definition at line 184 of file hashmap.hpp.

The list class represents a linked list.
Definition list.hpp:48
C * tm_new()
base class of resources
Definition resource.hpp:23
Helper struct for type identification and initialization.
Definition basic.hpp:303

◆ hashmap() [2/2]

template<class T , class U >
hashmap< T, U >::hashmap ( U init,
int n = 1,
int max = 1 )
inlineprivate

Constructor that allows custom initial value, size, and maximum load factor.

Parameters
initThe initial value for the type U.
nThe initial size of the hashmap.
maxThe maximum load factor of the hashmap.

Definition at line 195 of file hashmap.hpp.

196 : rep (tm_new<hashmap_rep<T, U>> (init, n, max)) {}
static hashmap< T, U > init
Definition hashmap.hpp:178
SI max(SI i, SI j)
Returns the maximum of two signed integers.
Definition minmax.hpp:40

Member Function Documentation

◆ CONCRETE_TEMPLATE_2()

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

◆ operator[]()

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

Read-only access operator.

Parameters
xThe key whose value is to be returned.
Returns
The value corresponding to the provided key.

Definition at line 204 of file hashmap.hpp.

204{ return rep->bracket_ro (x); }

◆ operator()()

template<class T , class U >
U & hashmap< T, U >::operator() ( T x)
inlineprivate

Read-write access to the value mapped by the key x.

Parameters
xThe key to look up in the hashmap.
Returns
A reference to the value associated with the key x.

Definition at line 212 of file hashmap.hpp.

212{ return rep->bracket_rw (x); }

Member Data Documentation

◆ init

template<class T , class U >
hashmap<T, U> hashmap< T, U >::init
staticprivate

Definition at line 178 of file hashmap.hpp.


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