source: trunk/src/lol/base/hash.h @ 2184

Last change on this file since 2184 was 2184, checked in by sam, 7 years ago

build: rename “core” directory to “base” because the former is used for core
files on some Unix systems.

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://www.wtfpl.net/ for more details.
9//
10
11//
12// The Hash class
13// --------------
14// A very simple Hash class.
15//
16
17#if !defined __LOL_CORE_HASH_H__
18#define __LOL_CORE_HASH_H__
19
20namespace lol
21{
22
23template<typename T> class Hash;
24
25template<> class Hash<int8_t>   { public: uint32_t operator()(int8_t) const; };
26template<> class Hash<uint8_t>  { public: uint32_t operator()(uint8_t) const; };
27template<> class Hash<int16_t>  { public: uint32_t operator()(int16_t) const; };
28template<> class Hash<uint16_t> { public: uint32_t operator()(uint16_t) const; };
29template<> class Hash<int32_t>  { public: uint32_t operator()(int32_t) const; };
30template<> class Hash<uint32_t> { public: uint32_t operator()(uint32_t) const; };
31template<> class Hash<int64_t>  { public: uint32_t operator()(int64_t) const; };
32template<> class Hash<uint64_t> { public: uint32_t operator()(uint64_t) const; };
33
34template<> class Hash<half>     { public: uint32_t operator()(half) const; };
35template<> class Hash<float>    { public: uint32_t operator()(float) const; };
36template<> class Hash<double>   { public: uint32_t operator()(double) const; };
37template<> class Hash<ldouble>  { public: uint32_t operator()(ldouble) const; };
38
39template<> class Hash<char const *>
40{
41public:
42    uint32_t operator()(char const *x) const;
43};
44
45template<> class Hash<String>
46{
47public:
48    uint32_t operator()(String const &s) const;
49};
50
51} /* namespace lol */
52
53#endif // __LOL_CORE_HASH_H__
54
Note: See TracBrowser for help on using the repository browser.