/src/CMake/Source/cmLinkedTree.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #pragma once |
4 | | |
5 | | #include "cmConfigure.h" // IWYU pragma: keep |
6 | | |
7 | | #include <cassert> |
8 | | #include <vector> |
9 | | |
10 | | /** |
11 | | @brief A adaptor for traversing a tree structure in a vector |
12 | | |
13 | | This class is not intended to be wholly generic like a standard library |
14 | | container adaptor. Mostly it exists to facilitate code sharing for the |
15 | | needs of the cmState. For example, the Truncate() method is a specific |
16 | | requirement of the cmState. |
17 | | |
18 | | An empty cmLinkedTree provides a Root() method, and an Push() method, |
19 | | each of which return iterators. A Tree can be built up by extending |
20 | | from the root, and then extending from any other iterator. |
21 | | |
22 | | An iterator resulting from this tree construction can be |
23 | | forward-only-iterated toward the root. Extending the tree never |
24 | | invalidates existing iterators. |
25 | | */ |
26 | | template <typename T> |
27 | | class cmLinkedTree |
28 | | { |
29 | | using PositionType = typename std::vector<T>::size_type; |
30 | | using PointerType = T*; |
31 | | using ReferenceType = T&; |
32 | | |
33 | | public: |
34 | | class iterator |
35 | | { |
36 | | friend class cmLinkedTree; |
37 | | cmLinkedTree* Tree; |
38 | | |
39 | | // The Position is always 'one past the end'. |
40 | | PositionType Position; |
41 | | |
42 | | iterator(cmLinkedTree* tree, PositionType pos) |
43 | 611 | : Tree(tree) |
44 | 611 | , Position(pos) |
45 | 611 | { |
46 | 611 | } cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator::iterator(cmLinkedTree<cmStateDetail::SnapshotDataType>*, unsigned long) Line | Count | Source | 43 | 215 | : Tree(tree) | 44 | 215 | , Position(pos) | 45 | 215 | { | 46 | 215 | } |
cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator::iterator(cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >*, unsigned long) Line | Count | Source | 43 | 72 | : Tree(tree) | 44 | 72 | , Position(pos) | 45 | 72 | { | 46 | 72 | } |
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator::iterator(cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>*, unsigned long) Line | Count | Source | 43 | 71 | : Tree(tree) | 44 | 71 | , Position(pos) | 45 | 71 | { | 46 | 71 | } |
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator::iterator(cmLinkedTree<cmStateDetail::PolicyStackEntry>*, unsigned long) Line | Count | Source | 43 | 109 | : Tree(tree) | 44 | 109 | , Position(pos) | 45 | 109 | { | 46 | 109 | } |
cmLinkedTree<cmDefinitions>::iterator::iterator(cmLinkedTree<cmDefinitions>*, unsigned long) Line | Count | Source | 43 | 144 | : Tree(tree) | 44 | 144 | , Position(pos) | 45 | 144 | { | 46 | 144 | } |
|
47 | | |
48 | | public: |
49 | | iterator() |
50 | 421 | : Tree(nullptr) |
51 | 421 | , Position(0) |
52 | 421 | { |
53 | 421 | } cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator::iterator() Line | Count | Source | 50 | 141 | : Tree(nullptr) | 51 | 141 | , Position(0) | 52 | 141 | { | 53 | 141 | } |
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator::iterator() Line | Count | Source | 50 | 105 | : Tree(nullptr) | 51 | 105 | , Position(0) | 52 | 105 | { | 53 | 105 | } |
cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator::iterator() Line | Count | Source | 50 | 35 | : Tree(nullptr) | 51 | 35 | , Position(0) | 52 | 35 | { | 53 | 35 | } |
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator::iterator() Line | Count | Source | 50 | 35 | : Tree(nullptr) | 51 | 35 | , Position(0) | 52 | 35 | { | 53 | 35 | } |
cmLinkedTree<cmDefinitions>::iterator::iterator() Line | Count | Source | 50 | 105 | : Tree(nullptr) | 51 | 105 | , Position(0) | 52 | 105 | { | 53 | 105 | } |
|
54 | | |
55 | | void operator++() |
56 | 3 | { |
57 | 3 | assert(this->Tree); |
58 | 3 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); |
59 | 3 | assert(this->Position <= this->Tree->Data.size()); |
60 | 3 | assert(this->Position > 0); |
61 | 3 | this->Position = this->Tree->UpPositions[this->Position - 1]; |
62 | 3 | } cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator::operator++() Line | Count | Source | 56 | 1 | { | 57 | 1 | assert(this->Tree); | 58 | 1 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 59 | 1 | assert(this->Position <= this->Tree->Data.size()); | 60 | | assert(this->Position > 0); | 61 | 1 | this->Position = this->Tree->UpPositions[this->Position - 1]; | 62 | 1 | } |
cmLinkedTree<cmDefinitions>::iterator::operator++() Line | Count | Source | 56 | 2 | { | 57 | 2 | assert(this->Tree); | 58 | 2 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 59 | 2 | assert(this->Position <= this->Tree->Data.size()); | 60 | | assert(this->Position > 0); | 61 | 2 | this->Position = this->Tree->UpPositions[this->Position - 1]; | 62 | 2 | } |
Unexecuted instantiation: cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator::operator++() Unexecuted instantiation: cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator::operator++() |
63 | | |
64 | | PointerType operator->() const |
65 | 19 | { |
66 | 19 | assert(this->Tree); |
67 | 19 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); |
68 | 19 | assert(this->Position <= this->Tree->Data.size()); |
69 | 19 | assert(this->Position > 0); |
70 | 19 | return this->Tree->GetPointer(this->Position - 1); |
71 | 19 | } cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator::operator->() const Line | Count | Source | 65 | 18 | { | 66 | 18 | assert(this->Tree); | 67 | 18 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 68 | 18 | assert(this->Position <= this->Tree->Data.size()); | 69 | | assert(this->Position > 0); | 70 | 18 | return this->Tree->GetPointer(this->Position - 1); | 71 | 18 | } |
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator::operator->() const Line | Count | Source | 65 | 1 | { | 66 | 1 | assert(this->Tree); | 67 | 1 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 68 | 1 | assert(this->Position <= this->Tree->Data.size()); | 69 | | assert(this->Position > 0); | 70 | 1 | return this->Tree->GetPointer(this->Position - 1); | 71 | 1 | } |
|
72 | | |
73 | | PointerType operator->() |
74 | 930 | { |
75 | 930 | assert(this->Tree); |
76 | 930 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); |
77 | 930 | assert(this->Position <= this->Tree->Data.size()); |
78 | 930 | assert(this->Position > 0); |
79 | 930 | return this->Tree->GetPointer(this->Position - 1); |
80 | 930 | } cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator::operator->() Line | Count | Source | 74 | 50 | { | 75 | 50 | assert(this->Tree); | 76 | 50 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 77 | 50 | assert(this->Position <= this->Tree->Data.size()); | 78 | | assert(this->Position > 0); | 79 | 50 | return this->Tree->GetPointer(this->Position - 1); | 80 | 50 | } |
cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator::operator->() Line | Count | Source | 74 | 766 | { | 75 | 766 | assert(this->Tree); | 76 | 766 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 77 | 766 | assert(this->Position <= this->Tree->Data.size()); | 78 | | assert(this->Position > 0); | 79 | 766 | return this->Tree->GetPointer(this->Position - 1); | 80 | 766 | } |
cmLinkedTree<cmDefinitions>::iterator::operator->() Line | Count | Source | 74 | 114 | { | 75 | 114 | assert(this->Tree); | 76 | 114 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 77 | 114 | assert(this->Position <= this->Tree->Data.size()); | 78 | | assert(this->Position > 0); | 79 | 114 | return this->Tree->GetPointer(this->Position - 1); | 80 | 114 | } |
Unexecuted instantiation: cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator::operator->() |
81 | | |
82 | | ReferenceType operator*() const |
83 | 2 | { |
84 | 2 | assert(this->Tree); |
85 | 2 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); |
86 | 2 | assert(this->Position <= this->Tree->Data.size()); |
87 | 2 | assert(this->Position > 0); |
88 | 2 | return this->Tree->GetReference(this->Position - 1); |
89 | 2 | } |
90 | | |
91 | | ReferenceType operator*() |
92 | 1 | { |
93 | 1 | assert(this->Tree); |
94 | 1 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); |
95 | 1 | assert(this->Position <= this->Tree->Data.size()); |
96 | 1 | assert(this->Position > 0); |
97 | 1 | return this->Tree->GetReference(this->Position - 1); |
98 | 1 | } cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator::operator*() Line | Count | Source | 92 | 1 | { | 93 | 1 | assert(this->Tree); | 94 | 1 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 95 | 1 | assert(this->Position <= this->Tree->Data.size()); | 96 | | assert(this->Position > 0); | 97 | 1 | return this->Tree->GetReference(this->Position - 1); | 98 | 1 | } |
Unexecuted instantiation: cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator::operator*() Unexecuted instantiation: cmLinkedTree<cmDefinitions>::iterator::operator*() |
99 | | |
100 | | bool operator==(iterator other) const |
101 | 75 | { |
102 | 75 | assert(this->Tree); |
103 | 75 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); |
104 | 75 | assert(this->Tree == other.Tree); |
105 | 75 | return this->Position == other.Position; |
106 | 75 | } cmLinkedTree<cmDefinitions>::iterator::operator==(cmLinkedTree<cmDefinitions>::iterator) const Line | Count | Source | 101 | 2 | { | 102 | 2 | assert(this->Tree); | 103 | 2 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 104 | | assert(this->Tree == other.Tree); | 105 | 2 | return this->Position == other.Position; | 106 | 2 | } |
Unexecuted instantiation: cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator::operator==(cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator) const cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator::operator==(cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator) const Line | Count | Source | 101 | 72 | { | 102 | 72 | assert(this->Tree); | 103 | 72 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 104 | | assert(this->Tree == other.Tree); | 105 | 72 | return this->Position == other.Position; | 106 | 72 | } |
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator::operator==(cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator) const Line | Count | Source | 101 | 1 | { | 102 | 1 | assert(this->Tree); | 103 | 1 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 104 | | assert(this->Tree == other.Tree); | 105 | 1 | return this->Position == other.Position; | 106 | 1 | } |
|
107 | | |
108 | | bool operator!=(iterator other) const |
109 | 73 | { |
110 | 73 | assert(this->Tree); |
111 | 73 | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); |
112 | 73 | return !(*this == other); |
113 | 73 | } Unexecuted instantiation: cmLinkedTree<cmDefinitions>::iterator::operator!=(cmLinkedTree<cmDefinitions>::iterator) const Unexecuted instantiation: cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator::operator!=(cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator) const cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator::operator!=(cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator) const Line | Count | Source | 109 | 72 | { | 110 | 72 | assert(this->Tree); | 111 | | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 112 | 72 | return !(*this == other); | 113 | 72 | } |
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator::operator!=(cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator) const Line | Count | Source | 109 | 1 | { | 110 | 1 | assert(this->Tree); | 111 | | assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); | 112 | 1 | return !(*this == other); | 113 | 1 | } |
|
114 | | |
115 | | bool IsValid() const |
116 | 72 | { |
117 | 72 | if (!this->Tree) { |
118 | 0 | return false; |
119 | 0 | } |
120 | 72 | return this->Position <= this->Tree->Data.size(); |
121 | 72 | } |
122 | | |
123 | | bool StrictWeakOrdered(iterator other) const |
124 | 0 | { |
125 | 0 | assert(this->Tree); |
126 | 0 | assert(this->Tree == other.Tree); |
127 | 0 | return this->Position < other.Position; |
128 | 0 | } |
129 | | }; |
130 | | |
131 | | iterator Root() const |
132 | 463 | { |
133 | 463 | return iterator(const_cast<cmLinkedTree*>(this), 0); |
134 | 463 | } cmLinkedTree<cmStateDetail::PolicyStackEntry>::Root() const Line | Count | Source | 132 | 108 | { | 133 | 108 | return iterator(const_cast<cmLinkedTree*>(this), 0); | 134 | 108 | } |
cmLinkedTree<cmDefinitions>::Root() const Line | Count | Source | 132 | 108 | { | 133 | 108 | return iterator(const_cast<cmLinkedTree*>(this), 0); | 134 | 108 | } |
cmLinkedTree<cmStateDetail::SnapshotDataType>::Root() const Line | Count | Source | 132 | 177 | { | 133 | 177 | return iterator(const_cast<cmLinkedTree*>(this), 0); | 134 | 177 | } |
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::Root() const Line | Count | Source | 132 | 35 | { | 133 | 35 | return iterator(const_cast<cmLinkedTree*>(this), 0); | 134 | 35 | } |
cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Root() const Line | Count | Source | 132 | 35 | { | 133 | 35 | return iterator(const_cast<cmLinkedTree*>(this), 0); | 134 | 35 | } |
|
135 | | |
136 | 141 | iterator Push(iterator it) { return this->Push_impl(it, T()); }cmLinkedTree<cmDefinitions>::Push(cmLinkedTree<cmDefinitions>::iterator) Line | Count | Source | 136 | 36 | iterator Push(iterator it) { return this->Push_impl(it, T()); } |
cmLinkedTree<cmStateDetail::SnapshotDataType>::Push(cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator) Line | Count | Source | 136 | 35 | iterator Push(iterator it) { return this->Push_impl(it, T()); } |
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::Push(cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator) Line | Count | Source | 136 | 35 | iterator Push(iterator it) { return this->Push_impl(it, T()); } |
cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Push(cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator) Line | Count | Source | 136 | 35 | iterator Push(iterator it) { return this->Push_impl(it, T()); } |
|
137 | | |
138 | 4 | iterator Push(iterator it, T t) { return this->Push_impl(it, std::move(t)); }cmLinkedTree<cmStateDetail::SnapshotDataType>::Push(cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator, cmStateDetail::SnapshotDataType) Line | Count | Source | 138 | 2 | iterator Push(iterator it, T t) { return this->Push_impl(it, std::move(t)); } |
cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Push(cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) Line | Count | Source | 138 | 1 | iterator Push(iterator it, T t) { return this->Push_impl(it, std::move(t)); } |
cmLinkedTree<cmStateDetail::PolicyStackEntry>::Push(cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator, cmStateDetail::PolicyStackEntry) Line | Count | Source | 138 | 1 | iterator Push(iterator it, T t) { return this->Push_impl(it, std::move(t)); } |
|
139 | | |
140 | 0 | bool IsLast(iterator it) { return it.Position == this->Data.size(); }Unexecuted instantiation: cmLinkedTree<cmStateDetail::SnapshotDataType>::IsLast(cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator) Unexecuted instantiation: cmLinkedTree<cmDefinitions>::IsLast(cmLinkedTree<cmDefinitions>::iterator) Unexecuted instantiation: cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::IsLast(cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator) Unexecuted instantiation: cmLinkedTree<cmStateDetail::PolicyStackEntry>::IsLast(cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator) |
141 | | |
142 | | iterator Pop(iterator it) |
143 | 0 | { |
144 | 0 | assert(!this->Data.empty()); |
145 | 0 | assert(this->UpPositions.size() == this->Data.size()); |
146 | 0 | bool const isLast = this->IsLast(it); |
147 | 0 | ++it; |
148 | | // If this is the last entry then no other entry can refer |
149 | | // to it so we can drop its storage. |
150 | 0 | if (isLast) { |
151 | 0 | this->Data.pop_back(); |
152 | 0 | this->UpPositions.pop_back(); |
153 | 0 | } |
154 | 0 | return it; |
155 | 0 | } Unexecuted instantiation: cmLinkedTree<cmDefinitions>::Pop(cmLinkedTree<cmDefinitions>::iterator) Unexecuted instantiation: cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Pop(cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator) Unexecuted instantiation: cmLinkedTree<cmStateDetail::SnapshotDataType>::Pop(cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator) Unexecuted instantiation: cmLinkedTree<cmStateDetail::PolicyStackEntry>::Pop(cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator) |
156 | | |
157 | | iterator Truncate() |
158 | 3 | { |
159 | 3 | assert(!this->UpPositions.empty()); |
160 | 3 | this->UpPositions.erase(this->UpPositions.begin() + 1, |
161 | 3 | this->UpPositions.end()); |
162 | 3 | assert(!this->Data.empty()); |
163 | 3 | this->Data.erase(this->Data.begin() + 1, this->Data.end()); |
164 | 3 | return iterator(this, 1); |
165 | 3 | } cmLinkedTree<cmStateDetail::SnapshotDataType>::Truncate() Line | Count | Source | 158 | 1 | { | 159 | 1 | assert(!this->UpPositions.empty()); | 160 | 1 | this->UpPositions.erase(this->UpPositions.begin() + 1, | 161 | 1 | this->UpPositions.end()); | 162 | | assert(!this->Data.empty()); | 163 | 1 | this->Data.erase(this->Data.begin() + 1, this->Data.end()); | 164 | 1 | return iterator(this, 1); | 165 | 1 | } |
cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Truncate() Line | Count | Source | 158 | 1 | { | 159 | 1 | assert(!this->UpPositions.empty()); | 160 | 1 | this->UpPositions.erase(this->UpPositions.begin() + 1, | 161 | 1 | this->UpPositions.end()); | 162 | | assert(!this->Data.empty()); | 163 | 1 | this->Data.erase(this->Data.begin() + 1, this->Data.end()); | 164 | 1 | return iterator(this, 1); | 165 | 1 | } |
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::Truncate() Line | Count | Source | 158 | 1 | { | 159 | 1 | assert(!this->UpPositions.empty()); | 160 | 1 | this->UpPositions.erase(this->UpPositions.begin() + 1, | 161 | 1 | this->UpPositions.end()); | 162 | | assert(!this->Data.empty()); | 163 | 1 | this->Data.erase(this->Data.begin() + 1, this->Data.end()); | 164 | 1 | return iterator(this, 1); | 165 | 1 | } |
|
166 | | |
167 | | void Clear() |
168 | 2 | { |
169 | 2 | this->UpPositions.clear(); |
170 | 2 | this->Data.clear(); |
171 | 2 | } cmLinkedTree<cmStateDetail::PolicyStackEntry>::Clear() Line | Count | Source | 168 | 1 | { | 169 | 1 | this->UpPositions.clear(); | 170 | 1 | this->Data.clear(); | 171 | 1 | } |
cmLinkedTree<cmDefinitions>::Clear() Line | Count | Source | 168 | 1 | { | 169 | 1 | this->UpPositions.clear(); | 170 | 1 | this->Data.clear(); | 171 | 1 | } |
|
172 | | |
173 | | private: |
174 | 3 | T& GetReference(PositionType pos) { return this->Data[pos]; }cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::GetReference(unsigned long) Line | Count | Source | 174 | 1 | T& GetReference(PositionType pos) { return this->Data[pos]; } |
cmLinkedTree<cmStateDetail::SnapshotDataType>::GetReference(unsigned long) Line | Count | Source | 174 | 2 | T& GetReference(PositionType pos) { return this->Data[pos]; } |
Unexecuted instantiation: cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::GetReference(unsigned long) Unexecuted instantiation: cmLinkedTree<cmDefinitions>::GetReference(unsigned long) |
175 | | |
176 | 949 | T* GetPointer(PositionType pos) { return &this->Data[pos]; }cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::GetPointer(unsigned long) Line | Count | Source | 176 | 51 | T* GetPointer(PositionType pos) { return &this->Data[pos]; } |
cmLinkedTree<cmStateDetail::SnapshotDataType>::GetPointer(unsigned long) Line | Count | Source | 176 | 784 | T* GetPointer(PositionType pos) { return &this->Data[pos]; } |
cmLinkedTree<cmDefinitions>::GetPointer(unsigned long) Line | Count | Source | 176 | 114 | T* GetPointer(PositionType pos) { return &this->Data[pos]; } |
Unexecuted instantiation: cmLinkedTree<cmStateDetail::PolicyStackEntry>::GetPointer(unsigned long) |
177 | | |
178 | | iterator Push_impl(iterator it, T&& t) |
179 | 145 | { |
180 | 145 | assert(this->UpPositions.size() == this->Data.size()); |
181 | | assert(it.Position <= this->UpPositions.size()); |
182 | 145 | this->UpPositions.push_back(it.Position); |
183 | 145 | this->Data.push_back(std::move(t)); |
184 | 145 | return iterator(this, this->UpPositions.size()); |
185 | 145 | } cmLinkedTree<cmDefinitions>::Push_impl(cmLinkedTree<cmDefinitions>::iterator, cmDefinitions&&) Line | Count | Source | 179 | 36 | { | 180 | 36 | assert(this->UpPositions.size() == this->Data.size()); | 181 | | assert(it.Position <= this->UpPositions.size()); | 182 | 36 | this->UpPositions.push_back(it.Position); | 183 | 36 | this->Data.push_back(std::move(t)); | 184 | 36 | return iterator(this, this->UpPositions.size()); | 185 | 36 | } |
cmLinkedTree<cmStateDetail::SnapshotDataType>::Push_impl(cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator, cmStateDetail::SnapshotDataType&&) Line | Count | Source | 179 | 37 | { | 180 | 37 | assert(this->UpPositions.size() == this->Data.size()); | 181 | | assert(it.Position <= this->UpPositions.size()); | 182 | 37 | this->UpPositions.push_back(it.Position); | 183 | 37 | this->Data.push_back(std::move(t)); | 184 | 37 | return iterator(this, this->UpPositions.size()); | 185 | 37 | } |
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::Push_impl(cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator, cmStateDetail::BuildsystemDirectoryStateType&&) Line | Count | Source | 179 | 35 | { | 180 | 35 | assert(this->UpPositions.size() == this->Data.size()); | 181 | | assert(it.Position <= this->UpPositions.size()); | 182 | 35 | this->UpPositions.push_back(it.Position); | 183 | 35 | this->Data.push_back(std::move(t)); | 184 | 35 | return iterator(this, this->UpPositions.size()); | 185 | 35 | } |
cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Push_impl(cmLinkedTree<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::iterator, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) Line | Count | Source | 179 | 36 | { | 180 | 36 | assert(this->UpPositions.size() == this->Data.size()); | 181 | | assert(it.Position <= this->UpPositions.size()); | 182 | 36 | this->UpPositions.push_back(it.Position); | 183 | 36 | this->Data.push_back(std::move(t)); | 184 | 36 | return iterator(this, this->UpPositions.size()); | 185 | 36 | } |
cmLinkedTree<cmStateDetail::PolicyStackEntry>::Push_impl(cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator, cmStateDetail::PolicyStackEntry&&) Line | Count | Source | 179 | 1 | { | 180 | 1 | assert(this->UpPositions.size() == this->Data.size()); | 181 | | assert(it.Position <= this->UpPositions.size()); | 182 | 1 | this->UpPositions.push_back(it.Position); | 183 | 1 | this->Data.push_back(std::move(t)); | 184 | 1 | return iterator(this, this->UpPositions.size()); | 185 | 1 | } |
|
186 | | |
187 | | std::vector<T> Data; |
188 | | std::vector<PositionType> UpPositions; |
189 | | }; |