Loading...
Searching...
No Matches
classarray.h
Go to the documentation of this file.
44 * Class ClassArray provides safe arrays of general C++ objects (in contrast to data objects). The elements of an
45 * instance of ClassArray can be accessed just like ordinary C++ array elements by means of the index
49 * - checking of array bounds when accessing elements with the indexing operator[]() when compiled without \c -DNDEBUG
51 * Moreover, #ClassArray%s may easily be extended by #insert%ing or #append%ing elements to the ClassArray or shrunken
52 * by \ref remove() "removing" elements. Method reSize(int n) resets the ClassArray%s length to \p n thereby possibly
55 * A ClassArray may be used as arguments for standard C functions requiring pointers through the use of get_ptr() and
58 * Internally, a ClassArray object allocates a block of memory that fits up to max() elements, only size() of them are
72 /** When a ClassArray is reSize()%d to more than max() elements, the new value for max() is not just set to the new
73 * size but rather to \p memFactor * \p size. This makes #reSize%ing perform better in codes where a ClassArray is
223 /** Resizing a ClassArray to less than the previous size, involves discarding its last elements. Resizing to a larger
224 * value involves adding uninitialized elements (similar to append()). If neccessary, also memory will be
240 /** Even though the ClassArray currently holds no more than size() elements, up to max() elements could be added
249 /** The value of max() is reset to \p newMax thereby setting size() to \p newSize. However, if \p newSize has a value
250 * \c < \c 0 (as the default argument does) size() remains unchanged and max() is set to MIN(size(), newMax). Hence,
251 * calling reMax() without the default arguments, will reduce the memory consumption to a minimum. In no instance
254 * @return reMax returns the difference in bytes of the new and the old memory block, which can be used to update
363 /** The constructor allocates a ClassArray containing \p size uninitialized elements. The internal array is allocated
void insert(int i, const ClassArray< T > &t) Inserts all elements from t before i 'th element. Definition classarray.h:176 void insert(int i, int n) Inserts n uninitialized elements before i 'th element. Definition classarray.h:141 ptrdiff_t reMax(int newMax=1, int newSize=-1) Resets maximum number of elements. Definition classarray.h:257 ClassArray(int p_size=0, int p_max=0, double p_fac=1.2) Default constructor. Definition classarray.h:370 void insert(int i, int n, const T t[]) Inserts n elements from t before i 'the element. Definition classarray.h:164 Everything should be within this namespace. Memory allocation routines. Debugging, floating point type and parameter definitions.
|