|
PSCF v1.5.0
|
A fixed size, stack-allocated array. More...
#include <FArray.h>
Public Member Functions | |
| FArray () | |
| Constructor. | |
| FArray (FArray< Data, Capacity > const &other) | |
| Copy constructor. | |
| FArray< Data, Capacity > & | operator= (FArray< Data, Capacity > const &other) |
| Assignment, element by element. | |
| int | size () const |
| Return number of elements in this FArray. | |
| int | capacity () const |
| Return number of elements in this FArray. | |
| void | begin (ArrayIterator< Data > &iterator) |
| Set an ArrayIterator to the beginning of this Array. | |
| void | begin (ConstArrayIterator< Data > &iterator) const |
| Set a ConstArrayIterator to the beginning of this Array. | |
| Data & | operator[] (int i) |
| Mimic C array subscripting. | |
| Data const & | operator[] (int i) const |
| Mimic C array subscripting. | |
| Data * | cArray () |
| Return pointer to underlying C array. | |
| Data const * | cArray () const |
| Return pointer to const to underlying C array. | |
| template<class Archive> | |
| void | serialize (Archive &ar, const unsigned int version) |
| Serialize a FArray to/from an Archive. | |
| int | packedSize () |
| Return packed size in a MemoryArchive, in bytes. | |
A fixed size, stack-allocated array.
An FArray is a simple wraper for a fixed size, stack-allocated C Array, with a capacity that is fixed at compile time.
When bounds checking is on (i.e., when NDEBUG is not defined), the subscript operator [] checks that the index is non-negative and less than the Capacity.
Advice: Use an FArray for a small array if you know exactly how many elements will be needed at compile time. Use an FSArray when you need a small stack-allocated array for which a maximum capacity is known at compile time, but the logical size may be less than the capacity. Use a DArray or a GArray if you need an array whose size is not known at compile time.
|
inline |
| Util::FArray< Data, Capacity >::FArray | ( | FArray< Data, Capacity > const & | other | ) |
| FArray< Data, Capacity > & Util::FArray< Data, Capacity >::operator= | ( | FArray< Data, Capacity > const & | other | ) |
|
inline |
|
inline |
|
inline |
Set an ArrayIterator to the beginning of this Array.
| iterator | ArrayIterator, initialized on output. |
Definition at line 233 of file FArray.h.
References Util::ArrayIterator< Data >::setCurrent(), and Util::ArrayIterator< Data >::setEnd().
|
inline |
Set a ConstArrayIterator to the beginning of this Array.
| iterator | ConstArrayIterator, initialized on output. |
Definition at line 244 of file FArray.h.
References Util::ConstArrayIterator< Data >::setCurrent(), and Util::ConstArrayIterator< Data >::setEnd().
|
inline |
Mimic C array subscripting.
| i | array index |
Definition at line 255 of file FArray.h.
References UTIL_ASSERT.
|
inline |
Mimic C array subscripting.
| i | array index |
Definition at line 266 of file FArray.h.
References UTIL_ASSERT.
|
inline |
| Data const * Util::FArray< Data, Capacity >::cArray | ( | ) | const |
| void Util::FArray< Data, Capacity >::serialize | ( | Archive & | ar, |
| const unsigned int | version ) |
| int Util::FArray< Data, Capacity >::packedSize | ( | ) |