OSB_LIB::RoundUp Class Reference

Inheritance diagram for OSB_LIB::RoundUp:

Inheritance graph
[legend]
Collaboration diagram for OSB_LIB::RoundUp:

Collaboration graph
[legend]
List of all members.

Detailed Description

A derived class of abstract base class RoundRule.

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.

Public Types

Public Member Functions

Read access to data member:

Private Member Functions

Private Attributes


Member Typedef Documentation

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 & Destructor Documentation

OSB_LIB::RoundUp::RoundUp ( const Oid id,
const Decimal threshold,
const Decimal multiple 
)

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.


Member Function Documentation

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]

Rounding "grid spacing".

Definition at line 219 of file roundrule.h.

References multiple_.

Decimal OSB_LIB::RoundUp::operator() ( const Decimal d  )  const [virtual]

Performs the rounding.

Implements OSB_LIB::RoundRule.

const Decimal& OSB_LIB::RoundUp::threshold (  )  const [inline]

Threshold of rounding Up rule.

Definition at line 217 of file roundrule.h.

References threshold_.


Member Data Documentation

Decimal OSB_LIB::RoundUp::multiple_ [private]

Rounding "grid spacing".

Definition at line 227 of file roundrule.h.

Referenced by multiple().

Decimal OSB_LIB::RoundUp::threshold_ [private]

Threshold of rounding Up rule.

Definition at line 226 of file roundrule.h.

Referenced by threshold().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:13:00 2006 for OSB Library by  doxygen 1.4.7