SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_core::sc_pdhash< K, C > Class Template Reference

#include <sysc/utils/sc_hash.h>

Inheritance diagram for sc_core::sc_pdhash< K, C >:
Collaboration diagram for sc_core::sc_pdhash< K, C >:

Public Types

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

Public Member Functions

 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)
 
 ~sc_pdhash ()
 
void erase ()
 
void copy (const sc_pdhash< K, C > &b)
 
int insert (K k, C c)
 
int insert (K k)
 
int insert_if_not_exists (K k, C c)
 
int insert_if_not_exists (K k)
 
int remove (K k)
 
int remove (K k, K *pk, C *pc)
 
int remove_by_contents (C c)
 
int remove_by_contents (bool(*predicate)(const void *, void *), void *arg)
 
int lookup (K k, C *pc) const
 
bool contains (K k) const
 
operator[] (K 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_elem * add_direct (void *key, void *contents, unsigned hash_val)
 
sc_phash_elem * find_entry_c (unsigned hv, const void *k, sc_phash_elem ***plast)
 
sc_phash_elem * find_entry_q (unsigned hv, const void *k, sc_phash_elem ***plast)
 
sc_phash_elem * find_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_pdhash_iter< K, C >
 

Detailed Description

template<class K, class C>
class sc_core::sc_pdhash< K, C >

Definition at line 260 of file sc_hash.h.

Member Typedef Documentation

◆ cmpr_fn_t

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

Definition at line 58 of file sc_hash.h.

◆ hash_fn_t

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

Definition at line 57 of file sc_hash.h.

◆ iterator

template<class K, class C>
typedef sc_pdhash_iter<K,C> sc_core::sc_pdhash< K, C >::iterator

Definition at line 268 of file sc_hash.h.

Constructor & Destructor Documentation

◆ sc_pdhash()

template<class K, class C>
sc_core::sc_pdhash< K, C >::sc_pdhash ( 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 *(*)(const void *)  kdup_fn = 0,
void(*)(void *)  kfree_fn = 0 
)
inline

Definition at line 269 of file sc_hash.h.

◆ ~sc_pdhash()

template<class K, class C>
sc_core::sc_pdhash< K, C >::~sc_pdhash ( )
inline

Definition at line 283 of file sc_hash.h.

Member Function Documentation

◆ add_direct()

sc_phash_elem* sc_core::sc_phash_base::add_direct ( void *  key,
void *  contents,
unsigned  hash_val 
)
protectedinherited

◆ contains() [1/2]

bool sc_core::sc_phash_base::contains ( const void *  k) const
inlineinherited

Definition at line 124 of file sc_hash.h.

◆ contains() [2/2]

template<class K, class C>
bool sc_core::sc_pdhash< K, C >::contains ( k) const
inline

Definition at line 319 of file sc_hash.h.

◆ copy() [1/4]

void sc_core::sc_phash_base::copy ( const sc_phash_base )
inherited

◆ copy() [2/4]

void sc_core::sc_phash_base::copy ( const sc_phash_base b)
inlineinherited

Definition at line 108 of file sc_hash.h.

◆ copy() [3/4]

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

◆ copy() [4/4]

template<class K, class C>
void sc_core::sc_pdhash< K, C >::copy ( const sc_pdhash< K, C > &  b)
inline

Definition at line 291 of file sc_hash.h.

◆ count()

unsigned sc_core::sc_phash_base::count ( ) const
inlineinherited

Definition at line 103 of file sc_hash.h.

◆ do_hash()

unsigned sc_core::sc_phash_base::do_hash ( const void *  key) const
inlineprotectedinherited

Definition at line 74 of file sc_hash.h.

◆ empty()

bool sc_core::sc_phash_base::empty ( ) const
inlineinherited

Definition at line 102 of file sc_hash.h.

◆ erase() [1/2]

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

◆ erase() [2/2]

template<class K, class C>
void sc_core::sc_pdhash< K, C >::erase ( )
inline

Definition at line 287 of file sc_hash.h.

◆ find_entry()

sc_phash_elem* sc_core::sc_phash_base::find_entry ( unsigned  hv,
const void *  k,
sc_phash_elem ***  plast = 0 
) const
inlineprotectedinherited

Definition at line 79 of file sc_hash.h.

◆ find_entry_c()

sc_phash_elem* sc_core::sc_phash_base::find_entry_c ( unsigned  hv,
const void *  k,
sc_phash_elem ***  plast 
)
protectedinherited

◆ find_entry_q()

sc_phash_elem* sc_core::sc_phash_base::find_entry_q ( unsigned  hv,
const void *  k,
sc_phash_elem ***  plast 
)
protectedinherited

◆ insert() [1/5]

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

◆ insert() [2/5]

int sc_core::sc_phash_base::insert ( void *  k)
inlineinherited

Definition at line 111 of file sc_hash.h.

◆ insert() [3/5]

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

◆ insert() [4/5]

template<class K, class C>
int sc_core::sc_pdhash< K, C >::insert ( k,
c 
)
inline

Definition at line 292 of file sc_hash.h.

◆ insert() [5/5]

template<class K, class C>
int sc_core::sc_pdhash< K, C >::insert ( k)
inline

Definition at line 293 of file sc_hash.h.

◆ insert_if_not_exists() [1/5]

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

◆ insert_if_not_exists() [2/5]

int sc_core::sc_phash_base::insert_if_not_exists ( void *  k)
inlineinherited

Definition at line 114 of file sc_hash.h.

◆ insert_if_not_exists() [3/5]

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

◆ insert_if_not_exists() [4/5]

template<class K, class C>
int sc_core::sc_pdhash< K, C >::insert_if_not_exists ( k,
c 
)
inline

Definition at line 294 of file sc_hash.h.

◆ insert_if_not_exists() [5/5]

template<class K, class C>
int sc_core::sc_pdhash< K, C >::insert_if_not_exists ( k)
inline

Definition at line 298 of file sc_hash.h.

◆ lookup() [1/2]

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

◆ lookup() [2/2]

template<class K, class C>
int sc_core::sc_pdhash< K, C >::lookup ( k,
C *  pc 
) const
inline

Definition at line 315 of file sc_hash.h.

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

template<class K, class C>
C sc_core::sc_pdhash< K, C >::operator[] ( k) const
inline

Definition at line 323 of file sc_hash.h.

◆ rehash()

void sc_core::sc_phash_base::rehash ( )
protectedinherited

◆ remove() [1/5]

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

◆ remove() [2/5]

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

◆ remove() [3/5]

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

◆ remove() [4/5]

template<class K, class C>
int sc_core::sc_pdhash< K, C >::remove ( k)
inline

Definition at line 302 of file sc_hash.h.

◆ remove() [5/5]

template<class K, class C>
int sc_core::sc_pdhash< K, C >::remove ( k,
K *  pk,
C *  pc 
)
inline

Definition at line 303 of file sc_hash.h.

◆ remove_by_contents() [1/5]

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

◆ remove_by_contents() [2/5]

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

◆ remove_by_contents() [3/5]

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

◆ remove_by_contents() [4/5]

template<class K, class C>
int sc_core::sc_pdhash< K, C >::remove_by_contents ( c)
inline

Definition at line 307 of file sc_hash.h.

◆ remove_by_contents() [5/5]

template<class K, class C>
int sc_core::sc_pdhash< K, C >::remove_by_contents ( bool(*)(const void *, void *)  predicate,
void *  arg 
)
inline

Definition at line 311 of file sc_hash.h.

◆ set_cmpr_fn()

void sc_core::sc_phash_base::set_cmpr_fn ( cmpr_fn_t  )
inherited

◆ set_hash_fn()

void sc_core::sc_phash_base::set_hash_fn ( hash_fn_t  )
inherited

Friends And Related Function Documentation

◆ sc_pdhash_iter< K, C >

template<class K, class C>
friend class sc_pdhash_iter< K, C >
friend

Definition at line 261 of file sc_hash.h.

Member Data Documentation

◆ bins

sc_phash_elem** sc_core::sc_phash_base::bins
protectedinherited

Definition at line 68 of file sc_hash.h.

◆ cmpr

cmpr_fn_t sc_core::sc_phash_base::cmpr
protectedinherited

Definition at line 71 of file sc_hash.h.

◆ default_value

void* sc_core::sc_phash_base::default_value
protectedinherited

Definition at line 61 of file sc_hash.h.

◆ grow_factor

double sc_core::sc_phash_base::grow_factor
protectedinherited

Definition at line 66 of file sc_hash.h.

◆ hash

hash_fn_t sc_core::sc_phash_base::hash
protectedinherited

Definition at line 70 of file sc_hash.h.

◆ max_density

int sc_core::sc_phash_base::max_density
protectedinherited

Definition at line 64 of file sc_hash.h.

◆ num_bins

int sc_core::sc_phash_base::num_bins
protectedinherited

Definition at line 62 of file sc_hash.h.

◆ num_entries

int sc_core::sc_phash_base::num_entries
protectedinherited

Definition at line 63 of file sc_hash.h.

◆ reorder_flag

int sc_core::sc_phash_base::reorder_flag
protectedinherited

Definition at line 65 of file sc_hash.h.


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