45 template<
typename ...ArgsT>
48 value_(std::forward<ArgsT>(args)...)
59 value_(std::move(v.value_))
78 return (value_ = val);
88 return (value_ = std::move(val));
97 sparta_assert(valid_ ==
true,
"ValidValue is not valid for compare!");
98 return (value_ == val);
124 sparta_assert(valid_ ==
true,
"ValidValue is not valid for conversion!");
135 sparta_assert(valid_ ==
true,
"ValidValue is not valid for conversion!");
144 sparta_assert(valid_ ==
true,
"ValidValue is not valid for getting!");
154 sparta_assert(valid_ ==
true,
"ValidValue is not valid for getting!");
170template<
class Val
idValT>
177 os <<
"<invalid ValidValue>";
Set of macros for Sparta assertions. Caught by the framework.
#define sparta_assert(...)
Simple variadic assertion that will throw a sparta_exception if the condition fails.
Provides a wrapper around a value to ensure that the value is assigned.
ValidValue(ValidValue &&v)
Allow moves.
value_type operator=(const value_type &val)
Assignment.
ValidValue(ArgsT &&...args)
Construct with a valid starting value.
ValidValue(const ValidValue &)=default
Allow copies.
ValidValue(ValidValue &)=default
ValidValue & operator=(const ValidValue &)=default
Allow assignments.
value_type operator=(value_type &&val)
Assignment.
value_type & getValue()
Get the value.
bool operator!=(const value_type &val) const
Compare not equal.
bool operator==(const value_type &val) const
Compare equal.
T value_type
Convenient typedef for the value type.
void clearValid()
Clear the validity of this object.
const value_type & getValue() const
Get the value - const version.
ValidValue()
Construct with no validity (not valid, uninitialized)
bool isValid() const
Is this value valid.
Macros for handling exponential backoff.
std::ostream & operator<<(std::ostream &o, const SimulationInfo &info)
ostream insertion operator for SimulationInfo