PSCF v1.1
|
A fixed size (static) contiguous array template. More...
#include <FArray.h>
Public Member Functions | |
FArray () | |
Constructor. More... | |
FArray (FArray< Data, Capacity > const &other) | |
Copy constructor. More... | |
FArray< Data, Capacity > & | operator= (FArray< Data, Capacity > const &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... | |
Data const & | operator[] (int i) const |
Mimic C array subscripting. More... | |
Data * | cArray () |
Return pointer to underlying C array. More... | |
Data const * | 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... | |
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.
Util::FArray< Data, Capacity >::FArray |
Util::FArray< Data, Capacity >::FArray | ( | FArray< Data, Capacity > const & | other | ) |
FArray< Data, Capacity > & Util::FArray< Data, Capacity >::operator= | ( | FArray< Data, Capacity > const & | other | ) |
|
inline |
Return number of elements in this FArray.
Definition at line 198 of file FArray.h.
Referenced by pscfpp.file.File::__eq__(), pscfpp.text.Record::__init__(), pscfpp.file.File::__init__(), pscfpp.file.File::__repr__(), and pscfpp.text.Record::__str__().
|
inline |
|
inline |
Set an ArrayIterator to the beginning of this Array.
iterator | ArrayIterator, initialized on output. |
Definition at line 213 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 224 of file FArray.h.
References Util::ConstArrayIterator< Data >::setCurrent(), and Util::ConstArrayIterator< Data >::setEnd().
|
inline |
|
inline |
|
inline |
Data const * Util::FArray< Data, Capacity >::cArray |
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().