33 const unitConversions& defaultUnits,
38 unitConversion
units(defaultUnits.value);
39 const bool haveUnits =
units.readIfPresent(is);
42 const Type value = pTraits<Type>(is);
45 if (!haveUnits && !is.eof())
47 units.readIfPresent(is);
51 return units.toStandard(value);
78 value_(
dict.lookup<Type>(
"value",
units.value))
91 value_(readValue(
units, is))
Templated function that returns a constant value.
Constant(const word &name, const Type &val)
Construct from name and value.
virtual void write(Ostream &os, const unitConversions &units) const
Write in dictionary format.
virtual ~Constant()
Destructor.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by any number of values (e....
A class for handling words, derived from string.
void writeEntry(Ostream &os, const omega &a)
word name(const bool)
Return a word representation of a bool.
const HashTable< unitConversion > & units()
Get the table of unit conversions.