GeoTessCPP
2.6.1
Software to facilitate storage and retrieval of 3D information about the Earth.
|
An array reuse object for cases where arrays of some fixed type and size are required by the application over and over. More...
#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 () |
T * | getArray () |
void | reuseArray (T *a) |
void | reset () |
void | resetIfRequired () |
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) |
int | getAllocatedArrays () const |
int | getUsedArrayCount () const |
int | getUnusedArrayCount () const |
int | getArrayLength () const |
An array reuse object for cases where arrays of some fixed type and size are required by the application over and over.
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.
Definition at line 70 of file ArrayReuse.h.
|
inline |
Default constructor. Made private to prevent it from being used.
Definition at line 146 of file ArrayReuse.h.
|
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 |
Definition at line 164 of file ArrayReuse.h.
|
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 |
Definition at line 183 of file ArrayReuse.h.
|
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). |
Definition at line 208 of file ArrayReuse.h.
|
inlinevirtual |
Destructor.
Definition at line 215 of file ArrayReuse.h.
|
inline |
Returns the total number of allocated arrays (each of arrayLength).
Definition at line 351 of file ArrayReuse.h.
|
inline |
Returns a new array of size arrayLength for use by requesting clients. This function will create more arrays if necessary.
Definition at line 224 of file ArrayReuse.h.
|
inline |
Returns the array length setting.
Definition at line 375 of file ArrayReuse.h.
|
inline |
Returns the current number of unused allocated arrays.
Definition at line 367 of file ArrayReuse.h.
|
inline |
Returns the number of arrays currently in use by clients.
Definition at line 359 of file ArrayReuse.h.
|
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 |
Definition at line 285 of file ArrayReuse.h.
|
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 |
Definition at line 306 of file ArrayReuse.h.
|
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). |
Definition at line 331 of file ArrayReuse.h.
|
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.
Definition at line 249 of file ArrayReuse.h.
|
inline |
Calls reset if the size of refStore is not equal to the total number of allocated arrays (allocArrays).
Definition at line 265 of file ArrayReuse.h.
|
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 |
Definition at line 238 of file ArrayReuse.h.