]> www.ginac.de Git - cln.git/blob - src/base/hash/cl_rcpointer_hashweak_rcpointer.cc
Fix yet another dependent base C++ language issue.
[cln.git] / src / base / hash / cl_rcpointer_hashweak_rcpointer.cc
1 // class cl_wht_from_rcpointer_to_rcpointer.
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "base/hash/cl_rcpointer_hashweak_rcpointer.h"
8
9
10 // Implementation.
11
12 #include "base/hash/cl_hash1weak.h"
13
14 namespace cln {
15
16 static void cl_weak_hashtable_from_rcpointer_to_rcpointer_destructor (cl_heap* pointer)
17 {
18 #if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
19         (*(cl_heap_weak_hashtable_from_rcpointer_to_rcpointer*)pointer).~cl_heap_weak_hashtable_1();
20 #else
21         (*(cl_heap_weak_hashtable_from_rcpointer_to_rcpointer*)pointer).~cl_heap_weak_hashtable_from_rcpointer_to_rcpointer();
22 #endif
23 }
24
25 cl_class cl_class_weak_hashtable_from_rcpointer_to_rcpointer = {
26         cl_weak_hashtable_from_rcpointer_to_rcpointer_destructor,
27         0
28 };
29
30 // These are not inline, because they tend to duplicate a lot of template code.
31
32 cl_wht_from_rcpointer_to_rcpointer::cl_wht_from_rcpointer_to_rcpointer (bool (*maygc_htentry) (const cl_htentry_from_rcpointer_to_rcpointer&))
33 {
34         var cl_heap_weak_hashtable_from_rcpointer_to_rcpointer* ht = new cl_heap_weak_hashtable_from_rcpointer_to_rcpointer (maygc_htentry);
35         ht->refcount = 1;
36         ht->type = &cl_class_weak_hashtable_from_rcpointer_to_rcpointer;
37         pointer = ht;
38 }
39
40 cl_rcpointer * cl_wht_from_rcpointer_to_rcpointer::get (const cl_rcpointer& x) const
41 {
42         return ((cl_heap_weak_hashtable_from_rcpointer_to_rcpointer*)pointer)->get(x);
43 }
44
45 void cl_wht_from_rcpointer_to_rcpointer::put (const cl_rcpointer& x, const cl_rcpointer& y) const
46 {
47         ((cl_heap_weak_hashtable_from_rcpointer_to_rcpointer*)pointer)->put(x,y);
48 }
49
50 }  // namespace cln