57 : value_(other.value_),
79 isSet_ = other.isSet_;
81 value_ = other.value_;
135 UTIL_THROW(
"Attempt to return unknown value.");
148 bool isValid(MPI::Intracomm& communicator)
const;
162 template <
typename T>
165 int isSet = (int)isSet_;
167 communicator.Allreduce(&isSet, &total, 1, MPI::INT, MPI::SUM);
168 int nproc = communicator.Get_size();
169 if (isSet_ && total != nproc) {
172 if ((!isSet_) && total != 0) {
Template for a value that can be set or declared null (i.e., unknown).
Setable()
Default constructor.
const T & value() const
Return value (if set).
void set(const T &value)
Set the value and mark as set.
bool isValid(MPI::Intracomm &communicator) const
Test consistency of states on different processors.
Setable(const Setable< T > &other)
Copy constructor.
Setable(const T &value)
Construct from T value (explicit).
bool isSet() const
Is this object set (is the value known)?
void unset()
Unset the value (mark as unknown).
Setable< T > & operator=(const Setable< T > &other)
Assignment from another Setable<T> object.
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.