KVIrc 5.2.6
Developer APIs
KviPointerHashTable.h File Reference

Pointer Hash Table. More...

#include "kvi_settings.h"
#include "KviPointerList.h"
#include "KviCString.h"
#include "KviQString.h"
#include "KviMemory.h"
#include "kvi_debug.h"
#include <ctype.h>

Go to the source code of this file.

Classes

class  KviPointerHashTable< Key, T >
 A fast pointer hash table implementation. More...
 
class  KviPointerHashTableEntry< Key, T >
 
class  KviPointerHashTableIterator< Key, T >
 A fast pointer hash table iterator implementation. More...
 

Functions

unsigned int kvi_hash_hash (const char *szKey, bool bCaseSensitive)
 Hash function for the char * data type.
 
unsigned int kvi_hash_hash (const int &iKey, bool)
 Hash function for the int data type.
 
unsigned int kvi_hash_hash (const KviCString &szKey, bool bCaseSensitive)
 Hash function for the KviCString data type.
 
unsigned int kvi_hash_hash (const QString &szKey, bool bCaseSensitive)
 Hash function for the QString data type.
 
unsigned int kvi_hash_hash (const unsigned short &iKey, bool)
 Hash function for the unsigned short data type.
 
unsigned int kvi_hash_hash (void *pKey, bool)
 Hash function for the void * data type.
 
void kvi_hash_key_copy (const char *const &szFrom, const char *&szTo, bool bDeepCopy)
 Hash key copy function for the char * data type.
 
void kvi_hash_key_copy (const int &iKeyFrom, int &iKeyTo, bool)
 Hash key copy function for the int data type.
 
void kvi_hash_key_copy (const KviCString &szFrom, KviCString &szTo, bool)
 Hash key copy function for the KviCString data type.
 
void kvi_hash_key_copy (const QString &szFrom, QString &szTo, bool)
 Hash key copy function for the QString data type.
 
void kvi_hash_key_copy (const unsigned short &iKeyFrom, unsigned short &iKeyTo, bool)
 Hash key copy function for the unsigned short data type.
 
void kvi_hash_key_copy (void *const &pKeyFrom, void *&pKeyTo, bool)
 Hash key copy function for the void * data type.
 
const char *& kvi_hash_key_default (const char **)
 Default (empty) hash key for the char * data type.
 
const int & kvi_hash_key_default (int *)
 Default (empty) hash key for the int data type.
 
const KviCStringkvi_hash_key_default (KviCString *)
 Default (empty) hash key for the KviCString data type.
 
const QString & kvi_hash_key_default (QString *)
 Default (empty) hash key for the QString data type.
 
const unsigned short & kvi_hash_key_default (unsigned short *)
 Default (empty) hash key for the unsigned short data type.
 
void *& kvi_hash_key_default (void *)
 Default (empty) hash key for the void * data type.
 
void kvi_hash_key_destroy (const char *&szKey, bool bDeepCopy)
 Hash key destruction function for the char * data type.
 
void kvi_hash_key_destroy (int &, bool)
 Hash key destruction function for the int data type.
 
void kvi_hash_key_destroy (KviCString &, bool)
 Hash key destruction function for the KviCString data type.
 
void kvi_hash_key_destroy (QString &, bool)
 Hash key destruction function for the QString data type.
 
void kvi_hash_key_destroy (unsigned short &, bool)
 Hash key destruction function for the unsigned short data type.
 
void kvi_hash_key_destroy (void *, bool)
 Hash key destruction function for the void * data type.
 
bool kvi_hash_key_equal (const char *szKey1, const char *szKey2, bool bCaseSensitive)
 Hash key compare function for the char * data type.
 
bool kvi_hash_key_equal (const int &iKey1, const int &iKey2, bool)
 Hash key compare function for the int data type.
 
bool kvi_hash_key_equal (const KviCString &szKey1, const KviCString &szKey2, bool bCaseSensitive)
 Hash key compare function for the KviCString data type.
 
bool kvi_hash_key_equal (const QString &szKey1, const QString &szKey2, bool bCaseSensitive)
 Hash key compare function for the QString data type.
 
bool kvi_hash_key_equal (const unsigned short &iKey1, const unsigned short &iKey2, bool)
 Hash key compare function for the unsigned short data type.
 
bool kvi_hash_key_equal (void *pKey1, void *pKey2, bool)
 Hash key compare function for the void * data type.
 

Detailed Description

Pointer Hash Table.

Author
Szymon Stefanek

Function Documentation

◆ kvi_hash_hash() [1/6]

unsigned int kvi_hash_hash ( const char * szKey,
bool bCaseSensitive )
inline

Hash function for the char * data type.

Hash functions for various data types

Referenced by KviPointerHashTable< QString, QString >::find(), KviPointerHashTable< QString, QString >::insert(), and KviPointerHashTable< QString, QString >::remove().

◆ kvi_hash_hash() [2/6]

unsigned int kvi_hash_hash ( const int & iKey,
bool  )
inline

Hash function for the int data type.

◆ kvi_hash_hash() [3/6]

unsigned int kvi_hash_hash ( const KviCString & szKey,
bool bCaseSensitive )
inline

Hash function for the KviCString data type.

References p, and KviCString::ptr().

◆ kvi_hash_hash() [4/6]

unsigned int kvi_hash_hash ( const QString & szKey,
bool bCaseSensitive )
inline

Hash function for the QString data type.

References p.

◆ kvi_hash_hash() [5/6]

unsigned int kvi_hash_hash ( const unsigned short & iKey,
bool  )
inline

Hash function for the unsigned short data type.

◆ kvi_hash_hash() [6/6]

unsigned int kvi_hash_hash ( void * pKey,
bool  )
inline

Hash function for the void * data type.

◆ kvi_hash_key_copy() [1/6]

void kvi_hash_key_copy ( const char *const & szFrom,
const char *& szTo,
bool bDeepCopy )
inline

Hash key copy function for the char * data type.

References KviMemory::allocate(), KviMemory::copy(), and kvi_strLen.

Referenced by KviPointerHashTable< QString, QString >::insert().

◆ kvi_hash_key_copy() [2/6]

void kvi_hash_key_copy ( const int & iKeyFrom,
int & iKeyTo,
bool  )
inline

Hash key copy function for the int data type.

◆ kvi_hash_key_copy() [3/6]

void kvi_hash_key_copy ( const KviCString & szFrom,
KviCString & szTo,
bool  )
inline

Hash key copy function for the KviCString data type.

◆ kvi_hash_key_copy() [4/6]

void kvi_hash_key_copy ( const QString & szFrom,
QString & szTo,
bool  )
inline

Hash key copy function for the QString data type.

◆ kvi_hash_key_copy() [5/6]

void kvi_hash_key_copy ( const unsigned short & iKeyFrom,
unsigned short & iKeyTo,
bool  )
inline

Hash key copy function for the unsigned short data type.

◆ kvi_hash_key_copy() [6/6]

void kvi_hash_key_copy ( void *const & pKeyFrom,
void *& pKeyTo,
bool  )
inline

Hash key copy function for the void * data type.

◆ kvi_hash_key_default() [1/6]

const char *& kvi_hash_key_default ( const char ** )
inline

◆ kvi_hash_key_default() [2/6]

const int & kvi_hash_key_default ( int * )
inline

Default (empty) hash key for the int data type.

◆ kvi_hash_key_default() [3/6]

const KviCString & kvi_hash_key_default ( KviCString * )
inline

Default (empty) hash key for the KviCString data type.

References KviCString::emptyString().

◆ kvi_hash_key_default() [4/6]

const QString & kvi_hash_key_default ( QString * )
inline

Default (empty) hash key for the QString data type.

◆ kvi_hash_key_default() [5/6]

const unsigned short & kvi_hash_key_default ( unsigned short * )
inline

Default (empty) hash key for the unsigned short data type.

◆ kvi_hash_key_default() [6/6]

void *& kvi_hash_key_default ( void * )
inline

Default (empty) hash key for the void * data type.

◆ kvi_hash_key_destroy() [1/6]

void kvi_hash_key_destroy ( const char *& szKey,
bool bDeepCopy )
inline

◆ kvi_hash_key_destroy() [2/6]

void kvi_hash_key_destroy ( int & ,
bool  )
inline

Hash key destruction function for the int data type.

◆ kvi_hash_key_destroy() [3/6]

void kvi_hash_key_destroy ( KviCString & ,
bool  )
inline

Hash key destruction function for the KviCString data type.

◆ kvi_hash_key_destroy() [4/6]

void kvi_hash_key_destroy ( QString & ,
bool  )
inline

Hash key destruction function for the QString data type.

◆ kvi_hash_key_destroy() [5/6]

void kvi_hash_key_destroy ( unsigned short & ,
bool  )
inline

Hash key destruction function for the unsigned short data type.

◆ kvi_hash_key_destroy() [6/6]

void kvi_hash_key_destroy ( void * ,
bool  )
inline

Hash key destruction function for the void * data type.

◆ kvi_hash_key_equal() [1/6]

bool kvi_hash_key_equal ( const char * szKey1,
const char * szKey2,
bool bCaseSensitive )
inline

◆ kvi_hash_key_equal() [2/6]

bool kvi_hash_key_equal ( const int & iKey1,
const int & iKey2,
bool  )
inline

Hash key compare function for the int data type.

◆ kvi_hash_key_equal() [3/6]

bool kvi_hash_key_equal ( const KviCString & szKey1,
const KviCString & szKey2,
bool bCaseSensitive )
inline

Hash key compare function for the KviCString data type.

References kvi_hash_key_equal(), and KviCString::ptr().

◆ kvi_hash_key_equal() [4/6]

bool kvi_hash_key_equal ( const QString & szKey1,
const QString & szKey2,
bool bCaseSensitive )
inline

Hash key compare function for the QString data type.

References KviQString::equalCI(), and KviQString::equalCS().

◆ kvi_hash_key_equal() [5/6]

bool kvi_hash_key_equal ( const unsigned short & iKey1,
const unsigned short & iKey2,
bool  )
inline

Hash key compare function for the unsigned short data type.

◆ kvi_hash_key_equal() [6/6]

bool kvi_hash_key_equal ( void * pKey1,
void * pKey2,
bool  )
inline

Hash key compare function for the void * data type.