This rating function allows to define the rate per unit based on the total usage. It models "Up-to x units the price per unit is ...".
The cost is determined by:
cost = total usage * rate
with rate taken from the greatest entry in charges_ with
total usage <= volume
.
Definition at line 963 of file ratingfn.h.
typedef std::auto_ptr<RfSlot> OSB_LIB::RfSlot::AutoPtr |
Short-cut for an auto pointer.
For details see quality manual, implementation patterns: Virtual copy construction.
Reimplemented from OSB_LIB::RatingFn.
Definition at line 973 of file ratingfn.h.
typedef std::map<Decimal, Decimal> OSB_LIB::RfSlot::Charges |
List of charges.
Key contains the volume, Data stores the rate.
Definition at line 980 of file ratingfn.h.
OSB_LIB::RfSlot::RfSlot | ( | const RatingFn::Oid & | oid = Oid() |
) | [explicit] |
Constructor with optional object id.
This will construct an empty slot rating function. The new object should call the read(...) function to populate its data members.
oid | Object id of the slot rating function. |
const Charges& OSB_LIB::RfSlot::charges | ( | ) | const |
Get the data member charges.
AutoPtr OSB_LIB::RfSlot::clone | ( | ) | const |
Virtual copy construction.
For details see quality manual, implementation patterns.
Reimplemented from OSB_LIB::RatingFn.
virtual RatingFn* OSB_LIB::RfSlot::clone_ | ( | ) | const [private, virtual] |
Virtual copy construction.
For details see quality manual, implementation patterns.
Implements OSB_LIB::RatingFn.
virtual bool OSB_LIB::RfSlot::freezeSpecific | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Criteria checking before setting the status from editable to standby.
session | Database session used. | |
errors | Container for error messages if any. |
Implements OSB_LIB::RatingFn.
bool OSB_LIB::RfSlot::insSpecific | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Insert RfSlot specific data members into database.
session | Database session. |
OsbException | for database error. |
Implements OSB_LIB::RatingFn.
virtual const Money OSB_LIB::RfSlot::rateVolumeToMoney | ( | const TypeId< Unit > & | unitId, | |
const Decimal & | volume, | |||
Decimal & | roundedVolume | |||
) | const [virtual] |
Rate a used service for a specific time interval.
unitId | Unit of the volume to be converted. | |
volume | Used volume of service. | |
roundedVolume | Volume after rounding, set to volume. |
Implements OSB_LIB::RatingFn.
bool OSB_LIB::RfSlot::readSpecific | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Read RfSlot specific data members from database.
session | Database session. |
OsbException | for database error. |
Implements OSB_LIB::RatingFn.
virtual bool OSB_LIB::RfSlot::releaseSpecific | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Criteria checking before setting the status from standby to release.
session | Database session used. | |
errors | Container for error messages if any. |
Implements OSB_LIB::RatingFn.
bool OSB_LIB::RfSlot::removeSpecific | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Remove RfSlot specific data members from database.
session | Database session. |
OsbException | for database error. |
Implements OSB_LIB::RatingFn.
virtual bool OSB_LIB::RfSlot::revokeSpecific | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Criteria checking before setting the status from release to standby.
session | Database session used. | |
errors | Container for error messages if any. |
Implements OSB_LIB::RatingFn.
bool OSB_LIB::RfSlot::setCharges | ( | const Charges & | charges | ) |
Modify the charge configuration of the stair case rating function.
charges | The new charges to be applied. |
OsbException | for the following errors:
|
Type OSB_LIB::RfSlot::type | ( | ) | const [virtual] |
virtual bool OSB_LIB::RfSlot::unfreezeSpecific | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Criteria checking before setting the status from standby to editable.
session | Database session used. | |
errors | Container for error messages if any. |
Implements OSB_LIB::RatingFn.
bool OSB_LIB::RfSlot::updSpecific | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Update RfSlot specific data members into database.
session | Database session. |
OsbException | for database error. |
Implements OSB_LIB::RatingFn.
friend struct OSB_DB::RfSlotGw [friend] |
The database gateway needs to populate data members after construction.
Definition at line 969 of file ratingfn.h.
Charges OSB_LIB::RfSlot::charges_ [private] |