9#include "BracketPolicy.h"
23 template <
typename Type>
28 isRequired_(isRequired),
32 std::string name = name_;
42 template <
typename Type>
49 template <
typename Type>
57 std::string
string = name_;
59 label_.setString(
string);
60 label_.setIsRequired(
false);
66 label_.setIsRequired(isRequired_);
73 label_.setString(name_);
81 std::string
string = name_;
83 label_.setString(
string);
90 std::string
string = name_;
91 label_.setString(
string);
102 template <
class Type>
105 for (
int i = 0; i < n_; ++i) {
114 template <
class Type>
125 std::string
string = name_;
127 hasBrackets_ =
false;
132 label_.setString(
string);
138 template <
class Type>
148 for (i = 0; i < n_; ++i) {
149 if (i == 0 && !hasBrackets_) {
152 out << indent() << space;
154 out << std::right << std::scientific
161 out << indent() <<
"]" << std::endl;
This file contains templates for global functions send<T>, recv<T> and bcast<T>.
ArrayParam(const char *label, int n, bool isRequired=true)
Constructor.
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.
virtual ~ArrayParam()
Destructor.
void readEndBracket(std::istream &in)
Read a closing bracket, if necessary.
Label label_
Label object that contains parameter label string.
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?
void setString(std::string string)
Set the label string.
A single variable in a parameter file.
static const int Precision
Precision for io of floating point data field.
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.