MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / FixedList

Class FixedList

SampleFramework12/v1.00/Containers.h:138–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136};
137
138template<typename T> class FixedList
139{
140
141protected:
142
143 Array<T> array;
144 uint64 count = 0;
145
146public:
147
148 FixedList()
149 {
150 }
151
152 explicit FixedList(uint64 maxCount, uint64 initialCount = 0)
153 {
154 Init(maxCount, initialCount);
155 }
156
157 FixedList(uint64 maxCount, uint64 initialCount, T fillValue)
158 {
159 Init(maxCount, initialCount, fillValue);
160 }
161
162 void Init(uint64 maxCount, uint64 initialCount = 0)
163 {
164 Assert_(initialCount < maxCount);
165 Assert_(maxCount > 0);
166 array.Init(maxCount);
167 count = initialCount;
168 }
169
170 void Init(uint64 maxCount, uint64 initialCount, T fillValue)
171 {
172 Init(maxCount, initialCount);
173 array.Fill(fillValue);
174 }
175
176 void Shutdown()
177 {
178 array.Shutdown();
179 count = 0;
180 }
181
182 uint64 Count() const
183 {
184 return count;
185 }
186
187 uint64 MaxCount() const
188 {
189 return array.Size();
190 }
191
192 const T& operator[](uint64 idx) const
193 {
194 Assert_(idx < count);
195 return array[idx];

Callers

nothing calls this directly

Calls 1

SizeMethod · 0.45

Tested by

no test coverage detected