AFF --- A container for numbers (array) by Friederich and Forbriger.
|
A structure to be shared between different SharedHeap instances. More...
#include <sharedheap.h>
Public Member Functions | |
SHeap (const Tsize &size) | |
Allocate memory on heap. More... | |
SHeap (T *pointer, const Tsize &size) | |
Take memory reference from elsewhere. More... | |
~SHeap () | |
Free heap memory. More... | |
Public Attributes | |
T * | Mheap |
shared raw array on heap More... | |
Tsize | Msize |
size (number of elements) of array More... | |
Tsize | Mnref |
number of referencing instances More... | |
bool | Mextern |
true if memory allocation is handled elsewhere More... | |
A structure to be shared between different SharedHeap instances.
This is the core part of represented shared heap. Only objects of this class allocate and delete memory. The SharedHeap representation has holds a pointer to an instance of this struct. The representation is responsible for doing the reference counting by incrementing and decrementing Mnref and to call the destructor of SHeap once the reference count drops to zero. The actual deallocation of the memory block used for the array is, however, done within the destructor of SHeap.
For arrays taken from Fortran code we use a flag Mextern
. If it is true, this indicates that memory should neither be allocated be the constructor nor given free by the destructor.
Definition at line 102 of file sharedheap.h.