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

#include <rel_hashmap.hpp>

Private Member Functions

 CONCRETE_NULL_TEMPLATE_2 (rel_hashmap, T, U)
 
 rel_hashmap (U init)
 
 rel_hashmap (hashmap< T, U > item)
 
 rel_hashmap (hashmap< T, U > item, rel_hashmap< T, U > next)
 
operator[] (T x)
 
U & operator() (T x)
 

Detailed Description

template<class T, class U>
class rel_hashmap< T, U >

Definition at line 20 of file rel_hashmap.hpp.

Constructor & Destructor Documentation

◆ rel_hashmap() [1/3]

template<class T , class U >
rel_hashmap< T, U >::rel_hashmap ( U init)
inlineprivate

Definition at line 49 of file rel_hashmap.hpp.

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

◆ rel_hashmap() [2/3]

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

Definition at line 52 of file rel_hashmap.hpp.

◆ rel_hashmap() [3/3]

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

Definition at line 54 of file rel_hashmap.hpp.

56 : rep (tm_new<rel_hashmap_rep<T, U>> (item, next)) {}

Member Function Documentation

◆ CONCRETE_NULL_TEMPLATE_2()

template<class T , class U >
rel_hashmap< T, U >::CONCRETE_NULL_TEMPLATE_2 ( rel_hashmap< T, U > ,
T ,
U  )
private

◆ operator[]()

template<class T , class U >
U rel_hashmap< T, U >::operator[] ( T x)
private

Definition at line 23 of file rel_hashmap.ipp.

23 {
24 ASSERT (rep != NULL, "invalid relative hashmap");
25 if (rep->item->contains (x) || is_nil (rep->next)) return rep->item[x];
26 return rep->next[x];
27}
#define ASSERT(cond, msg)
Macro used to assert that a condition is true, and throw an exception with an error message if the co...
Definition basic.hpp:85
bool is_nil(rel_hashmap< T, U > h)

◆ operator()()

template<class T , class U >
U & rel_hashmap< T, U >::operator() ( T x)
private

Definition at line 31 of file rel_hashmap.ipp.

31 {
32 ASSERT (rep != NULL, "invalid relative hashmap");
33 if (rep->item->contains (x)) return rep->item (x);
34 if ((!is_nil (rep->next)) && rep->next->contains (x))
35 rep->item (x)= copy (rep->next[x]);
36 return rep->item (x);
37}
int copy(int x)
Returns a copy of an integer.
Definition basic.hpp:249

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