#include <avir.h>
Public Member Functions | |
CStructArray (const CStructArray &Source) | |
T & | add () |
void | clear () |
int | getItemCount () const |
CStructArray & | operator= (const CStructArray &Source) |
T & | operator[] (const int Index) |
const T & | operator[] (const int Index) const |
void | setItemCount (const int NewCount) |
Array of structured objects.
Implements allocation of a linear array of objects of class T (which are initialized), addressable via operator[]. Each object is created via the "operator new". New object insertions are quick since implementation uses prior space allocation (capacity), thus not requiring frequent memory block reallocations.
T | Array element's type. |
T& avir::CStructArray< T >::add | ( | ) |
Function creates a new object of type T with the default constructor and adds this object to the array.
void avir::CStructArray< T >::clear | ( | ) |
Function erases all items of *this array.
int avir::CStructArray< T >::getItemCount | ( | ) | const |
void avir::CStructArray< T >::setItemCount | ( | const int | NewCount | ) |
Function changes number of allocated items. New items are created with the default constructor. If NewCount is below the current item count, items that are above NewCount range will be destructed.
NewCount | New requested item count. |