OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> | 3 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 typedef typename LinkedHashSetType::Traits Traits; | 373 typedef typename LinkedHashSetType::Traits Traits; |
374 | 374 |
375 typedef const typename LinkedHashSetType::Value& ReferenceType; | 375 typedef const typename LinkedHashSetType::Value& ReferenceType; |
376 typedef const typename LinkedHashSetType::Value* PointerType; | 376 typedef const typename LinkedHashSetType::Value* PointerType; |
377 | 377 |
378 const Node* node() const { return static_cast<const Node*>(m_position); } | 378 const Node* node() const { return static_cast<const Node*>(m_position); } |
379 | 379 |
380 protected: | 380 protected: |
381 LinkedHashSetConstIterator(const LinkedHashSetNodeBase* position, const Link
edHashSetType* container) | 381 LinkedHashSetConstIterator(const LinkedHashSetNodeBase* position, const Link
edHashSetType* container) |
382 : m_position(position) | 382 : m_position(position) |
383 #if ASSERT_ENABLED | 383 #if ENABLE(ASSERT) |
384 , m_container(container) | 384 , m_container(container) |
385 , m_containerModifications(container->modifications()) | 385 , m_containerModifications(container->modifications()) |
386 #endif | 386 #endif |
387 { | 387 { |
388 } | 388 } |
389 | 389 |
390 public: | 390 public: |
391 PointerType get() const | 391 PointerType get() const |
392 { | 392 { |
393 checkModifications(); | 393 checkModifications(); |
(...skipping 25 matching lines...) Expand all Loading... |
419 { | 419 { |
420 return m_position == other.m_position; | 420 return m_position == other.m_position; |
421 } | 421 } |
422 bool operator!=(const LinkedHashSetConstIterator& other) const | 422 bool operator!=(const LinkedHashSetConstIterator& other) const |
423 { | 423 { |
424 return m_position != other.m_position; | 424 return m_position != other.m_position; |
425 } | 425 } |
426 | 426 |
427 private: | 427 private: |
428 const LinkedHashSetNodeBase* m_position; | 428 const LinkedHashSetNodeBase* m_position; |
429 #if ASSERT_ENABLED | 429 #if ENABLE(ASSERT) |
430 void checkModifications() const { m_container->checkModifications(m_containe
rModifications); } | 430 void checkModifications() const { m_container->checkModifications(m_containe
rModifications); } |
431 const LinkedHashSetType* m_container; | 431 const LinkedHashSetType* m_container; |
432 int64_t m_containerModifications; | 432 int64_t m_containerModifications; |
433 #else | 433 #else |
434 void checkModifications() const { } | 434 void checkModifications() const { } |
435 #endif | 435 #endif |
436 template<typename T, typename U, typename V, typename W> friend class Linked
HashSet; | 436 template<typename T, typename U, typename V, typename W> friend class Linked
HashSet; |
437 friend class LinkedHashSetIterator<LinkedHashSetType>; | 437 friend class LinkedHashSetIterator<LinkedHashSetType>; |
438 }; | 438 }; |
439 | 439 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 struct NeedsTracing<LinkedHashSet<T, U, V> > { | 707 struct NeedsTracing<LinkedHashSet<T, U, V> > { |
708 static const bool value = false; | 708 static const bool value = false; |
709 }; | 709 }; |
710 #endif | 710 #endif |
711 | 711 |
712 } | 712 } |
713 | 713 |
714 using WTF::LinkedHashSet; | 714 using WTF::LinkedHashSet; |
715 | 715 |
716 #endif /* WTF_LinkedHashSet_h */ | 716 #endif /* WTF_LinkedHashSet_h */ |
OLD | NEW |