Lolly 1.4.28
Loading...
Searching...
No Matches
rel_hashmap.hpp
Go to the documentation of this file.
1
2/******************************************************************************
3 * MODULE : rel_hashmap.hpp
4 * DESCRIPTION: see rel_hashmap.cpp
5 * COPYRIGHT : (C) 1999 Joris van der Hoeven
6 *******************************************************************************
7 * This software falls under the GNU general public license version 3 or later.
8 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10 ******************************************************************************/
11
12#ifndef REL_HASMAP_H
13#define REL_HASMAP_H
14#include "hashmap.hpp"
15
16template <class T, class U> class rel_hashmap;
17template <class T, class U> class rel_hashmap_rep;
18template <class T, class U> bool is_nil (rel_hashmap<T, U> h);
19
20template <class T, class U> class rel_hashmap {
22 inline rel_hashmap (U init);
23 inline rel_hashmap (hashmap<T, U> item);
25 U operator[] (T x);
26 U& operator() (T x);
27};
28
29template <class T, class U> class rel_hashmap_rep : concrete_struct {
30public:
33
35 : item (item2), next (next2) {}
36 bool contains (T x);
37 void extend ();
38 void shorten ();
39 void merge ();
43
44 friend class rel_hashmap<T, U>;
45};
46
48#define TMPL template <class T, class U>
50 : rep (tm_new<rel_hashmap_rep<T, U>> (hashmap<T, U> (init),
51 rel_hashmap<T, U> ())) {}
57
59#undef TMPL
60
61#include "rel_hashmap.ipp"
62
63#endif // defined REL_HASMAP_H
#define CONCRETE_NULL_TEMPLATE_2_CODE(PTR, TT1, T1, TT2, T2)
Macro for concrete null indirect structure two-template-parameter code definition.
Definition classdef.hpp:435
A simple hashmap class implementation.
Definition hashmap.hpp:176
The list class represents a linked list.
Definition list.hpp:48
void find_changes(hashmap< T, U > &CH)
void change(hashmap< T, U > CH)
void find_differences(hashmap< T, U > &CH)
rel_hashmap< T, U > next
hashmap< T, U > item
bool contains(T x)
U & operator()(T x)
U operator[](T x)
CONCRETE_NULL_TEMPLATE_2(rel_hashmap, T, U)
rel_hashmap(U init)
C * tm_new()
#define H
Definition hashmap.ipp:17
bool is_nil(rel_hashmap< T, U > h)
tm_ostream & operator<<(tm_ostream &out, rel_hashmap< T, U > H)
#define TMPL
Structure representing a concrete object with a reference count.
Definition classdef.hpp:24
base class of resources
Definition resource.hpp:23