| 759 | ImPool() { FreeIdx = AliveCount = 0; } |
| 760 | ~ImPool() { Clear(); } |
| 761 | T* GetByKey(ImGuiID key) { int idx = Map.GetInt(key, -1); return (idx != -1) ? &Buf[idx] : NULL; } |
| 762 | T* GetByIndex(ImPoolIdx n) { return &Buf[n]; } |
| 763 | ImPoolIdx GetIndex(const T* p) const { IM_ASSERT(p >= Buf.Data && p < Buf.Data + Buf.Size); return (ImPoolIdx)(p - Buf.Data); } |
| 764 | T* GetOrAddByKey(ImGuiID key) { int* p_idx = Map.GetIntRef(key, -1); if (*p_idx != -1) return &Buf[*p_idx]; *p_idx = FreeIdx; return Add(); } |
no test coverage detected