39#include "SingleList.h"
44typedef void (*HashTableNode_terminate)(
struct HashTableNode*,
void* tmobj);
46typedef struct HashTableNode
49 HashTableNode(
const char* name, HashTableNode_terminate terminate);
52 HashTableNode_terminate destructor;
59BA_API
void HashTableNode_constructor(HashTableNode* o,
61 HashTableNode_terminate destructor);
62#define HashTableNode_terminate(o, tmObj) (*o->destructor)(o, tmObj)
65inline HashTableNode::HashTableNode(
const char* name,
66 HashTableNode_terminate destructor) {
67 HashTableNode_constructor(
this,name,destructor);
71typedef int (*HashTable_CbFunc)(
void* cbObj,
struct HashTableNode*);
73typedef struct HashTable
78 void add(HashTableNode* node);
79 HashTableNode* lookup(
const char* ident);
80 void setTmObj(
void* obj);
90BA_API HashTable* HashTable_create(
U32 noOfHashElements,
AllocatorIntf* alloc);
91BA_API
void HashTable_destructor(HashTable* o);
92BA_API
void HashTable_add(HashTable* o, HashTableNode* node);
93#define HashTable_setTmObj(o, tmObjMA) (o)->tmObj=tmObjMA
94BA_API HashTableNode* HashTable_lookup(HashTable* o,
const char* ident);
95BA_API
int HashTable_iter(HashTable* o,
void* cbObj, HashTable_CbFunc cbFunc);
98inline HashTable* HashTable::create(
U32 noOfHashElements,
AllocatorIntf* alloc)
100 return HashTable_create(noOfHashElements, alloc);
102inline HashTable::~HashTable() {
103 HashTable_destructor(
this);
105inline void HashTable::add(HashTableNode* node) {
106 HashTable_add(
this, node);
108inline HashTableNode* HashTable::lookup(
const char* ident) {
109 return HashTable_lookup(
this, ident);
112inline void HashTable::setTmObj(
void* obj) {
113 HashTable_setTmObj(
this, obj);
uint32_t U32
Unsigned 32-bit integer.
Definition: GenPrimT.h:93
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:98