| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 TOOLS_GN_DEPS_ITERATOR_H_ | 5 #ifndef TOOLS_GN_DEPS_ITERATOR_H_ |
| 6 #define TOOLS_GN_DEPS_ITERATOR_H_ | 6 #define TOOLS_GN_DEPS_ITERATOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 |
| 8 #include "tools/gn/label_ptr.h" | 10 #include "tools/gn/label_ptr.h" |
| 9 | 11 |
| 10 class Target; | 12 class Target; |
| 11 | 13 |
| 12 // Provides an iterator for iterating over multiple LabelTargetVectors to | 14 // Provides an iterator for iterating over multiple LabelTargetVectors to |
| 13 // make it convenient to iterate over all deps of a target. | 15 // make it convenient to iterate over all deps of a target. |
| 14 // | 16 // |
| 15 // This works by maintaining a simple stack of vectors (since we have a fixed | 17 // This works by maintaining a simple stack of vectors (since we have a fixed |
| 16 // number of deps types). When the stack is empty, we've reached the end. This | 18 // number of deps types). When the stack is empty, we've reached the end. This |
| 17 // means that the default-constructed iterator == end() for any sequence. | 19 // means that the default-constructed iterator == end() for any sequence. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 65 |
| 64 const DepsIterator& begin() const { return begin_; } | 66 const DepsIterator& begin() const { return begin_; } |
| 65 const DepsIterator& end() const { return end_; } | 67 const DepsIterator& end() const { return end_; } |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 DepsIterator begin_; | 70 DepsIterator begin_; |
| 69 DepsIterator end_; | 71 DepsIterator end_; |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 #endif // TOOLS_GN_DEPS_ITERATOR_H_ | 74 #endif // TOOLS_GN_DEPS_ITERATOR_H_ |
| OLD | NEW |