PSCF v1.1
|
Wrapper for a double precision number, for formatted ostream output. More...
#include <Dbl.h>
Public Member Functions | |
Constructors | |
Dbl () | |
Default constructor. More... | |
Dbl (double value) | |
Constructor, value only. More... | |
Dbl (double value, int width) | |
Constructor, value and width. More... | |
Dbl (double value, int width, int precision, bool isFixed=false) | |
Constructor: value, width, precision, and format. More... | |
Mutators | |
void | setValue (double value) |
Set value of associated double. More... | |
void | setWidth (int width) |
Set output field width. More... | |
void | setPrecision (int precision) |
Set output floating point precision. More... | |
Accessors | |
double | value () |
Get value of associated double. More... | |
int | width () |
Get field width. More... | |
int | precision () |
Get floating point precision. More... | |
std::istream & | operator>> (std::istream &in, Dbl &object) |
Input stream extractor for an Dbl object. More... | |
std::ostream & | operator<< (std::ostream &out, const Dbl &object) |
Output stream inserter for an Dbl object. More... | |
Wrapper for a double precision number, for formatted ostream output.
An Dbl object has a double precision numerical value, as well as members (width and precision) that control its output format. The << operator for an Dbl object uses the specified width and precision. The double precision number, the width and the precision may all be specified as parameters to one of several constructors. Values of width and precision that are not specified as parameters of a constructor are set within the constructor to default values given by Format::defaultWidth() and Format::defaultPrecision(), respectively.
A Dbl object may be passed to an ostream as a temporary object. For example, the expression:
outputs the number 2.0 using the default width and precision, followed by the number 3.0 in a field of minimum width 15 and precision 8.
|
explicit |
Util::Dbl::Dbl | ( | double | value, |
int | width | ||
) |
Util::Dbl::Dbl | ( | double | value, |
int | width, | ||
int | precision, | ||
bool | isFixed = false |
||
) |
void Util::Dbl::setValue | ( | double | value | ) |
void Util::Dbl::setWidth | ( | int | width | ) |
void Util::Dbl::setPrecision | ( | int | precision | ) |
double Util::Dbl::value | ( | ) |
int Util::Dbl::width | ( | ) |
int Util::Dbl::precision | ( | ) |
|
friend |
|
friend |