1#ifndef UTIL_F_S_ARRAY_PARAM_H
2#define UTIL_F_S_ARRAY_PARAM_H
11#include <util/param/ArrayParam.h>
12#include <util/containers/FSArray.h>
25 template <
typename Type,
int Capacity>
57 {
return (*arrayPtr_)[i]; }
63 {
return (*arrayPtr_)[i]; }
90 virtual void bcastValue();
105 template <
typename Type,
int Capacity>
117 template <
typename Type,
int Capacity>
130 template <
typename Type,
int Capacity>
136 for (
int i = 0; i <
n(); ++i) {
138 arrayPtr_->append(value);
147 template <
typename Type,
int Capacity>
157 template <
typename Type,
int Capacity>
168 template <
typename Type,
int Capacity>
170 { bcast<Type>(ioCommunicator(), *arrayPtr_, Capacity, 0); }
An array-valued parameter in a parameter file.
int n() const
Get the logical array dimension.
ArrayParam(const char *label, int n, bool isRequired=true)
Constructor.
std::string label() const
Return label string.
void writeParam(std::ostream &out) const
Write an array-valued parameter to stream.
void readEndBracket(std::istream &in)
Read a closing bracket, if necessary.
bool isRequired() const
Is this an optional parameter?
A Parameter associated with a FSArray container.
virtual void saveValue(Serializable::OArchive &ar)
Save parameter value to an archive.
virtual void loadValue(Serializable::IArchive &ar)
Load bare parameter value from an archive.
Type & element(int i)
Return a reference to one element of the array (non-const).
void writeParam(std::ostream &out) const
Write parameter to stream.
FSArrayParam(const char *label, FSArray< Type, Capacity > &array, int n, bool isRequired=true)
Constructor.
Type const & element(int i) const
Return a reference to one element of the array (const).
virtual void readValue(std::istream &in)
Read parameter value from an input stream.
A fixed capacity (static) contiguous array with a variable logical size.
virtual void readParam(std::istream &in)
Read a label and (if the label matches) a parameter value.
bool isActive() const
Is this parameter active?
BinaryFileIArchive IArchive
Type of input archive used by load method.
BinaryFileOArchive OArchive
Type of output archive used by save method.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
Utility classes for scientific computation.