AFF --- A container for numbers (array) by Friederich and Forbriger.

◆ SHeap() [1/2]

template<typename T >
aff::util::SHeap< T >::SHeap ( const Tsize size)
inline

Allocate memory on heap.

create counted reference object

Definition at line 79 of file sharedheap_def.h.

References aff::util::SHeap< T >::Mheap, and aff::util::SHeap< T >::Msize.

80  : Mheap(0), Msize(size), Mnref(1), Mextern(false)
81  {
82  if (size>0) {
83  try { Mheap=new T[size]; }
84  catch (std::bad_alloc) {
85  throw AllocException(size, sizeof(T));
86  }
87  } else {
88  Msize=0;
89  }
90  }
bool Mextern
true if memory allocation is handled elsewhere
Definition: sharedheap.h:115
Tsize Msize
size (number of elements) of array
Definition: sharedheap.h:113
T * Mheap
shared raw array on heap
Definition: sharedheap.h:112
Tsize Mnref
number of referencing instances
Definition: sharedheap.h:114