This class will take in rated origin and destination as connection point object. With the help of connection point tree, it will be able to successfully determine the applicable tariff zone, that has been configured in TzConfig object, for the rated origin and destination pair.
Definition at line 370 of file tcdist.h.
typedef std::auto_ptr<DistTcs> OSB_LIB::DistTcs::AutoPtr |
Short-cut for an auto pointer.
For details see quality manual, implementation patterns: Virtual copy construction.
Reimplemented from OSB_LIB::TcsVersion.
typedef std::multimap< Id<ConnectionPt>, TzConfig> OSB_LIB::DistTcs::Config [private] |
typedef std::map<TariffZone::Oid, TariffClass::Oid> OSB_LIB::DistTcs::ZoneClassMap |
OSB_LIB::DistTcs::DistTcs | ( | const TcSystem::Oid & | tcsId | ) | [explicit] |
Constructor a distance tariff system object.
tcsId | Object id of the tariff classification system. |
void OSB_LIB::DistTcs::addZone | ( | const TariffZone::Oid & | tzOid, | |
const TariffClass::Oid & | tcOid | |||
) |
Add a new "tariff zone/tariff class" pair to map.
tzOid | Unique object id of tariff zone to be added. | |
tcOid | Unique object id of tariff class to be added. |
OsbException | for the following errors:
|
bool OSB_LIB::DistTcs::canFreeze | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | const [private, virtual] |
Criteria checking before setting the status from editable to standby.
In order to set the status from editable to standby, the following criteria must be fulfilled:
session | Database session to use. | |
errors | Container for detected errors. |
Implements OSB_LIB::TcsVersion.
virtual bool OSB_LIB::DistTcs::canRelease | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | const [private, virtual] |
Criteria checking before setting the status from standby to release.
In order to set the status from standby to release, the following criteria must be fulfilled:
session | Database session to use. | |
errors | Container for detected errors. |
Implements OSB_LIB::TcsVersion.
virtual bool OSB_LIB::DistTcs::canRevoke | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | const [private, virtual] |
Criteria checking before setting the status from release to standby.
No specific checking is required.
session | Database session to use. | |
errors | Container for detected errors. |
Implements OSB_LIB::TcsVersion.
virtual bool OSB_LIB::DistTcs::canUnfreeze | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | const [private, virtual] |
Criteria checking before setting the status from standby to editable.
No specific checking is required.
session | Database session to use. | |
errors | Container for detected errors. |
Implements OSB_LIB::TcsVersion.
AutoPtr OSB_LIB::DistTcs::clone | ( | ) | const |
Virtual copy construction.
For details see quality manual, implementation patterns.
Reimplemented from OSB_LIB::TcsVersion.
virtual TcsVersion* OSB_LIB::DistTcs::clone_ | ( | ) | const [private, virtual] |
Virtual copy construction.
For details see quality manual, implementation patterns.
Implements OSB_LIB::TcsVersion.
void OSB_LIB::DistTcs::copyCfg | ( | const OSB_LIB::TcsVersion * | src | ) | [virtual] |
Get configuration from another TCS version.
src | TCS version from which to copy the configuration. |
OsbException | if src has a different TCS type. |
Implements OSB_LIB::TcsVersion.
virtual bool OSB_LIB::DistTcs::delSpecific | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Remove specific data members from database.
session | Database session to use. |
Implements OSB_LIB::TcsVersion.
bool OSB_LIB::DistTcs::findDest | ( | Id< ConnectionPt > & | dest, | |
const DateTime & | ts | |||
) | const [private] |
Find the configured destination.
dest | Oid of the destination connection point. | |
ts | Time stamp. |
TariffZone::Oid OSB_LIB::DistTcs::findTzOid | ( | Id< ConnectionPt > & | origin, | |
const DateTime & | ts, | |||
const Id< ConnectionPt > & | dest | |||
) | const [private] |
Find tariff zone id.
origin | Origin to start the search with. After the function returns it contains the connection point that matched a tariff zone. | |
ts | Time stamp. | |
dest | Oid of the destination connection point. |
const TariffClass::Oid& OSB_LIB::DistTcs::getTariffClass | ( | const TariffZone::Oid & | tzOid | ) | const [private] |
Get the corresponding tariff class id to a tariff zone id from the "tariff-zone tariff-class map".
tzOid | Object id of the tariff zone. |
virtual TariffClass::Oid OSB_LIB::DistTcs::getTc | ( | Cdr & | cdr, | |
UsedService & | service | |||
) | const [virtual] |
Get the tariff class for the mapped origin and destination.
This function will internally create a list of tariff zone configs if neccessary. The creation of this list causes the function to be not thread safe.
cdr | Call record to classify. | |
service | Service for which to determine the tariff zone and class. The function populates tariff info members where appropriate. |
Implements OSB_LIB::TcsVersion.
virtual bool OSB_LIB::DistTcs::insSpecific | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Insert specific data members into database.
session | Database session to use. |
Implements OSB_LIB::TcsVersion.
void OSB_LIB::DistTcs::populate | ( | ) | const [private] |
virtual bool OSB_LIB::DistTcs::readSpecific | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Read specific data members from database.
session | Database session to use. |
Implements OSB_LIB::TcsVersion.
void OSB_LIB::DistTcs::removeZone | ( | const TariffZone::Oid & | tzOid | ) |
Remove a "tariff zone/tariff class" pair from map.
tzOid | Unique object id of tariff zone to be removed. |
OsbException | for the following errors:
|
void OSB_LIB::DistTcs::supportedTc | ( | std::set< TariffClass::Oid > & | tcOids | ) | const |
Return all tariff classes supported.
This function will retrieve all tariff classes supported by this tariff classification system version. All retrieved tariff classes are place in the std::set container passed in.
tcOids | Container for the object id of all tariff classes supported. |
virtual TcSystem::TcsType OSB_LIB::DistTcs::type | ( | ) | const [virtual] |
virtual bool OSB_LIB::DistTcs::updSpecific | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Update specific data members into database.
session | Database session to use. |
Implements OSB_LIB::TcsVersion.
const ZoneClassMap& OSB_LIB::DistTcs::zcMap | ( | ) | const [inline] |
friend struct OSB_DB::DistTcsGw [friend] |
Config OSB_LIB::DistTcs::config_ [mutable, private] |
Copy of configured tariff zone configs. This is declared as mutable because it will be populated via function populate() in the constant function function getTc(), which by right, should not modify any data members.
const TcSystem::TcsType OSB_LIB::DistTcs::type_ = TcSystem::tcsDist [static, private] |
ZoneClassMap OSB_LIB::DistTcs::zcMap_ [private] |