9#include "BracketPolicy.h"
12#include <util/mpi/MpiSendRecv.h>
23 template <
typename Type>
32 std::string name = name_;
42 template <
typename Type>
49 template <
typename Type>
57 std::string
string = name_;
60 label_.setIsRequired(
false);
66 label_.setIsRequired(isRequired_);
81 std::string
string = name_;
90 std::string
string = name_;
102 template <
class Type>
105 for (
int i = 0; i < n_; ++i) {
114 template <
class Type>
125 std::string
string = name_;
127 hasBrackets_ =
false;
138 template <
class Type>
148 for (i = 0; i < n_; ++i) {
149 if (i == 0 && !hasBrackets_) {
154 out << std::right << std::scientific
161 out <<
indent() <<
"]" << std::endl;
int n() const
Get the logical array dimension.
ArrayParam(const char *label, int n, bool isRequired=true)
Constructor.
std::string indent() const
Return indent string for this object (string of spaces).
std::string label() const
Return label string.
void writeParam(std::ostream &out) const
Write an array-valued parameter to stream.
virtual Type & element(int i)=0
Return a non-const reference to one element of the array.
virtual void readValue(std::istream &in)
Read array of element values from an input stream.
virtual ~ArrayParam()
Destructor.
void readEndBracket(std::istream &in)
Read a closing bracket, if necessary.
bool isRequired() const
Is this an optional parameter?
Label label_
Label object that contains parameter label string.
bool isActive() const
Is this parameter active?
virtual void readLabel(std::istream &in)
Read parameter label from an input stream.
A label string in a file format.
static bool isMatched()
Did the most recent attempt to match a Label succeed?
Parameter(const char *label, bool isRequired=true)
Constructor.
static const int Precision
Precision for io of floating point data field.
bool isActive_
Is this parameter active (always true if isRequired).
Label label_
Label object that contains parameter label string.
static const int Width
Width of output field for a scalar variable.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
BracketPolicy::Type get()
Get value of bracket policy.
Utility classes for scientific computation.