| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // An alternate version of add() that finds the object by hashing and co
mparing | 146 // An alternate version of add() that finds the object by hashing and co
mparing |
| 147 // with some other type, to avoid the cost of type conversion if the obj
ect is already | 147 // with some other type, to avoid the cost of type conversion if the obj
ect is already |
| 148 // in the table. HashTranslator must have the following function members
: | 148 // in the table. HashTranslator must have the following function members
: |
| 149 // static unsigned hash(const T&); | 149 // static unsigned hash(const T&); |
| 150 // static bool equal(const ValueType&, const T&); | 150 // static bool equal(const ValueType&, const T&); |
| 151 // static translate(ValueType&, const T&, unsigned hashCode); | 151 // static translate(ValueType&, const T&, unsigned hashCode); |
| 152 template<typename HashTranslator, typename T> AddResult add(const T&, Ma
ppedPassInType); | 152 template<typename HashTranslator, typename T> AddResult add(const T&, Ma
ppedPassInType); |
| 153 | 153 |
| 154 static bool isValidKey(KeyPeekInType); | 154 static bool isValidKey(KeyPeekInType); |
| 155 | 155 |
| 156 void trace(typename Allocator::Visitor* visitor) { m_impl.trace(visitor)
; } | |
| 157 | |
| 158 private: | 156 private: |
| 159 AddResult inlineAdd(KeyPassInType, MappedPassInReferenceType); | 157 AddResult inlineAdd(KeyPassInType, MappedPassInReferenceType); |
| 160 | 158 |
| 161 HashTableType m_impl; | 159 HashTableType m_impl; |
| 162 }; | 160 }; |
| 163 | 161 |
| 164 template<typename KeyArg, typename MappedArg, typename HashArg, typename Key
TraitsArg, typename MappedTraitsArg, typename Allocator> | 162 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 : | 163 class HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg, All
ocator>::HashMapKeysProxy : |
| 166 private HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsAr
g, Allocator> { | 164 private HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsAr
g, Allocator> { |
| 167 public: | 165 public: |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 typedef typename HashMap<T, U, V, W, X, Y>::const_iterator::Values itera
tor; | 484 typedef typename HashMap<T, U, V, W, X, Y>::const_iterator::Values itera
tor; |
| 487 | 485 |
| 488 vector.resize(collection.size()); | 486 vector.resize(collection.size()); |
| 489 | 487 |
| 490 iterator it = collection.begin().values(); | 488 iterator it = collection.begin().values(); |
| 491 iterator end = collection.end().values(); | 489 iterator end = collection.end().values(); |
| 492 for (unsigned i = 0; it != end; ++it, ++i) | 490 for (unsigned i = 0; it != end; ++it, ++i) |
| 493 vector[i] = *it; | 491 vector[i] = *it; |
| 494 } | 492 } |
| 495 | 493 |
| 496 #if !ENABLE(OILPAN) | |
| 497 template<typename T, typename U, typename V, typename W, typename X> | |
| 498 struct NeedsTracing<HashMap<T, U, V, W, X> > { | |
| 499 static const bool value = false; | |
| 500 }; | |
| 501 #endif | |
| 502 | |
| 503 } // namespace WTF | 494 } // namespace WTF |
| 504 | 495 |
| 505 using WTF::HashMap; | 496 using WTF::HashMap; |
| 506 | 497 |
| 507 #endif /* WTF_HashMap_h */ | 498 #endif /* WTF_HashMap_h */ |
| OLD | NEW |