39 class sc_phash_base_iter;
40 template<
class K,
class C>
73 sc_phash_elem*
add_direct(
void* key,
void* contents,
unsigned hash_val);
74 sc_phash_elem*
find_entry_c(
unsigned hv,
const void* k, sc_phash_elem*** plast);
75 sc_phash_elem*
find_entry_q(
unsigned hv,
const void* k, sc_phash_elem*** plast);
76 sc_phash_elem*
find_entry(
unsigned hv,
const void* k, sc_phash_elem*** plast=0)
const
103 void erase(
void (*kfree)(
void*));
107 int insert(
void* k,
void* c );
109 int insert(
void* k,
void* c,
void* (*kdup)(
const void*) );
113 int remove(
const void* k);
114 int remove(
const void* k,
void** pk,
void** pc);
115 int remove(
const void* k, void (*kfree)(
void*));
119 int remove_by_contents(
bool (*predicate)(
const void*,
void*),
void* arg,
void (*kfree)(
void*));
120 int lookup(
const void* k,
void** pc)
const;
149 void remove(void (*kfree)(
void*));
155 template<
class K,
class C >
158 template<
class K,
class C >
172 :
sc_phash_base((void*) def, size, density, grow, reorder, hash_fn, cmpr_fn) { }
195 int remove(K k, K* pk, C* pc)
199 int remove(K k, void (*kfree)(
void*))
234 template<
class K,
class C >
235 class sc_phash_iter :
public sc_phash_base_iter {
256 template<
class K,
class C >
261 void* (*kdup)(
const void*);
262 void (*kfree)(
void*);
273 void* (*kdup_fn)(
const void*) = 0,
274 void (*kfree_fn)(
void*) = 0 )
275 :
sc_phash_base((void*) def, size, density, grow, reorder, hash_fn, cmpr_fn)
300 int remove(K k, K* pk, C* pc)
326 template<
class K,
class C >
327 class sc_pdhash_iter :
public sc_phash_base_iter {
366 :
sc_phash_base((void*) def, size, density, grow, reorder, hash_fn, cmpr_fn)
390 int remove(
const char* k,
char** pk, C* pc)
417 class sc_strhash_iter :
public sc_phash_base_iter {
int remove_by_contents(bool(*predicate)(const void *, void *), void *arg, void(*kfree)(void *))
void reset(sc_strhash< C > *t)
const int PHASH_DEFAULT_MAX_DENSITY
int remove_by_contents(bool(*predicate)(const void *, void *), void *arg)
sc_phash_base_iter(sc_phash_base &t)
sc_pdhash_iter(sc_pdhash< K, C > *t)
unsigned default_int_hash_fn(const void *)
void copy(const sc_phash< K, C > &b, void *(*kdup)(const void *), void(*kfree)(void *))
unsigned default_str_hash_fn(const void *)
void * set_contents(void *c)
int insert_if_not_exists(void *k)
int remove(const void *k)
void copy(const sc_strhash< C > &b)
void copy(const sc_phash< K, C > &b)
unsigned(* hash_fn_t)(const void *)
sc_phash(C def=(C) 0, int size=PHASH_DEFAULT_INIT_TABLE_SIZE, int density=PHASH_DEFAULT_MAX_DENSITY, double grow=PHASH_DEFAULT_GROW_FACTOR, bool reorder=PHASH_DEFAULT_REORDER_FLAG, hash_fn_t hash_fn=default_ptr_hash_fn, cmpr_fn_t cmpr_fn=0)
sc_phash_elem * find_entry_c(unsigned hv, const void *k, sc_phash_elem ***plast)
void set_cmpr_fn(cmpr_fn_t)
void reset(sc_phash< K, C > &t)
void reset(sc_pdhash< K, C > *t)
sc_phash_iter(sc_phash< K, C > &t)
const int PHASH_DEFAULT_INIT_TABLE_SIZE
sc_strhash(C def=(C) 0, int size=PHASH_DEFAULT_INIT_TABLE_SIZE, int density=PHASH_DEFAULT_MAX_DENSITY, double grow=PHASH_DEFAULT_GROW_FACTOR, bool reorder=PHASH_DEFAULT_REORDER_FLAG, unsigned(*hash_fn)(const void *)=default_str_hash_fn, int(*cmpr_fn)(const void *, const void *)=sc_strhash_cmp)
void reset(sc_phash< K, C > *t)
void sc_strhash_kfree(void *)
int insert_if_not_exists(K k, C c)
sc_phash_elem * find_entry(unsigned hv, const void *k, sc_phash_elem ***plast=0) const
uint64 const sc_uint_base int b
void copy(const sc_phash_base *)
void copy(const sc_phash< K, C > *b)
unsigned do_hash(const void *key) const
bool contains(const void *k) const
void reset(sc_pdhash< K, C > &t)
int insert_if_not_exists(void *k, void *c)
int remove_by_contents(bool(*predicate)(const void *, void *), void *arg)
void reset(sc_strhash< C > &t)
bool contains(const char *k) const
sc_phash_elem * add_direct(void *key, void *contents, unsigned hash_val)
void copy(const sc_pdhash< K, C > &b)
sc_phash_iter< K, C > iterator
void set_hash_fn(hash_fn_t)
sc_phash_base(void *def=0, int size=PHASH_DEFAULT_INIT_TABLE_SIZE, int density=PHASH_DEFAULT_MAX_DENSITY, double grow=PHASH_DEFAULT_GROW_FACTOR, bool reorder=PHASH_DEFAULT_REORDER_FLAG, hash_fn_t hash_fn=default_ptr_hash_fn, cmpr_fn_t cmpr_fn=0)
int(* cmpr_fn_t)(const void *, const void *)
sc_strhash_iter(sc_strhash< C > *t)
int lookup(const void *k, void **pc) const
sc_phash_iter(sc_phash< K, C > *t)
const bool PHASH_DEFAULT_REORDER_FLAG
int insert(K k, C c, void *(*kdup)(const void *))
int insert_if_not_exists(K k)
int insert_if_not_exists(K k)
sc_strhash_iter(sc_strhash< C > &t)
void copy(const sc_phash_base &b)
void * operator[](const void *key) const
int remove_by_contents(const void *c)
int remove_by_contents(const void *c, void(*kfree)(void *))
void * sc_strhash_kdup(const void *)
int lookup(K k, C *pc) const
sc_phash_elem * find_entry_q(unsigned hv, const void *k, sc_phash_elem ***plast)
int insert(void *k, void *c)
void reset(sc_phash_base *t)
int insert_if_not_exists(K k, C c, void *(*kdup)(const void *))
void reset(sc_phash_base &t)
void copy(const sc_strhash< C > *b)
sc_pdhash(C def=(C) 0, int size=PHASH_DEFAULT_INIT_TABLE_SIZE, int density=PHASH_DEFAULT_MAX_DENSITY, double grow=PHASH_DEFAULT_GROW_FACTOR, bool reorder=PHASH_DEFAULT_REORDER_FLAG, hash_fn_t hash_fn=(hash_fn_t) 0, cmpr_fn_t cmpr_fn=(cmpr_fn_t) 0, void *(*kdup_fn)(const void *)=0, void(*kfree_fn)(void *)=0)
int sc_strhash_cmp(const void *, const void *)
int remove_by_contents(C c)
int remove_by_contents(bool(*predicate)(const void *, void *), void *arg)
sc_pdhash_iter(sc_pdhash< K, C > &t)
int lookup(K k, C *pc) const
const double PHASH_DEFAULT_GROW_FACTOR
C operator[](const char *k) const
sc_phash_base_iter(sc_phash_base *t)
int remove_by_contents(C c)
int insert_if_not_exists(K k, C c)
int insert_if_not_exists(char *k, C c)
int lookup(const char *k, C *pc) const
int remove_by_contents(C c)
sc_strhash_iter< C > iterator
unsigned default_ptr_hash_fn(const void *)
sc_pdhash_iter< K, C > iterator
int insert_if_not_exists(char *k)