]> www.ginac.de Git - cln.git/blob - src/integer/hash/cl_I_hash_gcpointer.h
e97cb3a3201ef7d811c9a7e604b0a8f4aaec22e4
[cln.git] / src / integer / hash / cl_I_hash_gcpointer.h
1 // cl_I hash tables
2
3 #ifndef _CL_I_HASH_GCPOINTER_H
4 #define _CL_I_HASH_GCPOINTER_H
5
6 #include "cl_number.h"
7 #include "cl_integer.h"
8
9 // For the sake of gcc-2.7.x, this declaration must come before cl_hash1.h.
10 extern unsigned long hashcode (const cl_I& x);
11
12 #include "cl_hash1.h"
13
14 // Equality.
15 static inline bool equal (const cl_I& x, const cl_I& y)
16 { return (bool)cl_equal(x,y); }
17
18 typedef cl_htentry1<cl_I,cl_gcpointer> cl_htentry_from_integer_to_gcpointer;
19
20 typedef cl_heap_hashtable_1<cl_I,cl_gcpointer> cl_heap_hashtable_from_integer_to_gcpointer;
21
22 typedef _cl_hashtable_iterator<cl_htentry_from_integer_to_gcpointer> cl_hashtable_from_integer_to_gcpointer_iterator;
23
24 struct cl_ht_from_integer_to_gcpointer : public cl_gcpointer {
25         // Constructors.
26         cl_ht_from_integer_to_gcpointer ();
27         cl_ht_from_integer_to_gcpointer (const cl_ht_from_integer_to_gcpointer&);
28         // Assignment operators.
29         cl_ht_from_integer_to_gcpointer& operator= (const cl_ht_from_integer_to_gcpointer&);
30         // Iterator.
31         cl_hashtable_from_integer_to_gcpointer_iterator iterator () const
32         { return ((cl_heap_hashtable_from_integer_to_gcpointer*)pointer)->iterator(); }
33         // Lookup.
34         cl_gcpointer * get (const cl_I& x) const;
35         // Store.
36         void put (const cl_I& x, const cl_gcpointer& y) const;
37 };
38
39 #endif /* _CL_I_HASH_GCPOINTER_H */