| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_SCOPED_PTR_DEQUE_H_ | 5 #ifndef CC_BASE_SCOPED_PTR_DEQUE_H_ |
| 6 #define CC_SCOPED_PTR_DEQUE_H_ | 6 #define CC_BASE_SCOPED_PTR_DEQUE_H_ |
| 7 | 7 |
| 8 #include <deque> |
| 8 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 12 #include <deque> | |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 | 15 |
| 16 // This type acts like a deque<scoped_ptr> based on top of std::deque. The | 16 // This type acts like a deque<scoped_ptr> based on top of std::deque. The |
| 17 // ScopedPtrDeque has ownership of all elements in the deque. | 17 // ScopedPtrDeque has ownership of all elements in the deque. |
| 18 template <typename T> | 18 template <typename T> |
| 19 class ScopedPtrDeque { | 19 class ScopedPtrDeque { |
| 20 public: | 20 public: |
| 21 typedef typename std::deque<T*>::const_iterator const_iterator; | 21 typedef typename std::deque<T*>::const_iterator const_iterator; |
| 22 typedef typename std::deque<T*>::reverse_iterator reverse_iterator; | 22 typedef typename std::deque<T*>::reverse_iterator reverse_iterator; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 const_reverse_iterator rend() const { return data_.rend(); } | 125 const_reverse_iterator rend() const { return data_.rend(); } |
| 126 | 126 |
| 127 private: | 127 private: |
| 128 std::deque<T*> data_; | 128 std::deque<T*> data_; |
| 129 | 129 |
| 130 DISALLOW_COPY_AND_ASSIGN(ScopedPtrDeque); | 130 DISALLOW_COPY_AND_ASSIGN(ScopedPtrDeque); |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 } // namespace cc | 133 } // namespace cc |
| 134 | 134 |
| 135 #endif // CC_SCOPED_PTR_DEQUE_H_ | 135 #endif // CC_BASE_SCOPED_PTR_DEQUE_H_ |
| OLD | NEW |