Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

57 righe
1.8 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2013 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. // The Hash class
  12. // --------------
  13. // A very simple Hash class.
  14. //
  15. #if !defined __LOL_BASE_HASH_H__
  16. #define __LOL_BASE_HASH_H__
  17. namespace lol
  18. {
  19. template<typename T> class Hash;
  20. template<> class Hash<int8_t> { public: uint32_t operator()(int8_t) const; };
  21. template<> class Hash<uint8_t> { public: uint32_t operator()(uint8_t) const; };
  22. template<> class Hash<int16_t> { public: uint32_t operator()(int16_t) const; };
  23. template<> class Hash<uint16_t> { public: uint32_t operator()(uint16_t) const; };
  24. template<> class Hash<int32_t> { public: uint32_t operator()(int32_t) const; };
  25. template<> class Hash<uint32_t> { public: uint32_t operator()(uint32_t) const; };
  26. template<> class Hash<int64_t> { public: uint32_t operator()(int64_t) const; };
  27. template<> class Hash<uint64_t> { public: uint32_t operator()(uint64_t) const; };
  28. template<> class Hash<half> { public: uint32_t operator()(half) const; };
  29. template<> class Hash<float> { public: uint32_t operator()(float) const; };
  30. template<> class Hash<double> { public: uint32_t operator()(double) const; };
  31. template<> class Hash<ldouble> { public: uint32_t operator()(ldouble) const; };
  32. template<> class Hash<char const *>
  33. {
  34. public:
  35. uint32_t operator()(char const *x) const;
  36. uint32_t operator()(String const &s) const;
  37. };
  38. template<> class Hash<String>
  39. {
  40. public:
  41. uint32_t operator()(String const &s) const;
  42. uint32_t operator()(char const *x) const;
  43. };
  44. } /* namespace lol */
  45. #endif // __LOL_BASE_HASH_H__