#include <memory_manage.h>
◆ PtrCube() [1/4]
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
◆ PtrCube() [2/4]
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
Create a cube of pointers with dimensions [DIM1, DIM2, DIM3], where each cube cell points to an array of [n_entries]
◆ PtrCube() [3/4]
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
PtrCube< DIM1, DIM2, DIM3, T >::PtrCube |
( |
size_t |
dim_1, |
|
|
size_t |
dim_2, |
|
|
size_t |
dim_3, |
|
|
size_t |
n_entries |
|
) |
| |
|
inline |
Create a cube of pointers with dimensions [DIM1, DIM2, DIM3], where only the cube with dimensions [dim_1, dim_2, dim_3] has cells pointing to an array of [n_entries]. This can use less memory than a fully-allocated cube.
◆ ~PtrCube()
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
◆ PtrCube() [4/4]
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
◆ Alloc()
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
void PtrCube< DIM1, DIM2, DIM3, T >::Alloc |
( |
size_t |
dim_1, |
|
|
size_t |
dim_2, |
|
|
size_t |
dim_3, |
|
|
size_t |
n_entries |
|
) |
| |
|
inline |
Allocate [n_entries] entries per pointer cell.
◆ operator=()
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
◆ operator[]()
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
std::array<std::array<T*, DIM3>, DIM2>& PtrCube< DIM1, DIM2, DIM3, T >::operator[] |
( |
size_t |
row_idx | ) |
|
|
inline |
◆ backing_buf_
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
T* PtrCube< DIM1, DIM2, DIM3, T >::backing_buf_ |
|
private |
The backing buffer for the per-cell arrays. Having a common buffer reduces the number of memory allocations.
◆ cube_
template<size_t DIM1, size_t DIM2, size_t DIM3, class T >
std::array<std::array<std::array<T*, DIM3>, DIM2>, DIM1> PtrCube< DIM1, DIM2, DIM3, T >::cube_ |
|
private |
The documentation for this class was generated from the following file: