Implements a roundrule that defines a grid (through the parameter multiple) and rounds all values to a grid point. Values are rounded up to the next multiple if they are larger or equal to the previous multiple + threshold. Threshold is a value less than multiple.
Example: Set multiple = 1, threshold = 0.5 to round all values to integers, rounding up if the value is equal or larger than .5. This rounding rule will round 0.1 to 0, 0.49999 to 0, 0.5 to 1, 0.6 to 1, etc.
| . | . | . | ... 0 0.5 1 1.5 2 2.5 3
Definition at line 195 of file roundrule.h.
typedef std::auto_ptr<RoundUp> OSB_LIB::RoundUp::AutoPtr |
Short-cut for an auto pointer.
For details see quality manual, implementation patterns: Virtual copy construction.
Reimplemented from OSB_LIB::RoundRule.
Definition at line 199 of file roundrule.h.
Constructor with object id, threshold and multiple.
OSB_LIB::RoundUp::RoundUp | ( | const Oid & | id, | |
const std::string & | name, | |||
const std::string & | des, | |||
const Decimal & | threshold, | |||
const Decimal & | multiple | |||
) |
Constructor with object id, name, des, threshold and multiple.
AutoPtr OSB_LIB::RoundUp::clone | ( | ) | const |
Virtual copy construction.
For details see quality manual, implementation patterns.
Reimplemented from OSB_LIB::RoundRule.
virtual RoundRule* OSB_LIB::RoundUp::clone_ | ( | ) | const [private, virtual] |
Internal virtual copy constructor.
For details see quality manual, implementation patterns.
Implements OSB_LIB::RoundRule.
const Decimal& OSB_LIB::RoundUp::multiple | ( | ) | const [inline] |
const Decimal& OSB_LIB::RoundUp::threshold | ( | ) | const [inline] |
Decimal OSB_LIB::RoundUp::multiple_ [private] |
Decimal OSB_LIB::RoundUp::threshold_ [private] |
Threshold of rounding Up rule.
Definition at line 226 of file roundrule.h.
Referenced by threshold().