libStatGen Software 1
|
Create a vector of DATA_TYPE that reuses created objects to save on memory reallocations. More...
#include <ReusableVector.h>
Public Member Functions | |
void | reset () |
Clear the vector contents. | |
void | clear () |
Clear the vector contents. | |
DATA_TYPE & | getNextEmpty () |
Get a reference to a new entry to be populated so the user can directly populate it rather than having to copy into it. | |
DATA_TYPE & | get (unsigned int index) const |
Get a reference to the data at the specified index. | |
int | size () const |
Return the number of populated entries in the vector. | |
void | rmLast () |
Protected Attributes | |
std::vector< DATA_TYPE * > | myCont |
unsigned int | myNextEmpty |
Create a vector of DATA_TYPE that reuses created objects to save on memory reallocations.
DATA_TYPE must have a function called clear() that is used to reset it for reuse.
Definition at line 30 of file ReusableVector.h.
|
inline |
Definition at line 33 of file ReusableVector.h.
|
virtual |
Definition at line 67 of file ReusableVector.h.
|
inline |
Clear the vector contents.
Definition at line 39 of file ReusableVector.h.
References ReusableVector< DATA_TYPE >::reset().
DATA_TYPE & ReusableVector< DATA_TYPE >::get | ( | unsigned int | index | ) | const |
Get a reference to the data at the specified index.
Throws an exception if the index is out of range.
Definition at line 117 of file ReusableVector.h.
DATA_TYPE & ReusableVector< DATA_TYPE >::getNextEmpty | ( | ) |
Get a reference to a new entry to be populated so the user can directly populate it rather than having to copy into it.
Definition at line 90 of file ReusableVector.h.
void ReusableVector< DATA_TYPE >::reset | ( | ) |
Clear the vector contents.
Definition at line 81 of file ReusableVector.h.
Referenced by ReusableVector< DATA_TYPE >::clear().
void ReusableVector< DATA_TYPE >::rmLast | ( | ) |
Definition at line 135 of file ReusableVector.h.
|
inline |
Return the number of populated entries in the vector.
Definition at line 51 of file ReusableVector.h.
|
protected |
Definition at line 56 of file ReusableVector.h.
|
protected |
Definition at line 57 of file ReusableVector.h.