Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: Source/wtf/HashSet.h

Issue 131803005: Add more oilpan collections support (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix OtherType for Windows compielr Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 private: 62 private:
63 typedef HashTable<ValueType, ValueType, IdentityExtractor, 63 typedef HashTable<ValueType, ValueType, IdentityExtractor,
64 HashFunctions, ValueTraits, ValueTraits, Allocator> HashTableType; 64 HashFunctions, ValueTraits, ValueTraits, Allocator> HashTableType;
65 65
66 public: 66 public:
67 typedef HashTableConstIteratorAdapter<HashTableType, ValueTraits> iterat or; 67 typedef HashTableConstIteratorAdapter<HashTableType, ValueTraits> iterat or;
68 typedef HashTableConstIteratorAdapter<HashTableType, ValueTraits> const_ iterator; 68 typedef HashTableConstIteratorAdapter<HashTableType, ValueTraits> const_ iterator;
69 typedef typename HashTableType::AddResult AddResult; 69 typedef typename HashTableType::AddResult AddResult;
70 70
71 void swap(HashSet& other) 71 void swap(HashSet& ref)
72 { 72 {
73 m_impl.swap(other.m_impl); 73 m_impl.swap(ref.m_impl);
74 }
75
76 void swap(typename Allocator::template OtherType<HashSet>::Type other)
77 {
78 HashSet& ref = Allocator::getOther(other);
79 m_impl.swap(ref.m_impl);
74 } 80 }
75 81
76 unsigned size() const; 82 unsigned size() const;
77 unsigned capacity() const; 83 unsigned capacity() const;
78 bool isEmpty() const; 84 bool isEmpty() const;
79 85
80 iterator begin() const; 86 iterator begin() const;
81 iterator end() const; 87 iterator end() const;
82 88
83 iterator find(ValuePeekInType) const; 89 iterator find(ValuePeekInType) const;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 iterator end = collection.end(); 273 iterator end = collection.end();
268 for (unsigned i = 0; it != end; ++it, ++i) 274 for (unsigned i = 0; it != end; ++it, ++i)
269 vector[i] = *it; 275 vector[i] = *it;
270 } 276 }
271 277
272 } // namespace WTF 278 } // namespace WTF
273 279
274 using WTF::HashSet; 280 using WTF::HashSet;
275 281
276 #endif /* WTF_HashSet_h */ 282 #endif /* WTF_HashSet_h */
OLDNEW
« Source/heap/Heap.h ('K') | « Source/wtf/HashMap.h ('k') | Source/wtf/HashTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698