MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / GetIndex

Method GetIndex

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

Source from the content-addressed store, hash-verified

673 T* GetByKey(ImGuiID key) { int idx = Map.GetInt(key, -1); return (idx != -1) ? &Buf[idx] : NULL; }
674 T* GetByIndex(ImPoolIdx n) { return &Buf[n]; }
675 ImPoolIdx GetIndex(const T* p) const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size); return (ImPoolIdx)(p - Buf.Data); }
676 T* GetOrAddByKey(ImGuiID key) { int* p_idx = Map.GetIntRef(key, -1); if (*p_idx != -1) return &Buf[*p_idx]; *p_idx = FreeIdx; return Add(); }
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; }

Callers 5

BeginTableExMethod · 0.80
EndTableMethod · 0.80
TableRemoveMethod · 0.80
GetTabBarRefFromTabBarFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected