BALL
1.4.2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
BALL
COMMON
hash.h
Go to the documentation of this file.
1
// -*- Mode: C++; tab-width: 2; -*-
2
// vi: set ts=2:
3
//
4
5
#ifndef BALL_COMMON_HASH_H
6
#define BALL_COMMON_HASH_H
7
8
#ifndef BALL_COMMON_H
9
# include <
BALL/common.h
>
10
#endif
11
12
#ifndef BALL_DATATYPE_STRING_H
13
# include <
BALL/DATATYPE/string.h
>
14
#endif
15
16
namespace
BALL
17
{
21
24
BALL_EXPORT
extern
HashIndex
hashPointer
(
void
*
const
ptr);
25
28
BALL_EXPORT
extern
HashIndex
hashString
(
const
char
* str);
29
32
BALL_EXPORT
extern
HashIndex
hashPJWString
(
const
char
* str);
33
36
BALL_EXPORT
extern
HashIndex
hashElfString
(
const
char
* str);
37
46
template
<
typename
T>
47
inline
HashIndex
Hash
(
const
T& key)
48
{
49
return
static_cast<
HashIndex
>
((
PointerSizeUInt
)key);
50
}
51
56
BALL_EXPORT
inline
HashIndex
Hash
(
const
string
& s)
57
{
58
return
hashString
(s.c_str());
59
}
60
65
BALL_EXPORT
inline
HashIndex
Hash
(
const
String
& s)
66
{
67
return
hashString
(s.c_str());
68
}
69
73
BALL_EXPORT
inline
HashIndex
Hash
(
void
*
const
& ptr)
74
{
75
return
hashPointer
(ptr);
76
}
77
79
81
86
BALL_EXPORT
HashIndex
getNextPrime
(
HashIndex
l);
87
89
90
}
// namespace BALL
91
92
#endif // BALL_COMMON_HASH_H
Generated by
1.8.3.1