OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // An alternate version of add() that finds the object by hashing and co
mparing | 143 // An alternate version of add() that finds the object by hashing and co
mparing |
144 // with some other type, to avoid the cost of type conversion if the obj
ect is already | 144 // with some other type, to avoid the cost of type conversion if the obj
ect is already |
145 // in the table. HashTranslator must have the following function members
: | 145 // in the table. HashTranslator must have the following function members
: |
146 // static unsigned hash(const T&); | 146 // static unsigned hash(const T&); |
147 // static bool equal(const ValueType&, const T&); | 147 // static bool equal(const ValueType&, const T&); |
148 // static translate(ValueType&, const T&, unsigned hashCode); | 148 // static translate(ValueType&, const T&, unsigned hashCode); |
149 template<typename HashTranslator, typename T> AddResult add(const T&, Ma
ppedPassInType); | 149 template<typename HashTranslator, typename T> AddResult add(const T&, Ma
ppedPassInType); |
150 | 150 |
151 static bool isValidKey(KeyPeekInType); | 151 static bool isValidKey(KeyPeekInType); |
152 | 152 |
153 void trace(typename Allocator::Visitor* visitor) | 153 void trace(typename Allocator::Visitor* visitor) { m_impl.trace(visitor)
; } |
154 { | |
155 m_impl.trace(visitor); | |
156 } | |
157 | 154 |
158 private: | 155 private: |
159 AddResult inlineAdd(KeyPeekInType, MappedPassInReferenceType); | 156 AddResult inlineAdd(KeyPeekInType, MappedPassInReferenceType); |
160 | 157 |
161 HashTableType m_impl; | 158 HashTableType m_impl; |
162 }; | 159 }; |
163 | 160 |
164 template<typename KeyArg, typename MappedArg, typename HashArg, typename Key
TraitsArg, typename MappedTraitsArg, typename Allocator> | 161 template<typename KeyArg, typename MappedArg, typename HashArg, typename Key
TraitsArg, typename MappedTraitsArg, typename Allocator> |
165 class HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg, All
ocator>::HashMapKeysProxy : | 162 class HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg, All
ocator>::HashMapKeysProxy : |
166 private HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsAr
g, Allocator> { | 163 private HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsAr
g, Allocator> { |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 iterator end = collection.end().values(); | 506 iterator end = collection.end().values(); |
510 for (unsigned i = 0; it != end; ++it, ++i) | 507 for (unsigned i = 0; it != end; ++it, ++i) |
511 vector[i] = *it; | 508 vector[i] = *it; |
512 } | 509 } |
513 | 510 |
514 } // namespace WTF | 511 } // namespace WTF |
515 | 512 |
516 using WTF::HashMap; | 513 using WTF::HashMap; |
517 | 514 |
518 #endif /* WTF_HashMap_h */ | 515 #endif /* WTF_HashMap_h */ |
OLD | NEW |