casa
5.7.0-16
|
Defines a class for quantities that may be expressed in percent. More...
#include <ATMPercent.h>
Public Member Functions | |
Percent () | |
Default constructor. More... | |
Percent (double percent) | |
A full constructor: Amount in default units (relative to 1) More... | |
Percent (double percent, const std::string &units) | |
A full constructor: Amount + units. More... | |
~Percent () | |
Percent & | operator= (const Percent &rhs) |
Operator "equal to a Percent". More... | |
Percent & | operator= (double rhs) |
Operator "equal to a double converted to Percent in %". More... | |
Percent | operator+ (const Percent &rhs) |
Operator "addition of percentages". More... | |
Percent | operator- (const Percent &rhs) |
Operator "substraction of percentages". More... | |
Percent | operator* (double scf) |
Operator "multiplication of a percent by a double". More... | |
Percent | operator* (float scf) |
Operator "multiplication of a percent by a float". More... | |
Percent | operator* (int scf) |
Operator "multiplication of a percent by an int". More... | |
Percent | operator* (unsigned int scf) |
Operator "multiplication of a percent by an unsigned int". More... | |
Percent | operator/ (double scf) |
Operator "division of a percent by a double". More... | |
Percent | operator/ (float scf) |
Operator "division of a percent by a float". More... | |
Percent | operator/ (int scf) |
Operator "division of a percent by an int". More... | |
Percent | operator/ (unsigned int scf) |
Operator "division of a percent by an unsigned int". More... | |
bool | operator< (const Percent &rhs) const |
Operator "comparator < for two percentages". More... | |
bool | operator> (const Percent &rhs) const |
Operator "comparator > for two percentages". More... | |
bool | operator<= (const Percent &rhs) const |
Operator "comparator <= for two percentages". More... | |
bool | operator>= (const Percent &rhs) const |
Operator "comparator >= for two percentages". More... | |
bool | operator== (const Percent &rhs) const |
Operator "comparator == for two percentages". More... | |
bool | operator!= (const Percent &rhs) const |
Operator "comparator != for two percentages". More... | |
double | get () const |
Accessor to the percent value in International System units. More... | |
double | get (const std::string &units) const |
Accessor to the percent value in specified units. More... | |
Private Attributes | |
double | valueIS_ |
Defines a class for quantities that may be expressed in percent.
This class is aimed at quantities that may be defined in percent. Default is proposed with no units (relative to one), and an alternative is considered for units in %.
Definition at line 44 of file ATMPercent.h.
Percent::Percent | ( | ) |
Default constructor.
Referenced by operator*(), operator+(), operator-(), and operator/().
Percent::Percent | ( | double | percent | ) |
A full constructor: Amount in default units (relative to 1)
Percent::Percent | ( | double | percent, |
const std::string & | units | ||
) |
A full constructor: Amount + units.
Valid units are: %
Percent::~Percent | ( | ) |
double Percent::get | ( | ) | const |
Accessor to the percent value in International System units.
Referenced by operator!=(), operator+(), operator-(), operator<(), operator<=(), operator==(), operator>(), and operator>=().
double Percent::get | ( | const std::string & | units | ) | const |
Accessor to the percent value in specified units.
|
inline |
Operator "comparator != for two percentages".
Definition at line 98 of file ATMPercent.h.
|
inline |
Operator "multiplication of a percent by a double".
Definition at line 72 of file ATMPercent.h.
|
inline |
Operator "multiplication of a percent by a float".
Definition at line 74 of file ATMPercent.h.
|
inline |
Operator "multiplication of a percent by an int".
Definition at line 76 of file ATMPercent.h.
|
inline |
Operator "multiplication of a percent by an unsigned int".
Definition at line 78 of file ATMPercent.h.
Operator "addition of percentages".
Definition at line 68 of file ATMPercent.h.
Operator "substraction of percentages".
Definition at line 70 of file ATMPercent.h.
|
inline |
Operator "division of a percent by a double".
Definition at line 80 of file ATMPercent.h.
|
inline |
Operator "division of a percent by a float".
Definition at line 82 of file ATMPercent.h.
|
inline |
Operator "division of a percent by an int".
Definition at line 84 of file ATMPercent.h.
|
inline |
Operator "division of a percent by an unsigned int".
Definition at line 86 of file ATMPercent.h.
|
inline |
Operator "comparator < for two percentages".
Definition at line 88 of file ATMPercent.h.
|
inline |
Operator "comparator <= for two percentages".
Definition at line 92 of file ATMPercent.h.
|
inline |
Operator "equal to a double converted to Percent in %".
Definition at line 66 of file ATMPercent.h.
References valueIS_.
|
inline |
Operator "comparator == for two percentages".
Definition at line 96 of file ATMPercent.h.
|
inline |
Operator "comparator > for two percentages".
Definition at line 90 of file ATMPercent.h.
|
inline |
Operator "comparator >= for two percentages".
Definition at line 94 of file ATMPercent.h.
|
private |
Definition at line 101 of file ATMPercent.h.
Referenced by operator!=(), operator*(), operator+(), operator-(), operator/(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().