SystemC 3.0.0
Accellera SystemC proof-of-concept library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
sc_core::sc_phash_base Class Reference

#include <sysc/utils/sc_hash.h>

Inheritance diagram for sc_core::sc_phash_base:
Inheritance graph
[legend]

Public Types

typedef unsigned(* hash_fn_t) (const void *)
 
typedef int(* cmpr_fn_t) (const void *, const void *)
 

Public Member Functions

 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)
 
 ~sc_phash_base ()
 
void set_cmpr_fn (cmpr_fn_t)
 
void set_hash_fn (hash_fn_t)
 
bool empty () const
 
unsigned count () const
 
void erase ()
 
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 (bool(*predicate)(const void *, void *), void *arg)
 
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_phash_base_iter
 

Detailed Description

Definition at line 51 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 *)

Definition at line 58 of file sc_hash.h.

◆ hash_fn_t

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

Definition at line 57 of file sc_hash.h.

Constructor & Destructor Documentation

◆ sc_phash_base()

sc_core::sc_phash_base::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 
)

◆ ~sc_phash_base()

sc_core::sc_phash_base::~sc_phash_base ( )

Member Function Documentation

◆ add_direct()

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

◆ contains()

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

Definition at line 124 of file sc_hash.h.

◆ copy() [1/3]

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

Definition at line 108 of file sc_hash.h.

◆ copy() [2/3]

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

◆ copy() [3/3]

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

◆ count()

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

Definition at line 103 of file sc_hash.h.

◆ do_hash()

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

Definition at line 74 of file sc_hash.h.

◆ empty()

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

Definition at line 102 of file sc_hash.h.

◆ erase() [1/2]

void sc_core::sc_phash_base::erase ( )

◆ erase() [2/2]

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

◆ find_entry()

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

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 
)
protected

◆ find_entry_q()

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

◆ insert() [1/3]

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

Definition at line 111 of file sc_hash.h.

◆ insert() [2/3]

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

◆ insert() [3/3]

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

◆ insert_if_not_exists() [1/3]

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

Definition at line 114 of file sc_hash.h.

◆ insert_if_not_exists() [2/3]

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

◆ insert_if_not_exists() [3/3]

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

◆ lookup()

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

◆ operator[]()

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

◆ rehash()

void sc_core::sc_phash_base::rehash ( )
protected

◆ remove() [1/3]

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

◆ remove() [2/3]

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

◆ remove() [3/3]

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

◆ remove_by_contents() [1/4]

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

◆ remove_by_contents() [2/4]

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

◆ remove_by_contents() [3/4]

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

◆ remove_by_contents() [4/4]

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

◆ set_cmpr_fn()

void sc_core::sc_phash_base::set_cmpr_fn ( cmpr_fn_t  )

◆ set_hash_fn()

void sc_core::sc_phash_base::set_hash_fn ( hash_fn_t  )

Friends And Related Function Documentation

◆ sc_phash_base_iter

friend class sc_phash_base_iter
friend

Definition at line 52 of file sc_hash.h.

Member Data Documentation

◆ bins

sc_phash_elem** sc_core::sc_phash_base::bins
protected

Definition at line 68 of file sc_hash.h.

◆ cmpr

cmpr_fn_t sc_core::sc_phash_base::cmpr
protected

Definition at line 71 of file sc_hash.h.

◆ default_value

void* sc_core::sc_phash_base::default_value
protected

Definition at line 61 of file sc_hash.h.

◆ grow_factor

double sc_core::sc_phash_base::grow_factor
protected

Definition at line 66 of file sc_hash.h.

◆ hash

hash_fn_t sc_core::sc_phash_base::hash
protected

Definition at line 70 of file sc_hash.h.

◆ max_density

int sc_core::sc_phash_base::max_density
protected

Definition at line 64 of file sc_hash.h.

◆ num_bins

int sc_core::sc_phash_base::num_bins
protected

Definition at line 62 of file sc_hash.h.

◆ num_entries

int sc_core::sc_phash_base::num_entries
protected

Definition at line 63 of file sc_hash.h.

◆ reorder_flag

int sc_core::sc_phash_base::reorder_flag
protected

Definition at line 65 of file sc_hash.h.


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