OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 namespace WTF { | 28 namespace WTF { |
29 | 29 |
30 // An unordered hash set that keeps track of how many times you added an item to | 30 // An unordered hash set that keeps track of how many times you added an item to |
31 // the set. The iterators have fields ->key and ->value that return the set | 31 // the set. The iterators have fields ->key and ->value that return the set |
32 // members and their counts, respectively. | 32 // members and their counts, respectively. |
33 template < | 33 template < |
34 typename Value, | 34 typename Value, |
35 typename HashFunctions = typename DefaultHash<Value>::Hash, | 35 typename HashFunctions = typename DefaultHash<Value>::Hash, |
36 typename Traits = HashTraits<Value>, | 36 typename Traits = HashTraits<Value>, |
37 typename Allocator = DefaultAllocator> | 37 typename Allocator = PartitionAllocator> |
38 class HashCountedSet { | 38 class HashCountedSet { |
39 WTF_USE_ALLOCATOR(HashCountedSet, Allocator); | 39 WTF_USE_ALLOCATOR(HashCountedSet, Allocator); |
40 private: | 40 private: |
41 typedef HashMap<Value, unsigned, HashFunctions, Traits, HashTraits<unsigned>
, Allocator> ImplType; | 41 typedef HashMap<Value, unsigned, HashFunctions, Traits, HashTraits<unsigned>
, Allocator> ImplType; |
42 public: | 42 public: |
43 typedef Value ValueType; | 43 typedef Value ValueType; |
44 typedef typename ImplType::iterator iterator; | 44 typedef typename ImplType::iterator iterator; |
45 typedef typename ImplType::const_iterator const_iterator; | 45 typedef typename ImplType::const_iterator const_iterator; |
46 typedef typename ImplType::AddResult AddResult; | 46 typedef typename ImplType::AddResult AddResult; |
47 | 47 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 struct NeedsTracing<HashCountedSet<T, U, V>> { | 155 struct NeedsTracing<HashCountedSet<T, U, V>> { |
156 static const bool value = false; | 156 static const bool value = false; |
157 }; | 157 }; |
158 #endif | 158 #endif |
159 | 159 |
160 } // namespace WTF | 160 } // namespace WTF |
161 | 161 |
162 using WTF::HashCountedSet; | 162 using WTF::HashCountedSet; |
163 | 163 |
164 #endif // WTF_HashCountedSet_h | 164 #endif // WTF_HashCountedSet_h |
OLD | NEW |