sc_core::sc_strhash< C > Class Template Reference

#include <sysc/utils/sc_hash.h>

Inheritance diagram for sc_core::sc_strhash< C >:

Inheritance graph
[legend]
Collaboration diagram for sc_core::sc_strhash< C >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef sc_strhash_iter< C > iterator
typedef unsigned(* hash_fn_t )(const void *)
typedef int(* cmpr_fn_t )(const void *, const void *)

Public Member Functions

 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)
 ~sc_strhash ()
void erase ()
void copy (const sc_strhash< C > *b)
void copy (const sc_strhash< C > &b)
int insert (char *k, C c)
int insert (char *k)
int insert_if_not_exists (char *k, C c)
int insert_if_not_exists (char *k)
int remove (const char *k)
int remove (const char *k, char **pk, C *pc)
int remove_by_contents (C c)
int remove_by_contents (bool(*predicate)(const void *, void *), void *arg)
int lookup (const char *k, C *pc) const
bool contains (const char *k) const
operator[] (const char *k) const
void set_cmpr_fn (cmpr_fn_t)
void set_hash_fn (hash_fn_t)
bool empty () const
unsigned count () const
void erase (void(*kfree)(void *))
void copy (const sc_phash_base *)
void copy (const sc_phash_base &b)
void copy (const sc_phash_base &b, void *(*kdup)(const void *), void(*kfree)(void *))
int insert (void *k, void *c)
int insert (void *k)
int insert (void *k, void *c, void *(*kdup)(const void *))
int insert_if_not_exists (void *k, void *c)
int insert_if_not_exists (void *k)
int insert_if_not_exists (void *k, void *c, void *(*kdup)(const void *))
int remove (const void *k)
int remove (const void *k, void **pk, void **pc)
int remove (const void *k, void(*kfree)(void *))
int remove_by_contents (const void *c)
int remove_by_contents (const void *c, void(*kfree)(void *))
int remove_by_contents (bool(*predicate)(const void *, void *), void *arg, void(*kfree)(void *))
int lookup (const void *k, void **pc) const
bool contains (const void *k) const
void * operator[] (const void *key) const

Protected Member Functions

void rehash ()
unsigned do_hash (const void *key) const
sc_phash_elemadd_direct (void *key, void *contents, unsigned hash_val)
sc_phash_elemfind_entry_c (unsigned hv, const void *k, sc_phash_elem ***plast)
sc_phash_elemfind_entry_q (unsigned hv, const void *k, sc_phash_elem ***plast)
sc_phash_elemfind_entry (unsigned hv, const void *k, sc_phash_elem ***plast=0) const

Protected Attributes

void * default_value
int num_bins
int num_entries
int max_density
int reorder_flag
double grow_factor
sc_phash_elem ** bins
hash_fn_t hash
cmpr_fn_t cmpr

Friends

class sc_strhash_iter< C >


Detailed Description

template<class C>
class sc_core::sc_strhash< C >

Definition at line 367 of file sc_hash.h.


Member Typedef Documentation

template<class C>
typedef sc_strhash_iter<C> sc_core::sc_strhash< C >::iterator

Reimplemented from sc_core::sc_phash_base.

Definition at line 371 of file sc_hash.h.

typedef unsigned(* sc_core::sc_phash_base::hash_fn_t)(const void *) [inherited]

typedef int(* sc_core::sc_phash_base::cmpr_fn_t)(const void *, const void *) [inherited]


Constructor & Destructor Documentation

template<class C>
sc_core::sc_strhash< C >::sc_strhash ( 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(*)(const void *)  hash_fn = default_str_hash_fn,
int(*)(const void *, const void *)  cmpr_fn = sc_strhash_cmp 
) [inline]

Definition at line 373 of file sc_hash.h.

template<class C>
sc_core::sc_strhash< C >::~sc_strhash (  )  [inline]

Definition at line 384 of file sc_hash.h.


Member Function Documentation

template<class C>
void sc_core::sc_strhash< C >::erase (  )  [inline]

Reimplemented from sc_core::sc_phash_base.

Definition at line 389 of file sc_hash.h.

