5 Hashtable::Hashtable() {
6 forward=genallocatehashtable((unsigned int (*)(void *)) & hashelement,(int (*)(void *,void *)) & elementequals);
10 void Hashtable::setparent(Hashtable *parent) {
14 Hashtable::Hashtable(unsigned int (*hash_function)(void *),int (*comp_function)(void *, void *)) {
15 forward=genallocatehashtable(hash_function,comp_function);
19 void Hashtable::put(void *key, void*object) {
22 genputtable(forward,key,object);
25 void Hashtable::remove(void *key) {
26 genfreekey(forward,key);
29 void* Hashtable::get(void *key) {
30 if (!gencontains(forward,key)) {
32 return parent->get(key);
36 return gengettable(forward,key);
39 bool Hashtable::contains(void *key) {
40 if (!gencontains(forward,key)) {
44 return parent->contains(key);
49 Hashtable::~Hashtable() {
50 genfreehashtable(forward);