template struct ImPool

Overview

#include <imgui_internal.h>

template <typename T>
struct ImPool
{
    // fields

    ImVector<T> Buf;
    ImGuiStorage Map;
    ImPoolIdx FreeIdx;
    ImPoolIdx AliveCount;

    // methods

    T* GetByKey(ImGuiID key);
    T* GetByIndex(ImPoolIdx n);
    ImPoolIdx GetIndex(const T* p) const;
    T* GetOrAddByKey(ImGuiID key);
    bool Contains(const T* p) const;
    void Clear();
    T* Add();

    void Remove(
        ImGuiID key,
        const T* p
        );

    void Remove(
        ImGuiID key,
        ImPoolIdx idx
        );

    void Reserve(int capacity);
    int GetAliveCount() const;
    int GetBufSize() const;
    int GetMapSize() const;
    T* TryGetMapData(ImPoolIdx n);
};