Definition at line 73 of file ratingfn.h.
typedef std::auto_ptr<RatingFn> OSB_LIB::RatingFn::AutoPtr |
Short-cut for an auto pointer.
For details see quality manual, implementation patterns: Virtual copy construction.
Reimplemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
Definition at line 101 of file ratingfn.h.
typedef Id<RatingFn> OSB_LIB::RatingFn::Oid |
typedef TypeId<RatingFn> OSB_LIB::RatingFn::Type |
Constructor with rating function type and optional object id.
virtual OSB_LIB::RatingFn::~RatingFn | ( | ) | [inline, virtual] |
bool OSB_LIB::RatingFn::checkObjVs | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [protected] |
Compare the object version with the database.
session | Database session to use. | |
errors | Gets error message if the object version does not match the database. |
AutoPtr OSB_LIB::RatingFn::clone | ( | ) | const |
Virtual copy construction.
For details see quality manual, implementation patterns.
Reimplemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
virtual RatingFn* OSB_LIB::RatingFn::clone_ | ( | ) | const [private, pure virtual] |
Virtual copy construction.
For details see quality manual, implementation patterns.
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
const std::string& OSB_LIB::RatingFn::currency | ( | ) | const |
Get the currency id.
bool OSB_LIB::RatingFn::freeze | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [virtual] |
Set the rating function from editable to standby.
To freeze a rating function, the following criteria must be fulfilled:
session | database session. | |
errors | container for error messages if any. |
Implements OSB_LIB::ToCfgBase.
virtual bool OSB_LIB::RatingFn::freezeSpecific | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, pure virtual] |
Criteria checking before setting the status from editable to standby.
session | Database session used. | |
errors | Container for error messages if any. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
bool OSB_LIB::RatingFn::insert | ( | const OSB_DB::Session & | session | ) | [private] |
This function allow rating function to insert itself into database.
The object's id is not set before the function call. If the function completed successfully, the object will have it's id set, else the id will still be the same (not set).
session | database session. |
OsbException | for the following errors:
|
virtual bool OSB_LIB::RatingFn::insSpecific | ( | const OSB_DB::Session & | session | ) | [private, pure virtual] |
Insert derived class specific data members into database.
session | Database session. |
OsbException | for database error. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
const F * OSB_LIB::RatingFn::isa | ( | const F *& | ptr | ) | const |
F * OSB_LIB::RatingFn::isa | ( | F *& | ptr | ) |
Downcast to a derived class.
The function uses dynamic_cast<F*> to downcast an object of RatingFn to an object of a derived class.
ptr = dynamic_cast<P*>(this); return ptr;
An example is given below:
class DerivedFunc : public RatingFn { ... }; void foo(const RatingFn& rf) { ... DerivedFunc* pRf; if (0 != rf.isa(pRf)) { // work with pRf } }
ptr | Pointer to cast to. It gets the result of the downcast. It's value will be 0 if the cast fails. |
Definition at line 1188 of file ratingfn.h.
const Oid& OSB_LIB::RatingFn::oid | ( | ) | const |
Get the rating function id.
Assignment operator.
virtual const Decimal OSB_LIB::RatingFn::rateMoneyToVolume | ( | const Money & | money | ) | const [pure virtual] |
Rate a used service based on the available money.
This function takes in an amount of money and calculate the total amount of time for a call.
money | Available money to be converted into call duration. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
virtual const Money OSB_LIB::RatingFn::rateVolumeToMoney | ( | const TypeId< Unit > & | unitId, | |
const Decimal & | volume, | |||
Decimal & | roundedVolume | |||
) | const [pure virtual] |
Rate a used service for a specific time interval.
This function takes in the total volume or length of time a service is used. It will then calculate the cost for the volume of service used and round the volume as well.
unitId | Unit of the volume passed in. | |
volume | Length of time a service is used. | |
roundedVolume | Length of time after round. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
bool OSB_LIB::RatingFn::read | ( | const OSB_DB::Session & | session | ) |
This function allow rating function to read itself from database.
Object id must be set before the function call. The id is used to retrieve other details from database and populate the object.
session | database session. |
OsbException | for database error. |
virtual bool OSB_LIB::RatingFn::readSpecific | ( | const OSB_DB::Session & | session | ) | [private, pure virtual] |
Read derived class specific data members from database.
session | Database session. |
OsbException | for database error. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
bool OSB_LIB::RatingFn::release | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [virtual] |
Set the rating function from standby to released.
To release a rating function, the following criteria must be fulfilled:
session | database session. | |
errors | container for error messages if any. |
OsbException | for any database errors. |
Implements OSB_LIB::ToCfgBase.
virtual bool OSB_LIB::RatingFn::releaseSpecific | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, pure virtual] |
Criteria checking before setting the status from standby to release.
session | Database session used. | |
errors | Container for error messages if any. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
bool OSB_LIB::RatingFn::remove | ( | const OSB_DB::Session & | session | ) | [private] |
This function allow rating function to remove itself from database.
Object id must be set before the function call. The id will be unset if the function completed successfully, else no changes to the object.
session | database session. |
OsbException | for the following errors:
|
virtual bool OSB_LIB::RatingFn::removeSpecific | ( | const OSB_DB::Session & | session | ) | [private, pure virtual] |
Remove derived class specific data members from database.
session | Database session. |
OsbException | for database error. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
bool OSB_LIB::RatingFn::revoke | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [virtual] |
Set the rating function from released to standby.
To revoke a rating function, the following criteria must be fulfilled:
session | database session. | |
errors | container for error messages if any. |
OsbException | for any database errors. |
Implements OSB_LIB::ToCfgBase.
virtual bool OSB_LIB::RatingFn::revokeSpecific | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, pure virtual] |
Criteria checking before setting the status from release to standby.
session | Database session used. | |
errors | Container for error messages if any. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
RfType OSB_LIB::RatingFn::rfType | ( | ) | const |
Rating function type as enumeration constant.
Utility to convert a Type into a RfType.
void OSB_LIB::RatingFn::setCtId | ( | const ChargeTraits & | ct | ) |
Set the rating function's charge traits.
ct | Charge traits of the rating function, only their object id and currency code is relevant. |
OsbException | if the rating function is not editable. |
Set the rating function's unit.
id | Object id of the unit. |
OsbException | if the rating function is not editable. |
virtual Type OSB_LIB::RatingFn::type | ( | ) | const [pure virtual] |
bool OSB_LIB::RatingFn::unfreeze | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [virtual] |
Set the rating function from standby to editable.
To unfreeze a rating function, the following criteria must be fulfilled:
session | database session. | |
errors | container for error messages if any. |
OsbException | for any database errors. |
Implements OSB_LIB::ToCfgBase.
virtual bool OSB_LIB::RatingFn::unfreezeSpecific | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, pure virtual] |
Criteria checking before setting the status from standby to editable.
session | Database session used. | |
errors | Container for error messages if any. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
bool OSB_LIB::RatingFn::update | ( | const OSB_DB::Session & | session | ) | [private] |
This function allow rating function to update itself into database.
This function will update an existing rating function object in the database. If the function completed successfully, the object's objVs will increment by 1.
session | database session. |
OsbException | for the following errors:
|
virtual bool OSB_LIB::RatingFn::updSpecific | ( | const OSB_DB::Session & | session | ) | [private, pure virtual] |
Update derived class specific data members into database.
session | Database session. |
OsbException | for database error. |
Implemented in OSB_LIB::RfStairCase, and OSB_LIB::RfSlot.
friend struct OSB_DB::RatingFnGw [friend] |
The database gateway needs to populate data members after construction.
Definition at line 78 of file ratingfn.h.
friend class RatingFns [friend] |
friend class TariffCatalogue [friend] |
Tariff Catalogue is the only object that is allow to invoke the database functions of this class.
Definition at line 83 of file ratingfn.h.
Id<CtBase> OSB_LIB::RatingFn::ctId_ [private] |
std::string OSB_LIB::RatingFn::currency_ [private] |
Oid OSB_LIB::RatingFn::oid_ [private] |
TypeId<Unit> OSB_LIB::RatingFn::unitId_ [private] |