MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / Add

Method Add

extern/imgui/imgui_internal.h:679–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677 bool Contains(const T* p) const { return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
678 void Clear() { for (int n = 0; n < Map.Data.Size; n++) { int idx = Map.Data[n].val_i; if (idx != -1) Buf[idx].~T(); } Map.Clear(); Buf.clear(); FreeIdx = AliveCount = 0; }
679 T* Add() { int idx = FreeIdx; if (idx == Buf.Size) { Buf.resize(Buf.Size + 1); FreeIdx++; } else { FreeIdx = *(int*)&Buf[idx]; } IM_PLACEMENT_NEW(&Buf[idx]) T(); AliveCount++; return &Buf[idx]; }
680 void Remove(ImGuiID key, const T* p) { Remove(key, GetIndex(p)); }
681 void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); AliveCount--; }
682 void Reserve(int capacity) { Buf.reserve(capacity); Map.Data.reserve(capacity); }

Callers 6

CalcListClippingMethod · 0.80
NewFrameMethod · 0.80

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected