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 and comes WITHOUT
8
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
11
******************************************************************************/
15
#include "hashmap.hpp"
17
template<class T, class U> class rel_hashmap;
18
template<class T, class U> class rel_hashmap_rep;
19
template<class T, class U> bool nil (rel_hashmap<T,U> h);
21
template<class T, class U> class rel_hashmap {
22
CONCRETE_NULL_TEMPLATE_2(rel_hashmap,T,U);
23
inline rel_hashmap (U init);
24
inline rel_hashmap (hashmap<T,U> item);
25
inline rel_hashmap (hashmap<T,U> item, rel_hashmap<T,U> next);
30
template<class T, class U> class rel_hashmap_rep: concrete_struct {
33
rel_hashmap<T,U> next;
35
inline rel_hashmap_rep<T,U> (hashmap<T,U> item2, rel_hashmap<T,U> next2):
36
item(item2), next(next2) {}
41
void find_changes (hashmap<T,U>& CH);
42
void find_differences (hashmap<T,U>& CH);
43
void change (hashmap<T,U> CH);
45
friend class rel_hashmap<T,U>;
48
CONCRETE_NULL_TEMPLATE_2_CODE(rel_hashmap,class,T,class,U);
49
#define TMPL template<class T, class U>
50
TMPL inline rel_hashmap<T,U>::rel_hashmap (U init):
51
rep (new rel_hashmap_rep<T,U> (hashmap<T,U> (init), rel_hashmap<T,U> ())) {}
52
TMPL inline rel_hashmap<T,U>::rel_hashmap (hashmap<T,U> item):
53
rep (new rel_hashmap_rep<T,U> (item, rel_hashmap<T,U> ())) {}
54
TMPL inline rel_hashmap<T,U>::rel_hashmap
55
(hashmap<T,U> item, rel_hashmap<T,U> next):
56
rep (new rel_hashmap_rep<T,U> (item, next)) {}
58
TMPL ostream& operator << (ostream& out, rel_hashmap<T,U> H);
61
#include "rel_hashmap.cpp"
63
#endif // defined REL_HASMAP_H