MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / Clear

Method Clear

KBotExt/imgui/imgui_internal.h:663–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661 T* GetOrAddByKey(ImGuiID key) { int* p_idx = Map.GetIntRef(key, -1); if (*p_idx != -1) return &Buf[*p_idx]; *p_idx = FreeIdx; return Add(); }
662 bool Contains(const T* p) const { return (p >= Buf.Data && p < Buf.Data + Buf.Size); }
663 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; }
664 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]; }
665 void Remove(ImGuiID key, const T* p) { Remove(key, GetIndex(p)); }
666 void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(int*)&Buf[idx] = FreeIdx; FreeIdx = idx; Map.SetInt(key, -1); AliveCount--; }

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected