|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Stable, heap-resident handle to a Pool's current base address and identity. More...
#include <EBGeometry_Pool.hpp>
Public Attributes | |
| void * | m_base = nullptr |
| Current base address of the owning pool's block. Rewritten whenever a Pool::reserve grows the block. | |
| uint64_t | m_id = 0 |
| Identity of the owning pool; see Pool::id. Never zero for a live pool. | |
| uint64_t | m_rootId = 0 |
| Identity of the root of the owning pool's mirror chain: its own identity for a pool that is not a mirror, else the identity of the pool the chain started from. See Pool::rootId. | |
Stable, heap-resident handle to a Pool's current base address and identity.
A pool-resident object (e.g. EBGeometry::DCEL::MeshT) must be able to re-read its pool's base on every access, because Pool::reserve may grow the block and move it. Pointing such an object at the Pool itself would work until the pool is moved – pools are move-only but movable (Pool::mirror returns by value), and a Pool* would be left naming a relocated, possibly destroyed object. The control block solves this: it is heap-allocated, uniquely owned by the pool, and its address never changes for the lifetime of the pool, however many times the pool itself is moved.