Debian Codegraph @

src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtrHashMap.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 *
19 */
20
21 namespace WTFcxx . . $ `<built-in>:467:9`! {
22
23 // This specialization is a direct copy of HashMap, with overloaded functions
24 // to allow for lookup by pointer instead of RefPtr, avoiding ref-count churn.
25
26 // FIXME: Find a better way that doesn't require an entire copy of the HashMap template.
27
28 template<typename RawKeyType, typename ValueType, typename ValueTraits, typename HashFunctions>
29 struct RefPtrHashMapRawKeyTranslatorcxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator# {
30 typedef typename ValueType::first_type KeyTypecxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#KeyType#;
31 typedef typename ValueType::second_type MappedTypecxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#MappedType#;
32 typedef typename ValueTraits::FirstTraits KeyTraitscxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#KeyTraits#;
33 typedef typename ValueTraits::SecondTraits MappedTraitscxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#MappedTraits#;
34
35 static unsigned hashcxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#hash(78ea24164916a3a1).(RawKeyType key) { return HashFunctions::hash(key); }
36 static bool equalcxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#equal(e7e275eac194987a).(const KeyTypecxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#KeyType#& a, RawKeyType b) { return HashFunctions::equal(a, b); }
37 static void translatecxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#translate(b299f4425965b02a).(ValueType& location, RawKeyType key, const MappedTypecxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#MappedType#& mapped)
38 {
39 location.first = key;
40 location.second = mapped;
41 }
42 };
43
44 template<typename T, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg>
45 class RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap# : public FastAllocBasecxx . . $ QTWTF/FastAllocBase# {
46 private:
47 typedef KeyTraitsArg KeyTraitscxx . . $ QTWTF/RefPtrHashMap#KeyTraits#;
48 typedef MappedTraitsArg MappedTraitscxx . . $ QTWTF/RefPtrHashMap#MappedTraits#;
49 typedef PairHashTraitscxx . . $ QTWTF/PairHashTraits#<KeyTraitscxx . . $ QTWTF/RefPtrHashMap#KeyTraits#, MappedTraitscxx . . $ QTWTF/RefPtrHashMap#MappedTraits#> ValueTraitscxx . . $ QTWTF/RefPtrHashMap#ValueTraits#;
50
51 public:
52 typedef typename KeyTraitscxx . . $ QTWTF/RefPtrHashMap#KeyTraits#::TraitType KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#;
53 typedef T* RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#;
54 typedef typename MappedTraitscxx . . $ QTWTF/RefPtrHashMap#MappedTraits#::TraitType MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#;
55 typedef typename ValueTraitscxx . . $ QTWTF/RefPtrHashMap#ValueTraits#::TraitType ValueTypecxx . . $ QTWTF/RefPtrHashMap#ValueType#;
56
57 private:
58 typedef HashArg HashFunctionscxx . . $ QTWTF/RefPtrHashMap#HashFunctions#;
59
60 typedef HashTablecxx . . $ QTWTF/HashTable#<KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#, ValueTypecxx . . $ QTWTF/RefPtrHashMap#ValueType#, PairFirstExtractorcxx . . $ QTWTF/PairFirstExtractor#<ValueTypecxx . . $ QTWTF/RefPtrHashMap#ValueType#>,
61 HashFunctionscxx . . $ QTWTF/RefPtrHashMap#HashFunctions#, ValueTraitscxx . . $ QTWTF/RefPtrHashMap#ValueTraits#, KeyTraitscxx . . $ QTWTF/RefPtrHashMap#KeyTraits#> HashTableTypecxx . . $ QTWTF/RefPtrHashMap#HashTableType#;
62
63 typedef RefPtrHashMapRawKeyTranslatorcxx . . $ QTWTF/RefPtrHashMapRawKeyTranslator#<RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#, ValueTypecxx . . $ QTWTF/RefPtrHashMap#ValueType#, ValueTraitscxx . . $ QTWTF/RefPtrHashMap#ValueTraits#, HashFunctionscxx . . $ QTWTF/RefPtrHashMap#HashFunctions#>
64 RawKeyTranslatorcxx . . $ QTWTF/RefPtrHashMap#RawKeyTranslator#;
65
66 public:
67 typedef HashTableIteratorAdaptercxx . . $ QTWTF/HashTableIteratorAdapter#<HashTableTypecxx . . $ QTWTF/RefPtrHashMap#HashTableType#, ValueTypecxx . . $ QTWTF/RefPtrHashMap#ValueType#> iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#;
68 typedef HashTableConstIteratorAdaptercxx . . $ QTWTF/HashTableConstIteratorAdapter#<HashTableTypecxx . . $ QTWTF/RefPtrHashMap#HashTableType#, ValueTypecxx . . $ QTWTF/RefPtrHashMap#ValueType#> const_iteratorcxx . . $ QTWTF/RefPtrHashMap#const_iterator#;
69
70 void swapcxx . . $ QTWTF/RefPtrHashMap#swap(158e825e099ddac7).(RefPtrHashMap&);
71
72 int sizecxx . . $ QTWTF/RefPtrHashMap#size(455f465bc33b4cdf).() const;
73 int capacitycxx . . $ QTWTF/RefPtrHashMap#capacity(455f465bc33b4cdf).() const;
74 bool isEmptycxx . . $ QTWTF/RefPtrHashMap#isEmpty(50ce9a9e25b4a850).() const;
75
76 // iterators iterate over pairs of keys and values
77 iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# begincxx . . $ QTWTF/RefPtrHashMap#begin(986fe7b85c0f397).();
78 iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# endcxx . . $ QTWTF/RefPtrHashMap#end(986fe7b85c0f397).();
79 const_iteratorcxx . . $ QTWTF/RefPtrHashMap#const_iterator# begincxx . . $ QTWTF/RefPtrHashMap#begin(31f6e9bf5ecd2b43).() const;
80 const_iteratorcxx . . $ QTWTF/RefPtrHashMap#const_iterator# endcxx . . $ QTWTF/RefPtrHashMap#end(31f6e9bf5ecd2b43).() const;
81
82 iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# findcxx . . $ QTWTF/RefPtrHashMap#find(afb70236f806b726).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#&);
83 iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# findcxx . . $ QTWTF/RefPtrHashMap#find(2b9501dd70a5b2b4).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#);
84 const_iteratorcxx . . $ QTWTF/RefPtrHashMap#const_iterator# findcxx . . $ QTWTF/RefPtrHashMap#find(88d33ca431d01c5).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#&) const;
85 const_iteratorcxx . . $ QTWTF/RefPtrHashMap#const_iterator# findcxx . . $ QTWTF/RefPtrHashMap#find(6a52c8ac61a1ac84).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#) const;
86 bool containscxx . . $ QTWTF/RefPtrHashMap#contains(846cf93fb789cd8).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#&) const;
87 bool containscxx . . $ QTWTF/RefPtrHashMap#contains(688a48c7bc3386d6).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#) const;
88 MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType# getcxx . . $ QTWTF/RefPtrHashMap#get(1ae155e6fc1d8797).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#&) const;
89 MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType# getcxx . . $ QTWTF/RefPtrHashMap#get(be1ae7643772b874).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#) const;
90 MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType# inlineGetcxx . . $ QTWTF/RefPtrHashMap#inlineGet(be1ae7643772b874).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#) const;
91
92 // replaces value but not key if key is already present
93 // return value is a pair of the iterator to the key location,
94 // and a boolean that's true if a new value was actually added
95 paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool> setcxx . . $ QTWTF/RefPtrHashMap#set(e61ba716440031a8).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#&, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#&);
96 paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool> setcxx . . $ QTWTF/RefPtrHashMap#set(add45e9762d351bb).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#&);
97
98 // does nothing if key is already present
99 // return value is a pair of the iterator to the key location,
100 // and a boolean that's true if a new value was actually added
101 paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool> addcxx . . $ QTWTF/RefPtrHashMap#add(e61ba716440031a8).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#&, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#&);
102 paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool> addcxx . . $ QTWTF/RefPtrHashMap#add(add45e9762d351bb).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#&);
103
104 void removecxx . . $ QTWTF/RefPtrHashMap#remove(d6e20c4a389f0962).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#&);
105 void removecxx . . $ QTWTF/RefPtrHashMap#remove(ebd0a1552f8ce24f).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#);
106 void removecxx . . $ QTWTF/RefPtrHashMap#remove(863818dc0aad568c).(iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#);
107 void clearcxx . . $ QTWTF/RefPtrHashMap#clear(49f6e7a06ebc5aa8).();
108
109 MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType# takecxx . . $ QTWTF/RefPtrHashMap#take(ed399c1bed1be543).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#&); // efficient combination of get with remove
110 MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType# takecxx . . $ QTWTF/RefPtrHashMap#take(908fa59ce078ccdf).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#); // efficient combination of get with remove
111
112 private:
113 paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool> inlineAddcxx . . $ QTWTF/RefPtrHashMap#inlineAdd(e61ba716440031a8).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#&, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#&);
114 paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool> inlineAddcxx . . $ QTWTF/RefPtrHashMap#inlineAdd(add45e9762d351bb).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#&);
115
116 HashTableTypecxx . . $ QTWTF/RefPtrHashMap#HashTableType# m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl.;
117 };
118 template<typename T, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg>
119 class HashMapcxx . . $ QTWTF/HashMap#<RefPtrcxx . . $ QTWTF/RefPtr#<T>, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> :
120 public RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>
121 {
122 };
123
124 template<typename T, typename U, typename V, typename W, typename X>
125 inline void RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::swapcxx . . $ QTWTF/RefPtrHashMap#swap(158e825e099ddac7).(RefPtrHashMap& other)
126 {
127 m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..swapcxx . . $ QTWTF/HashTable#swap(4c3dc139c52ec836).(other.m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl.);
128 }
129
130 template<typename T, typename U, typename V, typename W, typename X>
131 inline int RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::sizecxx . . $ QTWTF/RefPtrHashMap#size(455f465bc33b4cdf).() const
132 {
133 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..sizecxx . . $ QTWTF/HashTable#size(455f465bc33b4cdf).();
134 }
135
136 template<typename T, typename U, typename V, typename W, typename X>
137 inline int RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::capacitycxx . . $ QTWTF/RefPtrHashMap#capacity(455f465bc33b4cdf).() const
138 {
139 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..capacitycxx . . $ QTWTF/HashTable#capacity(455f465bc33b4cdf).();
140 }
141
142 template<typename T, typename U, typename V, typename W, typename X>
143 inline bool RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::isEmptycxx . . $ QTWTF/RefPtrHashMap#isEmpty(50ce9a9e25b4a850).() const
144 {
145 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..isEmptycxx . . $ QTWTF/HashTable#isEmpty(50ce9a9e25b4a850).();
146 }
147
148 template<typename T, typename U, typename V, typename W, typename X>
149 inline typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::begincxx . . $ QTWTF/RefPtrHashMap#begin(986fe7b85c0f397).()
150 {
151 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..begincxx . . $ QTWTF/HashTable#begin(400fc12dfeddc5c0).();
152 }
153
154 template<typename T, typename U, typename V, typename W, typename X>
155 inline typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::endcxx . . $ QTWTF/RefPtrHashMap#end(986fe7b85c0f397).()
156 {
157 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..endcxx . . $ QTWTF/HashTable#end(400fc12dfeddc5c0).();
158 }
159
160 template<typename T, typename U, typename V, typename W, typename X>
161 inline typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::const_iteratorcxx . . $ QTWTF/RefPtrHashMap#const_iterator# RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::begincxx . . $ QTWTF/RefPtrHashMap#begin(31f6e9bf5ecd2b43).() const
162 {
163 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..begincxx . . $ QTWTF/HashTable#begin(400fc12dfeddc5c0).();
164 }
165
166 template<typename T, typename U, typename V, typename W, typename X>
167 inline typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::const_iteratorcxx . . $ QTWTF/RefPtrHashMap#const_iterator# RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::endcxx . . $ QTWTF/RefPtrHashMap#end(31f6e9bf5ecd2b43).() const
168 {
169 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..endcxx . . $ QTWTF/HashTable#end(400fc12dfeddc5c0).();
170 }
171
172 template<typename T, typename U, typename V, typename W, typename X>
173 inline typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::findcxx . . $ QTWTF/RefPtrHashMap#find(afb70236f806b726).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#& key)
174 {
175 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..findcxx . . $ QTWTF/HashTable#find(82ffd35d6795a744).(key);
176 }
177
178 template<typename T, typename U, typename V, typename W, typename X>
179 inline typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::findcxx . . $ QTWTF/RefPtrHashMap#find(2b9501dd70a5b2b4).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key)
180 {
181 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..template findcxx . . $ QTWTF/HashTable#find(82ffd35d6795a744).<RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#, RawKeyTranslatorcxx . . $ QTWTF/RefPtrHashMap#RawKeyTranslator#>(key);
182 }
183
184 template<typename T, typename U, typename V, typename W, typename X>
185 inline typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::const_iteratorcxx . . $ QTWTF/RefPtrHashMap#const_iterator# RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::findcxx . . $ QTWTF/RefPtrHashMap#find(88d33ca431d01c5).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#& key) const
186 {
187 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..findcxx . . $ QTWTF/HashTable#find(82ffd35d6795a744).(key);
188 }
189
190 template<typename T, typename U, typename V, typename W, typename X>
191 inline typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::const_iteratorcxx . . $ QTWTF/RefPtrHashMap#const_iterator# RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::findcxx . . $ QTWTF/RefPtrHashMap#find(6a52c8ac61a1ac84).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key) const
192 {
193 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..template findcxx . . $ QTWTF/HashTable#find(82ffd35d6795a744).<RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#, RawKeyTranslatorcxx . . $ QTWTF/RefPtrHashMap#RawKeyTranslator#>(key);
194 }
195
196 template<typename T, typename U, typename V, typename W, typename X>
197 inline bool RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::containscxx . . $ QTWTF/RefPtrHashMap#contains(846cf93fb789cd8).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#& key) const
198 {
199 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..containscxx . . $ QTWTF/HashTable#contains(8877ebe272b9620d).(key);
200 }
201
202 template<typename T, typename U, typename V, typename W, typename X>
203 inline bool RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::containscxx . . $ QTWTF/RefPtrHashMap#contains(688a48c7bc3386d6).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key) const
204 {
205 return m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..template containscxx . . $ QTWTF/HashTable#contains(8877ebe272b9620d).<RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#, RawKeyTranslatorcxx . . $ QTWTF/RefPtrHashMap#RawKeyTranslator#>(key);
206 }
207
208 template<typename T, typename U, typename V, typename W, typename X>
209 inline paircxx . . $ QTWTF/pair#<typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool>
210 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::inlineAddcxx . . $ QTWTF/RefPtrHashMap#inlineAdd(e61ba716440031a8).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#& key, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#& mapped)
211 {
212 typedef HashMapTranslatorcxx . . $ QTWTF/HashMapTranslator#<ValueTypecxx . . $ QTWTF/RefPtrHashMap#ValueType#, ValueTraitscxx . . $ QTWTF/RefPtrHashMap#ValueTraits#, HashFunctionscxx . . $ QTWTF/RefPtrHashMap#HashFunctions#> TranslatorTypecxx . . $ QTWTF/RefPtrHashMap#inlineAdd(e61ba716440031a8).TranslatorType#;
213 paircxx . . $ QTWTF/pair#<typename HashTableTypecxx . . $ QTWTF/RefPtrHashMap#HashTableType#::iterator, bool> p = m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..template addcxx . . $ QTWTF/HashTable#add(b8ed51a42316103f).<KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#, MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#, TranslatorTypecxx . . $ QTWTF/RefPtrHashMap#inlineAdd(e61ba716440031a8).TranslatorType#>(key, mapped);
214 // typename RefPtrHashMap<T, U, V, W, X>::iterator temp = p.first;
215 return stdcxx . . $ std/::paircxx . . $ std/pair#<typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool>(
216 typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#(p.firstcxx . . $ std/pair#first.), p.secondcxx . . $ std/pair#second.);
217
218 // return m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
219 }
220
221 template<typename T, typename U, typename V, typename W, typename X>
222 inline paircxx . . $ QTWTF/pair#<typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool>
223 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::inlineAddcxx . . $ QTWTF/RefPtrHashMap#inlineAdd(add45e9762d351bb).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#& mapped)
224 {
225 paircxx . . $ QTWTF/pair#<typename HashTableTypecxx . . $ QTWTF/RefPtrHashMap#HashTableType#::iterator, bool> p = m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..template addcxx . . $ QTWTF/HashTable#add(b8ed51a42316103f).<RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#, MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#, RawKeyTranslatorcxx . . $ QTWTF/RefPtrHashMap#RawKeyTranslator#>(key, mapped);
226 return stdcxx . . $ std/::paircxx . . $ std/pair#<typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool>(
227 typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#(p.firstcxx . . $ std/pair#first.), p.secondcxx . . $ std/pair#second.);
228
229 // return m_impl.template add<RawKeyType, MappedType, RawKeyTranslator>(key, mapped);
230 }
231
232 template<typename T, typename U, typename V, typename W, typename X>
233 paircxx . . $ QTWTF/pair#<typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool>
234 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::setcxx . . $ QTWTF/RefPtrHashMap#set(e61ba716440031a8).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#& key, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#& mapped)
235 {
236 paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool> result = inlineAddcxx . . $ QTWTF/RefPtrHashMap#inlineAdd(e61ba716440031a8).(key, mapped);
237 if (!result.secondcxx . . $ std/pair#second.) {
238 // add call above didn't change anything, so set the mapped value
239 result.firstcxx . . $ std/pair#first.->second = mapped;
240 }
241 return result;
242 }
243
244 template<typename T, typename U, typename V, typename W, typename X>
245 paircxx . . $ QTWTF/pair#<typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool>
246 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::setcxx . . $ QTWTF/RefPtrHashMap#set(add45e9762d351bb).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#& mapped)
247 {
248 paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool> result = inlineAddcxx . . $ QTWTF/RefPtrHashMap#inlineAdd(e61ba716440031a8).(key, mapped);
249 if (!result.secondcxx . . $ std/pair#second.) {
250 // add call above didn't change anything, so set the mapped value
251 result.firstcxx . . $ std/pair#first.->second = mapped;
252 }
253 return result;
254 }
255
256 template<typename T, typename U, typename V, typename W, typename X>
257 paircxx . . $ QTWTF/pair#<typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool>
258 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::addcxx . . $ QTWTF/RefPtrHashMap#add(e61ba716440031a8).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#& key, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#& mapped)
259 {
260 return inlineAddcxx . . $ QTWTF/RefPtrHashMap#inlineAdd(e61ba716440031a8).(key, mapped);
261 }
262
263 template<typename T, typename U, typename V, typename W, typename X>
264 paircxx . . $ QTWTF/pair#<typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator#, bool>
265 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::addcxx . . $ QTWTF/RefPtrHashMap#add(add45e9762d351bb).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key, const MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#& mapped)
266 {
267 return inlineAddcxx . . $ QTWTF/RefPtrHashMap#inlineAdd(e61ba716440031a8).(key, mapped);
268 }
269
270 template<typename T, typename U, typename V, typename W, typename MappedTraits>
271 typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#
272 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::getcxx . . $ QTWTF/RefPtrHashMap#get(1ae155e6fc1d8797).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#& key) const
273 {
274 ValueTypecxx . . $ QTWTF/RefPtrHashMap#ValueType#* entry = const_cast<HashTableTypecxx . . $ QTWTF/RefPtrHashMap#HashTableType#&>(m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl.).lookupcxx . . $ QTWTF/HashTable#lookup(b8803fc2f699eb8b).(key);
275 if (!entry)
276 return MappedTraitscxx . . $ QTWTF/RefPtrHashMap#MappedTraits#::emptyValue();
277 return entry->second;
278 }
279
280 template<typename T, typename U, typename V, typename W, typename MappedTraits>
281 typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#
282 inline RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::inlineGetcxx . . $ QTWTF/RefPtrHashMap#inlineGet(be1ae7643772b874).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key) const
283 {
284 ValueTypecxx . . $ QTWTF/RefPtrHashMap#ValueType#* entry = const_cast<HashTableTypecxx . . $ QTWTF/RefPtrHashMap#HashTableType#&>(m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl.).template lookupcxx . . $ QTWTF/HashTable#lookup(b8803fc2f699eb8b).<RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType#, RawKeyTranslatorcxx . . $ QTWTF/RefPtrHashMap#RawKeyTranslator#>(key);
285 if (!entry)
286 return MappedTraitscxx . . $ QTWTF/RefPtrHashMap#MappedTraits#::emptyValue();
287 return entry->second;
288 }
289
290 template<typename T, typename U, typename V, typename W, typename MappedTraits>
291 typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#
292 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::getcxx . . $ QTWTF/RefPtrHashMap#get(be1ae7643772b874).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key) const
293 {
294 return inlineGetcxx . . $ QTWTF/RefPtrHashMap#inlineGet(be1ae7643772b874).(key);
295 }
296
297 template<typename T, typename U, typename V, typename W, typename X>
298 inline void RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::removecxx . . $ QTWTF/RefPtrHashMap#remove(863818dc0aad568c).(iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# it)
299 {
300 if (it.m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl. ==cxx . . $ QTWTF/`operator==`(69feba05d53a7241). m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..endcxx . . $ QTWTF/HashTable#end(400fc12dfeddc5c0).())
301 return;
302 m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..checkTableConsistencycxx . . $ QTWTF/HashTable#checkTableConsistency(49f6e7a06ebc5aa8).();
303 m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..removeWithoutEntryConsistencyCheckcxx . . $ QTWTF/HashTable#removeWithoutEntryConsistencyCheck(90fee5ddac1206fd).(it.m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl.);
304 }
305
306 template<typename T, typename U, typename V, typename W, typename X>
307 inline void RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::removecxx . . $ QTWTF/RefPtrHashMap#remove(d6e20c4a389f0962).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#& key)
308 {
309 removecxx . . $ QTWTF/RefPtrHashMap#remove(863818dc0aad568c).(findcxx . . $ QTWTF/RefPtrHashMap#find(6a52c8ac61a1ac84).(key));
310 }
311
312 template<typename T, typename U, typename V, typename W, typename X>
313 inline void RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::removecxx . . $ QTWTF/RefPtrHashMap#remove(ebd0a1552f8ce24f).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key)
314 {
315 removecxx . . $ QTWTF/RefPtrHashMap#remove(863818dc0aad568c).(findcxx . . $ QTWTF/RefPtrHashMap#find(6a52c8ac61a1ac84).(key));
316 }
317
318 template<typename T, typename U, typename V, typename W, typename X>
319 inline void RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, X>::clearcxx . . $ QTWTF/RefPtrHashMap#clear(49f6e7a06ebc5aa8).()
320 {
321 m_implcxx . . $ QTWTF/RefPtrHashMap#m_impl..clearcxx . . $ QTWTF/HashTable#clear(49f6e7a06ebc5aa8).();
322 }
323
324 template<typename T, typename U, typename V, typename W, typename MappedTraits>
325 typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#
326 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::takecxx . . $ QTWTF/RefPtrHashMap#take(ed399c1bed1be543).(const KeyTypecxx . . $ QTWTF/RefPtrHashMap#KeyType#& key)
327 {
328 // This can probably be made more efficient to avoid ref/deref churn.
329 iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# it = findcxx . . $ QTWTF/RefPtrHashMap#find(6a52c8ac61a1ac84).(key);
330 if (it ==cxx . . $ QTWTF/`operator==`(69feba05d53a7241). endcxx . . $ QTWTF/RefPtrHashMap#end(986fe7b85c0f397).())
331 return MappedTraitscxx . . $ QTWTF/RefPtrHashMap#MappedTraits#::emptyValue();
332 typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType# result = it->second;
333 removecxx . . $ QTWTF/RefPtrHashMap#remove(863818dc0aad568c).(it);
334 return result;
335 }
336
337 template<typename T, typename U, typename V, typename W, typename MappedTraits>
338 typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType#
339 RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::takecxx . . $ QTWTF/RefPtrHashMap#take(908fa59ce078ccdf).(RawKeyTypecxx . . $ QTWTF/RefPtrHashMap#RawKeyType# key)
340 {
341 // This can probably be made more efficient to avoid ref/deref churn.
342 iteratorcxx . . $ QTWTF/RefPtrHashMap#iterator# it = findcxx . . $ QTWTF/RefPtrHashMap#find(6a52c8ac61a1ac84).(key);
343 if (it ==cxx . . $ QTWTF/`operator==`(69feba05d53a7241). endcxx . . $ QTWTF/RefPtrHashMap#end(986fe7b85c0f397).())
344 return MappedTraitscxx . . $ QTWTF/RefPtrHashMap#MappedTraits#::emptyValue();
345 typename RefPtrHashMapcxx . . $ QTWTF/RefPtrHashMap#<T, U, V, W, MappedTraits>::MappedTypecxx . . $ QTWTF/RefPtrHashMap#MappedType# result = it->second;
346 removecxx . . $ QTWTF/RefPtrHashMap#remove(863818dc0aad568c).(it);
347 return result;
348 }
349
350 } // namespace WTF