template<class C>
void sc_core::sc_strhash< C >::copy ( const sc_strhash< C > *  b  )  [inline]

Definition at line 390 of file sc_hash.h.

template<class C>
void sc_core::sc_strhash< C >::copy ( const sc_strhash< C > &  b  )  [inline]

Definition at line 391 of file sc_hash.h.

template<class C>
int sc_core::sc_strhash< C >::insert ( char *  k,
c 
) [inline]

Definition at line 393 of file sc_hash.h.

template<class C>
int sc_core::sc_strhash< C >::insert ( char *  k  )  [inline]

Definition at line 394 of file sc_hash.h.

template<class C>
int sc_core::sc_strhash< C >::insert_if_not_exists ( char *  k,
c 
) [inline]

Definition at line 395 of file sc_hash.h.

template<class C>
int sc_core::sc_strhash< C >::insert_if_not_exists ( char *  k  )  [inline]

Definition at line 399 of file sc_hash.h.

template<class C>
int sc_core::sc_strhash< C >::remove ( const char *  k  )  [inline]

Definition at line 403 of file sc_hash.h.

template<class C>
int sc_core::sc_strhash< C >::remove ( const char *  k,
char **  pk,
C *  pc 
) [inline]

Definition at line 404 of file sc_hash.h.

template<class C>
int sc_core::sc_strhash< C >::remove_by_contents ( c  )  [inline]

Definition at line 408 of file sc_hash.h.

template<class C>
int sc_core::sc_strhash< C >::remove_by_contents ( bool(*)(const void *, void *)  predicate,
void *  arg 
) [inline]

Reimplemented from sc_core::sc_phash_base.

Definition at line 412 of file sc_hash.h.

template<class C>
int sc_core::sc_strhash< C >::lookup ( const char *  k,
C *  pc 
) const [inline]

Definition at line 416 of file sc_hash.h.

template<class C>
bool sc_core::sc_strhash< C >::contains ( const char *  k  )  const [inline]

Definition at line 420 of file sc_hash.h.

template<class C>
C sc_core::sc_strhash< C >::operator[] ( const char *  k  )  const [inline]

Definition at line 424 of file sc_hash.h.

void sc_core::sc_phash_base::rehash (  )  [protected, inherited]

Definition at line 135 of file sc_hash.cpp.

unsigned sc_core::sc_phash_base::do_hash ( const void *  key  )  const [inline, protected, inherited]

Definition at line 89 of file sc_hash.h.

sc_phash_elem * sc_core::sc_phash_base::add_direct ( void *  key,
void *  contents,
unsigned  hash_val 
) [protected, inherited]

Definition at line 210 of file sc_hash.cpp.

sc_phash_elem * sc_core::sc_phash_base::find_entry_c ( unsigned  hv,
const void *  k,
sc_phash_elem ***  plast 
) [protected, inherited]

Definition at line 189 of file sc_hash.cpp.

sc_phash_elem * sc_core::sc_phash_base::find_entry_q ( unsigned  hv,
const void *  k,
sc_phash_elem ***  plast 
) [protected, inherited]

Definition at line 167 of file sc_hash.cpp.

sc_phash_elem* sc_core::sc_phash_base::find_entry ( unsigned  hv,
const void *  k,
sc_phash_elem ***  plast = 0 
) const [inline, protected, inherited]

Definition at line 94 of file sc_hash.h.

void sc_core::sc_phash_base::set_cmpr_fn ( cmpr_fn_t  c  )  [inherited]

Definition at line 107 of file sc_hash.cpp.

void sc_core::sc_phash_base::set_hash_fn ( hash_fn_t  h  )  [inherited]

Definition at line 113 of file sc_hash.cpp.

bool sc_core::sc_phash_base::empty (  )  const [inline, inherited]

Definition at line 117 of file sc_hash.h.

unsigned sc_core::sc_phash_base::count (  )  const [inline, inherited]

Definition at line 118 of file sc_hash.h.

void sc_core::sc_phash_base::erase ( void(*)(void *)  kfree  )  [inherited]

Definition at line 240 of file sc_hash.cpp.

void sc_core::sc_phash_base::copy ( const sc_phash_base b  )  [inherited]

