OFFIS DCMTK  Version 3.6.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
DcmHashDict Class Reference

a hash table of pointers to DcmDictEntry objects More...

Collaboration diagram for DcmHashDict:
[legend]

Public Member Functions

 DcmHashDict (int hashTabLen=DCMHASHDICT_DEFAULT_HASHSIZE)
 constructor
 ~DcmHashDict ()
 destructor
int size () const
 counts total number of entries
void clear ()
 clears the hash table of all entries
void put (DcmDictEntry *e)
 inserts an entry into hash table (deletes old entry if present)
const DcmDictEntryget (const DcmTagKey &key, const char *privCreator) const
 hash table lookup for the given tag key and private creator name.
void del (const DcmTagKey &k, const char *privCreator)
 deletes the entry for the given tag and private creator
DcmHashDictIterator begin () const
 returns iterator to start of hash table
DcmHashDictIterator end () const
 returns iterator to end of hash table
STD_NAMESPACE ostream & loadSummary (STD_NAMESPACE ostream &out)
 prints some information about hash table bucket utilization

Private Member Functions

 DcmHashDict (const DcmHashDict &)
 private unimplemented copy constructor
DcmHashDictoperator= (const DcmHashDict &)
 private unimplemented copy assignment operator
void _init (int hashSize)
 performs initialization for given hash table size, called from constructor
int hash (const DcmTagKey *k) const
 compute hash value for given tag key
DcmDictEntryinsertInList (DcmDictEntryList &lst, DcmDictEntry *e)
 inserts new entry into given list
DcmDictEntryremoveInList (DcmDictEntryList &lst, const DcmTagKey &k, const char *privCreator)
 removes the entry for the given tag and private creator
DcmDictEntryfindInList (DcmDictEntryList &lst, const DcmTagKey &k, const char *privCreator) const
 searcjes entry for the given tag and private creator

Private Attributes

DcmDictEntryList ** hashTab
 array of (hash table size) pointers to DcmDictEntryList elements implementing the different buckets of the hash table
int hashTabLength
 number of buckets in hash table
int lowestBucket
 index of lowest bucket for which the DcmDictEntryList has been initialized
int highestBucket
 index of highest bucket for which the DcmDictEntryList has been initialized
int entryCount
 number of entries in hash table

Friends

class DcmHashDictIterator

Detailed Description

a hash table of pointers to DcmDictEntry objects

Definition at line 208 of file dchashdi.h.

Constructor & Destructor Documentation

DcmHashDict::DcmHashDict ( int  hashTabLen = DCMHASHDICT_DEFAULT_HASHSIZE)
inline

constructor

Parameters
hashTabLennumber of buckets in hash table

Definition at line 215 of file dchashdi.h.

References _init().

Member Function Documentation

void DcmHashDict::del ( const DcmTagKey k,
const char *  privCreator 
)

deletes the entry for the given tag and private creator

Parameters
ktag key
privCreatorprivate creator name, may be NULL
DcmDictEntry* DcmHashDict::findInList ( DcmDictEntryList lst,
const DcmTagKey k,
const char *  privCreator 
) const
private

searcjes entry for the given tag and private creator

Parameters
lstlist to search in
ktag key
privCreatorprivate creator name, may be NULL
Returns
pointer to found element, NULL if not found
const DcmDictEntry* DcmHashDict::get ( const DcmTagKey key,
const char *  privCreator 
) const

hash table lookup for the given tag key and private creator name.

Parameters
keytag key
privCreatorprivate creator name, may be NULL
int DcmHashDict::hash ( const DcmTagKey k) const
private

compute hash value for given tag key

Parameters
kpointer to tag key
Returns
hash value
DcmDictEntry* DcmHashDict::insertInList ( DcmDictEntryList lst,
DcmDictEntry e 
)
private

inserts new entry into given list

Parameters
lstlist to add to
enew element to add, will be deleted upon destruction of the hash table
Returns
pointer to replaced element, if any
void DcmHashDict::put ( DcmDictEntry e)

inserts an entry into hash table (deletes old entry if present)

Parameters
epointer to new entry
DcmDictEntry* DcmHashDict::removeInList ( DcmDictEntryList lst,
const DcmTagKey k,
const char *  privCreator 
)
private

removes the entry for the given tag and private creator

Parameters
lstlist to remove from
ktag key
privCreatorprivate creator name, may be NULL
Returns
pointer to removed element, if any

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


Generated on Wed Mar 19 2014 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.1.2