MCPcopy Create free account
hub / github.com/Norbyte/ositools / Array

Class Array

OsiInterface/DivBaseTypes.h:267–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265
266 template <class T>
267 struct Array
268 {
269 void * VMT{ nullptr };
270 T * Buf{ nullptr };
271 uint32_t Capacity{ 0 };
272 uint32_t Size{ 0 };
273 uint32_t Unkn[2]{ 0 };
274
275 void Clear()
276 {
277 Size = 0;
278 }
279
280 bool SafeAdd(T const & val)
281 {
282 if (Size < Capacity) {
283 Buf[Size++] = val;
284 return true;
285 } else {
286 return false;
287 }
288 }
289
290 void Remove(uint32_t index)
291 {
292 for (auto i = index + 1; i < Size; i++) {
293 Buf[index] = Buf[index + 1];
294 }
295
296 Size--;
297 }
298 };
299
300 struct ObjectHandle
301 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected