|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Placement-independent descriptor of a POD array inside a Pool. More...
#include <EBGeometry_PODVector.hpp>

Public Member Functions | |
| void | reserveFrom (Pool &a_pool, uint32_t a_capacity) |
Reserve a_capacity slots from a_pool, aligned to alignof(T). | |
| T * | data (void *a_base) const noexcept |
Mutable pointer to element 0 against a_base. | |
| const T * | data (const void *a_base) const noexcept |
Const pointer to element 0 against a_base. | |
| T & | at (void *a_base, uint32_t a_i) const noexcept |
Mutable element access against a_base. | |
| const T & | at (const void *a_base, uint32_t a_i) const noexcept |
Const element access against a_base. | |
| uint32_t | size () const noexcept |
| Number of constructed elements. | |
| uint64_t | endByte () const noexcept |
| One past the last byte this array occupies, measured from the pool base. | |
| bool | empty () const noexcept |
| Whether the array is empty. | |
| void | push_back (void *a_base, const T &a_value) |
| Append one element into the pre-reserved capacity. | |
| void | assign (void *a_base, const T *a_src, uint32_t a_count) |
| Bulk-fill the array from a contiguous host source. | |
| PODSpan< T > | bind (void *a_base) const noexcept |
| Bind a mutable raw-pointer view for a hot loop. | |
| PODSpan< const T > | bind (const void *a_base) const noexcept |
| Bind a const raw-pointer view for a hot loop. | |
Public Attributes | |
| uint64_t | m_offset = 0 |
| Byte offset of element 0 from Pool::base. | |
| uint32_t | m_size = 0 |
| Number of constructed elements. | |
| uint32_t | m_capacity = 0 |
| Reserved element slots (fixed after reserveFrom; never reallocates). | |
Placement-independent descriptor of a POD array inside a Pool.
Stores a byte offset (not a pointer) plus element size and capacity, so the same value resolves against any pool base – the key to zero-patch host-to-device mirroring. Trivially copyable and exactly 16 bytes.
| T | Element type (must be trivially copyable, since it is device-visible storage). |
|
inline |
Bulk-fill the array from a contiguous host source.
Copies a_count elements and sets m_size to a_count. A host build-phase operation (the finalize path).
| [in] | a_base | Base address of the pool holding this array. |
| [in] | a_src | Source array of at least a_count elements. |
| [in] | a_count | Number of elements to copy (must be <= m_capacity; aborts otherwise, in every build). |
|
inlinenoexcept |
Const element access against a_base.
| [in] | a_base | Base address of the pool holding this array. |
| [in] | a_i | Element index (must be < m_size). |
a_i.
|
inlinenoexcept |
Mutable element access against a_base.
| [in] | a_base | Base address of the pool holding this array. |
| [in] | a_i | Element index (must be < m_size). |
a_i.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Const pointer to element 0 against a_base.
| [in] | a_base | Base address of the pool holding this array. |
|
inlinenoexcept |
Mutable pointer to element 0 against a_base.
| [in] | a_base | Base address of the pool holding this array. |
|
inlinenoexcept |
Whether the array is empty.
m_size == 0.
|
inlinenoexcept |
One past the last byte this array occupies, measured from the pool base.
Deliberately computed from m_capacity rather than m_size: it bounds the reserved region, which is what a mirrored block must be large enough to contain. Used to check that an array actually fits inside a pool it is being rebased onto (see EBGeometry::DCEL::MeshT::rebasedView), which catches the realistic mistake of mirroring a pool before the last Pool::reserve.
m_offset + m_capacity * sizeof(T).
|
inline |
Append one element into the pre-reserved capacity.
No reallocation ever: appending past capacity is an invariant violation. A host build-phase operation.
| [in] | a_base | Base address of the pool holding this array. |
| [in] | a_value | Value to append. |
|
inline |
Reserve a_capacity slots from a_pool, aligned to alignof(T).
Sets m_offset and m_capacity and resets m_size to zero. A host build-phase operation.
| [in,out] | a_pool | Pool to reserve from (must not be frozen). |
| [in] | a_capacity | Number of element slots to reserve. |
|
inlinenoexcept |
Number of constructed elements.
m_size.