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

Method GetByKey

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

Source from the content-addressed store, hash-verified

671 ImPool() { FreeIdx = AliveCount = 0; }
672 ~ImPool() { Clear(); }
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(); }

Callers 2

TableFindByIDMethod · 0.80

Calls 1

GetIntMethod · 0.80

Tested by

no test coverage detected