DCL 4.0
Loading...
Searching...
No Matches
HashFun.h File Reference
#include <bits/types/wint_t.h>
#include <dcl/String.h>

Go to the source code of this file.

Classes

struct  HashFun< TYPE >
struct  HashFun< String >
struct  HashFun< const wchar_t * >
struct  HashFun< wchar_t * >
struct  HashFun< ByteString >
struct  HashFun< const char * >
struct  HashFun< char * >
struct  HashFun< char >
struct  HashFun< unsigned char >
struct  HashFun< short >
struct  HashFun< unsigned short >
struct  HashFun< int >
struct  HashFun< unsigned int >
struct  HashFun< long >
struct  HashFun< unsigned long >
struct  HashFun< long long >
struct  HashFun< unsigned long long >
struct  HashFun< void * >
struct  HashFun< const void * >

Macros

#define __DCL_HASH_FUN_H__   20110303

Functions

unsigned int __wide_string_hashKey (const wchar_t *_psz)
unsigned int __byte_string_hashKey (const char *_psz)
DCLCAPI size_t DCLGetNextPrimNumber (size_t _n)

Macro Definition Documentation

◆ __DCL_HASH_FUN_H__

#define __DCL_HASH_FUN_H__   20110303

Definition at line 2 of file HashFun.h.

Function Documentation

◆ __byte_string_hashKey()

unsigned int __byte_string_hashKey ( const char * _psz)
inline

Definition at line 56 of file HashFun.h.

57{
58 unsigned int h = 0;
59 for( ; *_psz; _psz++)
60 {
61 h = 5 * h + (unsigned char) *_psz;
62 }
63 return h;
64}

◆ __wide_string_hashKey()

unsigned int __wide_string_hashKey ( const wchar_t * _psz)
inline

Definition at line 19 of file HashFun.h.

20{
21 unsigned int h = 0;
22 for( ; *_psz; _psz++)
23 {
24 h = 5 * h + (wint_t) *_psz;
25 }
26 return h;
27}

◆ DCLGetNextPrimNumber()

DCLCAPI size_t DCLGetNextPrimNumber ( size_t _n)

Definition at line 23 of file HashFun.cpp.

24{
25 size_t n = __countof(__prim_numbers, size_t);
26 for(size_t i = 0; i < n; i++)
27 {
28 if (_n < __prim_numbers[i])
29 return __prim_numbers[i];
30 }
31 return __prim_numbers[n - 1];
32}
#define __countof(array, type)
Definition Config.h:365
void CharsetConvertException *size_t n
Definition SQLField.cpp:253