MCPcopy Create free account
hub / github.com/RenderKit/embree / GetAliveCount

Method GetAliveCount

tutorials/common/imgui/imgui_internal.h:672–672  ·  view source on GitHub ↗

To iterate a ImPool: for (int n = 0; n < pool.GetMapSize(); n++) if (T* t = pool.TryGetMapData(n)) { ... } Can be avoided if you know .Remove() has never been called on the pool, or AliveCount == GetMapSize()

Source from the content-addressed store, hash-verified

670 // To iterate a ImPool: for (int n = 0; n < pool.GetMapSize(); n++) if (T* t = pool.TryGetMapData(n)) { ... }
671 // Can be avoided if you know .Remove() has never been called on the pool, or AliveCount == GetMapSize()
672 int GetAliveCount() const { return AliveCount; } // Number of active/alive items in the pool (for display purpose)
673 int GetBufSize() const { return Buf.Size; }
674 int GetMapSize() const { return Map.Data.Size; } // It is the map we need iterate to find valid items, since we don't have "alive" storage anywhere
675 T* TryGetMapData(ImPoolIdx n) { int idx = Map.Data[n].val_i; if (idx == -1) return NULL; return GetByIndex(idx); }

Callers 1

ShowMetricsWindowMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected