| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 // Stores a collection of pointers that are deleted when the container is | 11 // Stores a collection of pointers that are deleted when the container is |
| 12 // destructed. | 12 // destructed. |
| 13 | 13 |
| 14 #ifndef WEBRTC_BASE_SCOPEDPTRCOLLECTION_H_ | 14 #ifndef WEBRTC_BASE_SCOPEDPTRCOLLECTION_H_ |
| 15 #define WEBRTC_BASE_SCOPEDPTRCOLLECTION_H_ | 15 #define WEBRTC_BASE_SCOPEDPTRCOLLECTION_H_ |
| 16 | 16 |
| 17 #include <stddef.h> |
| 18 |
| 17 #include <algorithm> | 19 #include <algorithm> |
| 18 #include <vector> | 20 #include <vector> |
| 19 | 21 |
| 20 #include "webrtc/base/basictypes.h" | |
| 21 #include "webrtc/base/constructormagic.h" | 22 #include "webrtc/base/constructormagic.h" |
| 22 | 23 |
| 23 namespace rtc { | 24 namespace rtc { |
| 24 | 25 |
| 25 template<class T> | 26 template<class T> |
| 26 class ScopedPtrCollection { | 27 class ScopedPtrCollection { |
| 27 public: | 28 public: |
| 28 typedef std::vector<T*> VectorT; | 29 typedef std::vector<T*> VectorT; |
| 29 | 30 |
| 30 ScopedPtrCollection() { } | 31 ScopedPtrCollection() { } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 VectorT collection_; | 54 VectorT collection_; |
| 54 | 55 |
| 55 RTC_DISALLOW_COPY_AND_ASSIGN(ScopedPtrCollection); | 56 RTC_DISALLOW_COPY_AND_ASSIGN(ScopedPtrCollection); |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 } // namespace rtc | 59 } // namespace rtc |
| 59 | 60 |
| 60 #endif // WEBRTC_BASE_SCOPEDPTRCOLLECTION_H_ | 61 #endif // WEBRTC_BASE_SCOPEDPTRCOLLECTION_H_ |
| OLD | NEW |