|
| | FPArray () |
| | Default constructor.
|
| | FPArray (FPArray< Data, Capacity > const &other) |
| | Copy constructor.
|
| | ~FPArray () |
| | Destructor.
|
| FPArray< Data, Capacity > & | operator= (FPArray< Data, Capacity > const &other) |
| | Assignment, element by element.
|
| void | append (Data &data) |
| | Append an element to the end of the array.
|
| void | clear () |
| | Set logical size to zero and nullify all elements.
|
| int | capacity () const |
| | Return physical capacity of array.
|
| int | size () const |
| | Return logical size of this array.
|
| void | begin (PArrayIterator< Data > &iterator) |
| | Set an iterator to begin this container.
|
| void | begin (ConstPArrayIterator< Data > &iterator) const |
| | Set a const iterator to begin this container.
|
| Data & | operator[] (int i) |
| | Get an element by reference (mimic C-array subscripting).
|
| Data const & | operator[] (int i) const |
| | Get an element by const reference (mimic C-array subscripting).
|
template<typename Data, int Capacity>
class Util::FPArray< Data, Capacity >
Fixed size, stack allocated pointer array.
A FPArray is a fixed size array that holds pointers to Data objects, but for which the [] operator returns a reference to the associated object (i.e., to the deferenced pointer). It is implemented as a wrapper for a stack-allocated C array of Data* pointers. A FPArray is not responsible for destroying the associated Data objects.
The interface of an FPArray is identical to that of an FSArray. An FPArray has both a capacity that is set at compile time, which is the physical size of the underlying C array, and a size, which is the number of contiguous elements (indexed from 0 to size-1) that contain valid pointers. The size can only be increased only by the append() method, which takes a reference to an object as an argument, and adds an element to the end of the array.
When compiled in debug mode, the operator [] checks that the index is less than the size and non-negative.
Definition at line 41 of file FPArray.h.