]> www.ginac.de Git - cln.git/blob - src/integer/hash/cl_I_hash_rcobject.cc
* All Files have been modified for inclusion of namespace cln;
[cln.git] / src / integer / hash / cl_I_hash_rcobject.cc
1 // class cl_ht_from_integer_to_rcobject.
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_I_hash_rcobject.h"
8
9
10 // Implementation.
11
12 #include "cl_I.h"
13 #include "cl_hash1.h"
14
15 namespace cln {
16
17 static void cl_hashtable_from_integer_to_rcobject_destructor (cl_heap* pointer)
18 {
19 #if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
20         (*(cl_heap_hashtable_from_integer_to_rcobject*)pointer).~cl_heap_hashtable_1();
21 #else
22         (*(cl_heap_hashtable_from_integer_to_rcobject*)pointer).~cl_heap_hashtable_from_integer_to_rcobject();
23 #endif
24 }
25
26 cl_class cl_class_hashtable_from_integer_to_rcobject = {
27         cl_hashtable_from_integer_to_rcobject_destructor,
28         0
29 };
30
31 // These are not inline, because they tend to duplicate a lot of template code.
32
33 cl_ht_from_integer_to_rcobject::cl_ht_from_integer_to_rcobject ()
34 {
35         var cl_heap_hashtable_from_integer_to_rcobject* ht = new cl_heap_hashtable_from_integer_to_rcobject ();
36         ht->refcount = 1;
37         ht->type = &cl_class_hashtable_from_integer_to_rcobject;
38         pointer = ht;
39 }
40
41 cl_rcobject * cl_ht_from_integer_to_rcobject::get (const cl_I& x) const
42 {
43         return ((cl_heap_hashtable_from_integer_to_rcobject*)pointer)->get(x);
44 }
45
46 void cl_ht_from_integer_to_rcobject::put (const cl_I& x, const cl_rcobject& y) const
47 {
48         ((cl_heap_hashtable_from_integer_to_rcobject*)pointer)->put(x,y);
49 }
50
51 }  // namespace cln