1#ifndef UTIL_F_ARRAY_PARAM_H
2#define UTIL_F_ARRAY_PARAM_H
11#include <util/param/ArrayParam.h>
12#include <util/containers/FArray.h>
25 template <
typename Type,
int Capacity>
56 {
return (*arrayPtr_)[i]; }
62 {
return (*arrayPtr_)[i]; }
89 virtual void bcastValue();
104 template <
typename Type,
int Capacity>
115 template <
typename Type,
int Capacity>
119 if (Capacity !=
n()) {
120 UTIL_THROW(
"Error: FArray capacity != n in writeParam");
129 template <
typename Type,
int Capacity>
132 if (Capacity !=
n()) {
141 template <
typename Type,
int Capacity>
144 if (Capacity !=
n()) {
153 template <
typename Type,
int Capacity>
156 if (Capacity !=
n()) {
166 template <
typename Type,
int Capacity>
168 { 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.
virtual void readValue(std::istream &in)
Read array of element values from an input stream.
bool isRequired() const
Is this an optional parameter?
A Parameter associated with a FArray container.
virtual void saveValue(Serializable::OArchive &ar)
Save parameter value to an archive.
void writeParam(std::ostream &out) const
Write parameter to stream.
FArrayParam(const char *label, FArray< Type, Capacity > &array, bool isRequired=true)
Constructor.
virtual void readValue(std::istream &in)
Read parameter value from an input stream.
Type & element(int i)
Return a reference to one element of the array (non-const).
virtual void loadValue(Serializable::IArchive &ar)
Load bare parameter value from an archive.
Type const & element(int i) const
Return a reference to one element of the array (const).
A fixed size (static) contiguous array template.
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_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
Utility classes for scientific computation.