KHTML
IntSizeHash.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef IntSizeHash_h
00021 #define IntSizeHash_h
00022
00023 #include "IntSize.h"
00024 #include <wtf/HashMap.h>
00025 #include <wtf/HashSet.h>
00026
00027 using WebCore::IntSize;
00028
00029 namespace WTF {
00030
00031 template<> struct IntHash<IntSize> {
00032 static unsigned hash(const IntSize& key) { return intHash((static_cast<uint64_t>(key.width()) << 32 | key.height())); }
00033 static bool equal(const IntSize& a, const IntSize& b) { return a == b; }
00034
00035 static const bool safeToCompareToEmptyOrDeleted = true;
00036 };
00037 template<> struct DefaultHash<IntSize> { typedef IntHash<IntSize> Hash; };
00038
00039 template<> struct HashTraits<IntSize> : GenericHashTraits<IntSize> {
00040 static const bool emptyValueIsZero = true;
00041 static const bool needsDestruction = false;
00042 static const bool needsRef = false;
00043 static IntSize deletedValue() { return IntSize(-1, -1); }
00044 };
00045 }
00046
00047 #endif