DynamicArray< T > Class Template Reference
A simple object wrapper for dynamically-allocated arrays.
More...
#include <DynamicArray.h++>
List of all members.
Detailed Description
template<typename T>
class ccxx::DynamicArray< T >
A simple object wrapper for dynamically-allocated arrays.
See section 17.5.4 of The C++ Programming Language. The array is heap-allocated and can be resized after construction. An array of length zero is considered to be "null".
- Author:
- Mark Lindner
Member Typedef Documentation
Constructor & Destructor Documentation
Construct a new DynamicArray with the given initial size.
- Parameters:
-
| size | The initial size, as a number of elements. |
Member Function Documentation
| const T* data |
( |
|
) |
const throw () [inline] |
Get the underlying array.
- Returns:
- A pointer to the beginning of the array.
| T* data |
( |
|
) |
throw () [inline] |
Get the underlying array.
- Returns:
- A pointer to the beginning of the array.
| bool isNull |
( |
|
) |
const throw () [inline] |
Determine if this array is NULL.
| operator const T * |
( |
|
) |
const throw () [inline] |
| operator T * |
( |
|
) |
throw () [inline] |
| bool operator! |
( |
|
) |
const throw () [inline] |
| T* release |
( |
|
) |
throw () [inline] |
Release ownership of the array.
- Returns:
- The array.
| void resize |
( |
size_t |
size, |
|
|
bool |
copy = false | |
|
) |
| | [inline] |
Resize the array to a new size.
Allocates a new array, and optionally copies as many elements from the old array as will fit to the new one.
- Parameters:
-
| size | The new size, as a number of elements. |
| copy | If true, copy the elements from the old array. |
| size_t size |
( |
|
) |
const throw () [inline] |
Get the size of the array.
- Returns:
- The size, in elements.
The documentation for this class was generated from the following file: