Simpatico
v1.10
|
A fixed size (static) contiguous array template.
An FArray is a simple wraper for a fixed size C Array, with a capacity that is fixed at compile time. As in a C Array, or a DArray container, all of the elements are accessible. Unlike an FSArray, an FArray does not have logical size that is distinct from its physical capacity.
When bounds checking is on (i.e., when NDEBUG is not defined), the operator [] checks that the index is non-negative and less than the Capacity.
Advice: Use an FArray if you know exactly how many elements will be needed at compile time. Use an FSArray when you need a small statically allocated array for which the maximum capacity needed is known at compile time, but the logical size may be less than the capacity. Use a DArray if you need a large, dynamically allocated array that must be allocated after instantiation.
#include <FArray.h>
Public Member Functions | |
FArray () | |
Constructor. More... | |
FArray (const FArray< Data, Capacity > &other) | |
Copy constructor. More... | |
FArray< Data, Capacity > & | operator= (const FArray< Data, Capacity > &other) |
Assignment, element by element. More... | |
int | size () const |
Return number of elements in this FArray. More... | |
int | capacity () const |
Return number of elements in this FArray. More... | |
void | begin (ArrayIterator< Data > &iterator) |
Set an ArrayIterator to the beginning of this Array. More... | |
void | begin (ConstArrayIterator< Data > &iterator) const |
Set a ConstArrayIterator to the beginning of this Array. More... | |
Data & | operator[] (int i) |
Mimic C array subscripting. More... | |
const Data & | operator[] (int i) const |
Mimic C array subscripting. More... | |
Data * | cArray () |
Return pointer to underlying C array. More... | |
const Data * | cArray () const |
Return pointer to const to underlying C array. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a FArray to/from an Archive. More... | |
int | packedSize () |
Return packed size in a MemoryArchive, in bytes. More... | |
Static Public Member Functions | |
static void | commitMpiType () |
Commit associated MPI DataType. More... | |
Util::FArray< Data, Capacity >::FArray | ( | ) |
Util::FArray< Data, Capacity >::FArray | ( | const FArray< Data, Capacity > & | other | ) |
FArray< Data, Capacity > & Util::FArray< Data, Capacity >::operator= | ( | const FArray< Data, Capacity > & | other | ) |
|
inline |
|
inline |
|
inline |
Set an ArrayIterator to the beginning of this Array.
iterator | ArrayIterator, initialized on output. |
Definition at line 214 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 225 of file FArray.h.
References Util::ConstArrayIterator< Data >::setCurrent(), and Util::ConstArrayIterator< Data >::setEnd().
|
inline |
|
inline |
|
inline |
const Data * Util::FArray< Data, Capacity >::cArray | ( | ) | const |
void Util::FArray< Data, Capacity >::serialize | ( | Archive & | ar, |
const unsigned int | version | ||
) |
int Util::FArray< Data, Capacity >::packedSize | ( | ) |
|
static |
Commit associated MPI DataType.
Definition at line 292 of file FArray.h.
References Util::MpiStructBuilder::addMember(), Util::MpiStructBuilder::commit(), and Util::MpiStructBuilder::setBase().