GeoTessCPP
2.1
Software to facilitate storage and retrieval of 3D information about the Earth.
|
#include <ArrayReuse.h>
Public Member Functions | |
ArrayReuse () | |
ArrayReuse (int alngth, int acnt) | |
ArrayReuse (int alngth, int iacnt, int acnt) | |
ArrayReuse (int alngth, int iacnt, int acnt, int rsrvstr, int rsrvrefstr) | |
virtual | ~ArrayReuse () |
int | getAllocatedArrays () const |
T * | getArray () |
int | getArrayLength () const |
int | getUnusedArrayCount () const |
int | getUsedArrayCount () const |
void | initialize (int alngth, int acnt) |
void | initialize (int alngth, int iacnt, int acnt) |
void | initialize (int alngth, int iacnt, int acnt, int rsrvstr, int rsrvrefstr) |
void | reset () |
void | resetIfRequired () |
void | reuseArray (T *a) |
An array reuse object for cases where arrays of some fixed type and size are required by the application over and over but it is desirable to avoid the constant allocation, and subsequent deletion, of many small arrays.
|
inline |
Default constructor. Made private to prevent it from being used.
|
inline |
Standard constructor where alngth is the size of the arrays to be provided to requesting clients, iacnt is the initial number of arrays to create for used by clients, and acnt is the subsequent array count allocation used when getArray() is called but no more arrays are available.
alngth | The size of the arrays to be provided to requesting clients. |
acnt | The subsequent array count allocation used when getArray() is called but no more arrays are available |
|
inline |
Standard constructor where alngth is the size of the arrays to be provided to requesting clients, iacnt is the initial number of arrays to create for used by clients, and acnt is the subsequent array count allocation used when getArray() is called but no more arrays are available.
alngth | The size of the arrays to be provided to requesting clients. |
iacnt | The initial number of arrays to create for use by clients. |
acnt | The subsequent array count allocation used when getArray() is called but no more arrays are available |
|
inline |
Standard constructor where alngth is the size of the arrays to be provided to requesting clients, iacnt is the initial number of arrays to create for used by clients, and acnt is the subsequent array count allocation used when getArray() is called but no more arrays are available, rsrvstr is the capacity of the permanent store (store), and rsrvrefstr is the capacity of the reuseable reference store (refStore).
alngth | The size of the arrays to be provided to requesting clients. |
iacnt | The initial number of arrays to create for use by clients. |
acnt | The subsequent array count allocation used when getArray() is called but no more arrays are available |
rsrvstr | The capacity of the permanent store (store). |
rsrvrefstr | The capacity of the reuseable reference store (refStore). |
|
inlinevirtual |
Destructor.
|
inline |
Returns the total number of allocated arrays (each of arrayLength).
|
inline |
Returns a new array of size arrayLength for use by requesting clients. This function will create more arrays if necessary.
|
inline |
Returns the array length setting.
|
inline |
Returns the current number of unused allocated arrays.
|
inline |
Returns the number of arrays currently in use by clients.
|
inline |
Initializes sizes where alngth is the size of the arrays to be provided to requesting clients, iacnt is the initial number of arrays to create for used by clients, and acnt is the subsequent array count allocation used when getArray() is called but no more arrays are available, rsrvstr is the capacity of the permanent store (store), and rsrvrefstr is the capacity of the reuseable reference store (refStore).
alngth | The size of the arrays to be provided to requesting clients. |
acnt | The subsequent array count allocation used when getArray() is called but no more arrays are available |
|
inline |
Initializes sizes where alngth is the size of the arrays to be provided to requesting clients, iacnt is the initial number of arrays to create for used by clients, and acnt is the subsequent array count allocation used when getArray() is called but no more arrays are available, rsrvstr is the capacity of the permanent store (store), and rsrvrefstr is the capacity of the reuseable reference store (refStore).
alngth | The size of the arrays to be provided to requesting clients. |
iacnt | The initial number of arrays to create for use by clients. |
acnt | The subsequent array count allocation used when getArray() is called but no more arrays are available |
|
inline |
Initializes sizes where alngth is the size of the arrays to be provided to requesting clients, iacnt is the initial number of arrays to create for used by clients, and acnt is the subsequent array count allocation used when getArray() is called but no more arrays are available, rsrvstr is the capacity of the permanent store (store), and rsrvrefstr is the capacity of the reuseable reference store (refStore).
alngth | The size of the arrays to be provided to requesting clients. |
iacnt | The initial number of arrays to create for use by clients. |
acnt | The subsequent array count allocation used when getArray() is called but no more arrays are available |
rsrvstr | The capacity of the permanent store (store). |
rsrvrefstr | The capacity of the reuseable reference store (refStore). |
|
inline |
Resets refStore to all allocated references in store. NOTE: if a client is still using a reference after this reset() is called the possibility exists that it will be given out as a new request from function getArray(). Only call this function when you know all entries are no longer in use or needed by the requesting clients.
|
inline |
Calls reset if the size of refStore is not equal to the total number of allocated arrays (allocArrays).
|
inline |
Returns an array that was being used by a client back into the reuse pool.
a | the array that is to be returned to the reuse pool |