|
Mixes for Privacy and Anonymity in the Internet
|
Public Member Functions | |
| Hashtable (UINT32(*func1)(void *), SINT32(*func2)(void *, void *), SINT32 capacity=1000, float loadFactor=0.75) | |
| ~Hashtable () | |
| CAMutex * | getMutex () |
| bool | isEmpty () |
| Tests if the hashtable is empty. | |
| bool | containsKey (void *key) |
| Testet, ob ein bestimmter Schlssel im Hashtable enthalten ist. | |
| void * | getValue (void *key) |
| Sucht den zu einem Schlssel (key) passenden Wert (value) | |
| UINT32 | getSize () |
| UINT32 | getCapacity () |
| void * | put (void *key, void *value) |
| Mit dieser Funktion wird ein neuer Eintrag bestehend aus einem Zugriffsschlssel (key) und dessen Wert (value) in den Hashtable eingefgt. | |
| void * | remove (void *key) |
| entfernt einen Eintrag aus einem Hashtable | |
| void | clear (SINT8 keyMode=HASH_EMPTY_NONE, SINT8 valueMode=HASH_EMPTY_NONE) |
Static Public Member Functions | |
| static UINT32 | stringHash (UINT8 *str) |
| static SINT32 | stringCompare (UINT8 *a, UINT8 **b) |
| static UINT32 | hashUINT64 (UINT64 *a_number) |
| static SINT32 | compareUINT64 (UINT64 *a_numberA, UINT64 *a_numberB) |
| static UINT32 | hashUINT32 (UINT32 *a_number) |
| static SINT32 | compareUINT32 (UINT32 *a_numberA, UINT32 *a_numberB) |
Protected Member Functions | |
| bool | rehash () |
| Der Hashtable wird in der Kapazitt verdoppelt und neu aufgebaut. | |
| struct Entry * | getHashEntry (void *key) |
| Gibt den zu einem Schlssel passenden Eintrag eines Hashtables zurueck. | |
Protected Attributes | |
| SINT32 | m_capacity |
| SINT32 | m_count |
| SINT32 | m_threshold |
| SINT32 | m_modCount |
| float | m_loadFactor |
| struct Entry ** | m_table |
| UINT32(* | m_hashFunc )(void *) |
| SINT32(* | m_compareFunc )(void *, void *) |
Private Attributes | |
| CAMutex * | m_pMutex |
| Hashtable::Hashtable | ( | UINT32(*)(void *) | func1, |
| SINT32(*)(void *, void *) | func2, | ||
| SINT32 | capacity = 1000, |
||
| float | loadFactor = 0.75 |
||
| ) |
References m_capacity, m_compareFunc, m_count, m_hashFunc, m_loadFactor, m_modCount, m_pMutex, m_table, and m_threshold.
References Entry::e_Next, CAMutex::lock(), m_capacity, m_compareFunc, m_count, m_hashFunc, m_loadFactor, m_modCount, m_pMutex, m_table, m_threshold, and CAMutex::unlock().
| void Hashtable::clear | ( | SINT8 | keyMode = HASH_EMPTY_NONE, |
| SINT8 | valueMode = HASH_EMPTY_NONE |
||
| ) |
References Entry::e_Key, Entry::e_Next, Entry::e_Value, HASH_EMPTY_DELETE, m_capacity, m_count, and m_table.
Referenced by CAAccountingInstance::~CAAccountingInstance().
| static SINT32 Hashtable::compareUINT32 | ( | UINT32 * | a_numberA, |
| UINT32 * | a_numberB | ||
| ) | [static] |
| static SINT32 Hashtable::compareUINT64 | ( | UINT64 * | a_numberA, |
| UINT64 * | a_numberB | ||
| ) | [static] |
Referenced by CAAccountingInstance::CAAccountingInstance().
| bool Hashtable::containsKey | ( | void * | key | ) |
Testet, ob ein bestimmter Schlssel im Hashtable enthalten ist.
| key | der gesuchte Schlssel |
References getHashEntry().
References m_capacity.
| struct Entry * Hashtable::getHashEntry | ( | void * | key | ) | [read, protected] |
Gibt den zu einem Schlssel passenden Eintrag eines Hashtables zurueck.
| key | der zu suchende Schlssel |
References Entry::e_Key, Entry::e_Next, m_capacity, m_compareFunc, m_hashFunc, and m_table.
Referenced by containsKey(), and getValue().
| CAMutex * Hashtable::getMutex | ( | ) |
References m_pMutex.
Referenced by CAAccountingInstance::__newSettlementTransaction(), CAAccountingInstance::cleanupTableEntry(), CAAccountingInstance::finishLoginProcess(), CAAccountingInstance::handleChallengeResponse_internal(), CAAccountingInstance::handleJapPacket_internal(), CAAccountingInstance::settlementTransaction(), CAAccountingInstance::unlockLogin(), and CAAccountingInstance::~CAAccountingInstance().
References m_count.
Referenced by CAAccountingInstance::getNrOfUsers().
| void * Hashtable::getValue | ( | void * | key | ) |
Sucht den zu einem Schlssel (key) passenden Wert (value)
| key | der gesuchte Schlssel |
References Entry::e_Value, and getHashEntry().
Referenced by CAAccountingInstance::__commitSettlementToLoginTable(), CAAccountingInstance::cascadeMatchesCC(), CAAccountingInstance::cleanupTableEntry(), CAAccountingInstance::finishLoginProcess(), CAAccountingInstance::handleChallengeResponse_internal(), CAAccountingInstance::handleJapPacket_internal(), CAAccountingInstance::settlementTransaction(), and CAAccountingInstance::unlockLogin().
| static UINT32 Hashtable::hashUINT32 | ( | UINT32 * | a_number | ) | [static] |
| static UINT32 Hashtable::hashUINT64 | ( | UINT64 * | a_number | ) | [static] |
Referenced by CAAccountingInstance::CAAccountingInstance().
| bool Hashtable::isEmpty | ( | ) |
| void * Hashtable::put | ( | void * | key, |
| void * | value | ||
| ) |
Mit dieser Funktion wird ein neuer Eintrag bestehend aus einem Zugriffsschlssel (key) und dessen Wert (value) in den Hashtable eingefgt.
Gibt es diesen Schlssel bereits im Hashtable, wird der alte Eintrag berschrieben.
einen neuen Eintrag in einen Hashtable einfgen
| key | der Schlssel |
| value | der zugehrige Wert |
References Entry::e_Key, Entry::e_Next, Entry::e_Value, m_capacity, m_compareFunc, m_count, m_hashFunc, m_table, m_threshold, and rehash().
Referenced by CAAccountingInstance::CAAccountingInstance(), and CAAccountingInstance::handleChallengeResponse_internal().
| bool Hashtable::rehash | ( | ) | [protected] |
Der Hashtable wird in der Kapazitt verdoppelt und neu aufgebaut.
References Entry::e_Key, Entry::e_Next, m_capacity, m_hashFunc, m_loadFactor, m_modCount, m_table, m_threshold, and CAMsg::printMsg().
Referenced by put().
| void * Hashtable::remove | ( | void * | key | ) |
entfernt einen Eintrag aus einem Hashtable
Mit dieser Funktion entfernt man den zum Schlssel (key) gehrigen Eintrag aus dem Hashtable.
| key | der Schlssel |
References Entry::e_Key, Entry::e_Next, Entry::e_Value, m_capacity, m_compareFunc, m_count, m_hashFunc, and m_table.
Referenced by CAAccountingInstance::cleanupTableEntry(), CAAccountingInstance::handleChallengeResponse_internal(), and CAAccountingInstance::~CAAccountingInstance().
| static SINT32 Hashtable::stringCompare | ( | UINT8 * | a, |
| UINT8 ** | b | ||
| ) | [static] |
Referenced by CAAccountingInstance::CAAccountingInstance().
| static UINT32 Hashtable::stringHash | ( | UINT8 * | str | ) | [static] |
Referenced by CAAccountingInstance::CAAccountingInstance().
SINT32 Hashtable::m_capacity [protected] |
Referenced by clear(), getCapacity(), getHashEntry(), Hashtable(), put(), rehash(), remove(), and ~Hashtable().
SINT32(* Hashtable::m_compareFunc)(void *, void *) [protected] |
Referenced by getHashEntry(), Hashtable(), put(), remove(), and ~Hashtable().
SINT32 Hashtable::m_count [protected] |
Referenced by clear(), getSize(), Hashtable(), isEmpty(), put(), remove(), and ~Hashtable().
UINT32(* Hashtable::m_hashFunc)(void *) [protected] |
Referenced by getHashEntry(), Hashtable(), put(), rehash(), remove(), and ~Hashtable().
float Hashtable::m_loadFactor [protected] |
Referenced by Hashtable(), rehash(), and ~Hashtable().
SINT32 Hashtable::m_modCount [protected] |
Referenced by Hashtable(), rehash(), and ~Hashtable().
CAMutex* Hashtable::m_pMutex [private] |
Referenced by getMutex(), Hashtable(), and ~Hashtable().
struct Entry** Hashtable::m_table [protected] |
Referenced by clear(), getHashEntry(), Hashtable(), put(), rehash(), remove(), and ~Hashtable().
SINT32 Hashtable::m_threshold [protected] |
Referenced by Hashtable(), put(), rehash(), and ~Hashtable().
1.7.6.1