OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> | 4 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return makeConstReverseIterator(m_tail); | 162 return makeConstReverseIterator(m_tail); |
163 } | 163 } |
164 const_reverse_iterator rend() const { return makeConstReverseIterator(0); } | 164 const_reverse_iterator rend() const { return makeConstReverseIterator(0); } |
165 | 165 |
166 ValueType& front(); | 166 ValueType& front(); |
167 const ValueType& front() const; | 167 const ValueType& front() const; |
168 void removeFirst(); | 168 void removeFirst(); |
169 | 169 |
170 ValueType& back(); | 170 ValueType& back(); |
171 const ValueType& back() const; | 171 const ValueType& back() const; |
172 void removeLast(); | 172 void pop_back(); |
173 | 173 |
174 iterator find(ValuePeekInType); | 174 iterator find(ValuePeekInType); |
175 const_iterator find(ValuePeekInType) const; | 175 const_iterator find(ValuePeekInType) const; |
176 bool contains(ValuePeekInType) const; | 176 bool contains(ValuePeekInType) const; |
177 | 177 |
178 // An alternate version of find() that finds the object by hashing and | 178 // An alternate version of find() that finds the object by hashing and |
179 // comparing with some other type, to avoid the cost of type conversion. | 179 // comparing with some other type, to avoid the cost of type conversion. |
180 // The HashTranslator interface is defined in HashSet. | 180 // The HashTranslator interface is defined in HashSet. |
181 template <typename HashTranslator, typename T> | 181 template <typename HashTranslator, typename T> |
182 iterator find(const T&); | 182 iterator find(const T&); |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 return m_tail->m_value; | 833 return m_tail->m_value; |
834 } | 834 } |
835 | 835 |
836 template <typename T, size_t inlineCapacity, typename U, typename V> | 836 template <typename T, size_t inlineCapacity, typename U, typename V> |
837 inline const T& ListHashSet<T, inlineCapacity, U, V>::back() const { | 837 inline const T& ListHashSet<T, inlineCapacity, U, V>::back() const { |
838 DCHECK(!isEmpty()); | 838 DCHECK(!isEmpty()); |
839 return m_tail->m_value; | 839 return m_tail->m_value; |
840 } | 840 } |
841 | 841 |
842 template <typename T, size_t inlineCapacity, typename U, typename V> | 842 template <typename T, size_t inlineCapacity, typename U, typename V> |
843 inline void ListHashSet<T, inlineCapacity, U, V>::removeLast() { | 843 inline void ListHashSet<T, inlineCapacity, U, V>::pop_back() { |
844 DCHECK(!isEmpty()); | 844 DCHECK(!isEmpty()); |
845 m_impl.remove(m_tail); | 845 m_impl.remove(m_tail); |
846 unlinkAndDelete(m_tail); | 846 unlinkAndDelete(m_tail); |
847 } | 847 } |
848 | 848 |
849 template <typename T, size_t inlineCapacity, typename U, typename V> | 849 template <typename T, size_t inlineCapacity, typename U, typename V> |
850 inline typename ListHashSet<T, inlineCapacity, U, V>::iterator | 850 inline typename ListHashSet<T, inlineCapacity, U, V>::iterator |
851 ListHashSet<T, inlineCapacity, U, V>::find(ValuePeekInType value) { | 851 ListHashSet<T, inlineCapacity, U, V>::find(ValuePeekInType value) { |
852 ImplTypeIterator it = m_impl.template find<BaseTranslator>(value); | 852 ImplTypeIterator it = m_impl.template find<BaseTranslator>(value); |
853 if (it == m_impl.end()) | 853 if (it == m_impl.end()) |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 // through the HashTable. That includes m_head and m_tail so we do not have | 1126 // through the HashTable. That includes m_head and m_tail so we do not have |
1127 // to explicitly trace them here. | 1127 // to explicitly trace them here. |
1128 m_impl.trace(visitor); | 1128 m_impl.trace(visitor); |
1129 } | 1129 } |
1130 | 1130 |
1131 } // namespace WTF | 1131 } // namespace WTF |
1132 | 1132 |
1133 using WTF::ListHashSet; | 1133 using WTF::ListHashSet; |
1134 | 1134 |
1135 #endif // WTF_ListHashSet_h | 1135 #endif // WTF_ListHashSet_h |
OLD | NEW |