OSB_LIB::RfSlot Class Reference

Inheritance diagram for OSB_LIB::RfSlot:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Rate by total volume.

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.

Public Types

Public Member Functions

Retrieve data members.
Modify data members

Protected Member Functions

Private Member Functions

Specific criteria checking before status changes:
Specific database operations for derived classes.

Private Attributes

Friends


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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.

Parameters:
oid Object id of the slot rating function.


Member Function Documentation

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.

Parameters:
session Database session used.
errors Container for error messages if any.
Returns:
true if success else false.

Implements OSB_LIB::RatingFn.

bool OSB_LIB::RfSlot::insSpecific ( const OSB_DB::Session session  )  [private, virtual]

Insert RfSlot specific data members into database.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for database error.

Implements OSB_LIB::RatingFn.

virtual const Decimal OSB_LIB::RfSlot::rateMoneyToVolume ( const Money  )  const [protected, virtual]

Not applicable to slot rating function.

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.

Parameters:
unitId Unit of the volume to be converted.
volume Used volume of service.
roundedVolume Volume after rounding, set to volume.
Returns:
The rated for the used volume.
Look-up charges for greatest matching volume and multiply its rate with volume.

Implements OSB_LIB::RatingFn.

bool OSB_LIB::RfSlot::readSpecific ( const OSB_DB::Session session  )  [private, virtual]

Read RfSlot specific data members from database.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
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.

Parameters:
session Database session used.
errors Container for error messages if any.
Returns:
true if success else false.

Implements OSB_LIB::RatingFn.

bool OSB_LIB::RfSlot::removeSpecific ( const OSB_DB::Session session  )  [private, virtual]

Remove RfSlot specific data members from database.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
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.

Parameters:
session Database session used.
errors Container for error messages if any.
Returns:
true if success else false.

Implements OSB_LIB::RatingFn.

bool OSB_LIB::RfSlot::setCharges ( const Charges charges  ) 

Modify the charge configuration of the stair case rating function.

Parameters:
charges The new charges to be applied.
Returns:
true if successful else false.
Exceptions:
OsbException for the following errors:
  • Object is not editable

Type OSB_LIB::RfSlot::type (  )  const [virtual]

Get the type of rating function.

Implements OSB_LIB::RatingFn.

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.

Parameters:
session Database session used.
errors Container for error messages if any.
Returns:
true if success else false.

Implements OSB_LIB::RatingFn.

bool OSB_LIB::RfSlot::updSpecific ( const OSB_DB::Session session  )  [private, virtual]

Update RfSlot specific data members into database.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for database error.

Implements OSB_LIB::RatingFn.


Friends And Related Function Documentation

friend struct OSB_DB::RfSlotGw [friend]

The database gateway needs to populate data members after construction.

Definition at line 969 of file ratingfn.h.


Member Data Documentation

Charges OSB_LIB::RfSlot::charges_ [private]

Configuration of slot specific rating charges.

Definition at line 1142 of file ratingfn.h.


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