Definition at line 257 of file sc_hash.cpp.

void sc_core::sc_phash_base::copy ( const sc_phash_base b  )  [inline, inherited]

Definition at line 123 of file sc_hash.h.

void sc_core::sc_phash_base::copy ( const sc_phash_base b,
void *(*)(const void *)  kdup,
void(*)(void *)  kfree 
) [inherited]

Definition at line 266 of file sc_hash.cpp.

int sc_core::sc_phash_base::insert ( void *  k,
void *  c 
) [inherited]

Definition at line 275 of file sc_hash.cpp.

int sc_core::sc_phash_base::insert ( void *  k  )  [inline, inherited]

Definition at line 126 of file sc_hash.h.

int sc_core::sc_phash_base::insert ( void *  k,
void *  c,
void *(*)(const void *)  kdup 
) [inherited]

Definition at line 290 of file sc_hash.cpp.

int sc_core::sc_phash_base::insert_if_not_exists ( void *  k,
void *  c 
) [inherited]

Definition at line 305 of file sc_hash.cpp.

int sc_core::sc_phash_base::insert_if_not_exists ( void *  k  )  [inline, inherited]

Definition at line 129 of file sc_hash.h.

int sc_core::sc_phash_base::insert_if_not_exists ( void *  k,
void *  c,
void *(*)(const void *)  kdup 
) [inherited]

Definition at line 318 of file sc_hash.cpp.

int sc_core::sc_phash_base::remove ( const void *  k  )  [inherited]

Definition at line 331 of file sc_hash.cpp.

int sc_core::sc_phash_base::remove ( const void *  k,
void **  pk,
void **  pc 
) [inherited]

Definition at line 348 of file sc_hash.cpp.

int sc_core::sc_phash_base::remove ( const void *  k,
void(*)(void *)  kfree 
) [inherited]

Definition at line 372 of file sc_hash.cpp.

int sc_core::sc_phash_base::remove_by_contents ( const void *  c  )  [inherited]

Definition at line 385 of file sc_hash.cpp.

int sc_core::sc_phash_base::remove_by_contents ( const void *  c,
void(*)(void *)  kfree 
) [inherited]

int sc_core::sc_phash_base::remove_by_contents ( bool(*)(const void *, void *)  predicate,
void *  arg,
void(*)(void *)  kfree 
) [inherited]

int sc_core::sc_phash_base::lookup ( const void *  k,
void **  pc 
) const [inherited]

Definition at line 495 of file sc_hash.cpp.

bool sc_core::sc_phash_base::contains ( const void *  k  )  const [inline, inherited]

Definition at line 139 of file sc_hash.h.

void * sc_core::sc_phash_base::operator[] ( const void *  key  )  const [inherited]

Definition at line 510 of file sc_hash.cpp.


Friends And Related Function Documentation

template<class C>
friend class sc_strhash_iter< C > [friend]

Definition at line 368 of file sc_hash.h.


Member Data Documentation

void* sc_core::sc_phash_base::default_value [protected, inherited]

Definition at line 76 of file sc_hash.h.

int sc_core::sc_phash_base::num_bins [protected, inherited]

Definition at line 77 of file sc_hash.h.

int sc_core::sc_phash_base::num_entries [protected, inherited]

Definition at line 78 of file sc_hash.h.

int sc_core::sc_phash_base::max_density [protected, inherited]

Definition at line 79 of file sc_hash.h.

int sc_core::sc_phash_base::reorder_flag [protected, inherited]

Definition at line 80 of file sc_hash.h.

double sc_core::sc_phash_base::grow_factor [protected, inherited]

Definition at line 81 of file sc_hash.h.

sc_phash_elem** sc_core::sc_phash_base::bins [protected, inherited]

Definition at line 83 of file sc_hash.h.

hash_fn_t sc_core::sc_phash_base::hash [protected, inherited]

Definition at line 85 of file sc_hash.h.

cmpr_fn_t sc_core::sc_phash_base::cmpr [protected, inherited]

Definition at line 86 of file sc_hash.h.


The documentation for this class was generated from the following file:

Generated on Wed Jan 21 15:32:16 2009 for SystemC by  doxygen 1.5.5