arrT< T, storageManager > Class Template Reference
[Array classes]
#include <arr.h>
List of all members.
Detailed Description
template<typename T, typename storageManager>
class arrT< T, storageManager >
One-dimensional array type, with selectable storage management.
Definition at line 177 of file arr.h.
Constructor & Destructor Documentation
template<typename T, typename storageManager>
arrT< T, storageManager >::arrT |
( |
|
) |
[inline] |
Creates a zero-sized array.
Definition at line 188 of file arr.h.
template<typename T, typename storageManager>
Creates an array with sz entries.
Definition at line 190 of file arr.h.
template<typename T, typename storageManager>
arrT< T, storageManager >::arrT |
( |
tsize |
sz, |
|
|
const T & |
inival | |
|
) |
| | [inline] |
Creates an array with sz entries, and initializes them with inival.
Definition at line 193 of file arr.h.
template<typename T, typename storageManager>
Creates an array with sz entries, which uses the memory pointed to by ptr.
- Note:
- ptr will not be deallocated by the destructor.
- Warning:
- Only use this if you REALLY know what you are doing. In particular, this is only safely usable if
-
T is a POD type
-
ptr survives during the lifetime of the array object
-
ptr is not subject to garbage collection
Other restrictions may apply. You have been warned.
Definition at line 206 of file arr.h.
template<typename T, typename storageManager>
arrT< T, storageManager >::arrT |
( |
const arrT< T, storageManager > & |
orig |
) |
[inline] |
Creates an array which is a copy of orig. The data in orig is duplicated.
Definition at line 209 of file arr.h.
template<typename T, typename storageManager>
arrT< T, storageManager >::~arrT |
( |
|
) |
[inline] |
Frees the memory allocated by the object.
Definition at line 212 of file arr.h.
Member Function Documentation
template<typename T, typename storageManager>
void arrT< T, storageManager >::alloc |
( |
tsize |
sz |
) |
[inline] |
Allocates space for sz elements. The content of the array is undefined on exit. sz can be 0. If sz is the same as the current size, no reallocation is performed.
Definition at line 217 of file arr.h.
template<typename T, typename storageManager>
void arrT< T, storageManager >::allocAndFill |
( |
tsize |
sz, |
|
|
const T & |
inival | |
|
) |
| | [inline] |
Allocates space for sz elements. If sz is the same as the current size, no reallocation is performed. All elements are set to inival.
Definition at line 228 of file arr.h.
template<typename T, typename storageManager>
void arrT< T, storageManager >::dealloc |
( |
|
) |
[inline] |
Deallocates the memory held by the array, and sets the array size to 0.
Definition at line 232 of file arr.h.
template<typename T, typename storageManager>
void arrT< T, storageManager >::resize |
( |
tsize |
sz |
) |
[inline] |
Resizes the array to hold sz elements. The existing content of the array is copied over to the new array to the extent possible. sz can be 0. If sz is the same as the current size, no reallocation is performed.
Definition at line 237 of file arr.h.
template<typename T, typename storageManager>
arrT& arrT< T, storageManager >::operator= |
( |
const arrT< T, storageManager > & |
orig |
) |
[inline] |
Changes the array to be a copy of orig.
Definition at line 251 of file arr.h.
template<typename T, typename storageManager>
template<typename T2>
void arrT< T, storageManager >::copyFrom |
( |
const std::vector< T2 > & |
orig |
) |
[inline] |
Changes the array to be a copy of the std::vector orig.
Definition at line 260 of file arr.h.
template<typename T, typename storageManager>
template<typename T2>
void arrT< T, storageManager >::copyTo |
( |
std::vector< T2 > & |
vec |
) |
const [inline] |
Changes the std::vector vec to be a copy of the object.
Definition at line 266 of file arr.h.
template<typename T, typename storageManager>
template<typename T2>
void arrT< T, storageManager >::copyFromPtr |
( |
const T2 * |
ptr, |
|
|
tsize |
sz | |
|
) |
| | [inline] |
Reserves space for sz elements, then copies sz elements from ptr into the array.
Definition at line 274 of file arr.h.
template<typename T, typename storageManager>
void arrT< T, storageManager >::transfer |
( |
arrT< T, storageManager > & |
other |
) |
[inline] |
Assigns the contents and size of other to the array.
- Note:
- On exit, other is zero-sized!
Definition at line 282 of file arr.h.
template<typename T, typename storageManager>
void arrT< T, storageManager >::swap |
( |
arrT< T, storageManager > & |
other |
) |
[inline] |
Swaps contents and size with other.
Definition at line 291 of file arr.h.
The documentation for this class was generated from the following file: