OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 static const bool emptyValueIsZero = true; | 137 static const bool emptyValueIsZero = true; |
138 static void constructDeletedValue(T& slot) { new (NotNull, &slot) T(Hash
TableDeletedValue); } | 138 static void constructDeletedValue(T& slot) { new (NotNull, &slot) T(Hash
TableDeletedValue); } |
139 static bool isDeletedValue(const T& value) { return value.isHashTableDel
etedValue(); } | 139 static bool isDeletedValue(const T& value) { return value.isHashTableDel
etedValue(); } |
140 }; | 140 }; |
141 | 141 |
142 template<typename P> struct HashTraits<OwnPtr<P> > : SimpleClassHashTraits<O
wnPtr<P> > { | 142 template<typename P> struct HashTraits<OwnPtr<P> > : SimpleClassHashTraits<O
wnPtr<P> > { |
143 typedef std::nullptr_t EmptyValueType; | 143 typedef std::nullptr_t EmptyValueType; |
144 | 144 |
145 static EmptyValueType emptyValue() { return nullptr; } | 145 static EmptyValueType emptyValue() { return nullptr; } |
146 | 146 |
| 147 static const bool hasIsEmptyValueFunction = true; |
| 148 static bool isEmptyValue(const OwnPtr<P>& value) { return !value; } |
| 149 |
| 150 typedef typename OwnPtr<P>::PtrType PeekInType; |
| 151 |
147 typedef PassOwnPtr<P> PassInType; | 152 typedef PassOwnPtr<P> PassInType; |
148 static void store(PassOwnPtr<P> value, OwnPtr<P>& storage) { storage = v
alue; } | 153 static void store(PassOwnPtr<P> value, OwnPtr<P>& storage) { storage = v
alue; } |
149 | 154 |
150 typedef PassOwnPtr<P> PassOutType; | 155 typedef PassOwnPtr<P> PassOutType; |
151 static PassOwnPtr<P> passOut(OwnPtr<P>& value) { return value.release();
} | 156 static PassOwnPtr<P> passOut(OwnPtr<P>& value) { return value.release();
} |
152 static PassOwnPtr<P> passOut(std::nullptr_t) { return nullptr; } | 157 static PassOwnPtr<P> passOut(std::nullptr_t) { return nullptr; } |
153 | 158 |
154 typedef typename OwnPtr<P>::PtrType PeekOutType; | 159 typedef typename OwnPtr<P>::PtrType PeekOutType; |
155 static PeekOutType peek(const OwnPtr<P>& value) { return value.get(); } | 160 static PeekOutType peek(const OwnPtr<P>& value) { return value.get(); } |
156 static PeekOutType peek(std::nullptr_t) { return 0; } | 161 static PeekOutType peek(std::nullptr_t) { return 0; } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 }; | 315 }; |
311 | 316 |
312 } // namespace WTF | 317 } // namespace WTF |
313 | 318 |
314 using WTF::HashTraits; | 319 using WTF::HashTraits; |
315 using WTF::PairHashTraits; | 320 using WTF::PairHashTraits; |
316 using WTF::NullableHashTraits; | 321 using WTF::NullableHashTraits; |
317 using WTF::SimpleClassHashTraits; | 322 using WTF::SimpleClassHashTraits; |
318 | 323 |
319 #endif // WTF_HashTraits_h | 324 #endif // WTF_HashTraits_h |
OLD | NEW |