OSB_LIB::DistTcs Class Reference

Inheritance diagram for OSB_LIB::DistTcs:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

This is the second part of a distance sensitive tariff classification system. It will determine the tariff zone applied to a <rated-origin, rated-destination> pair.

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.

Public Types

Public Member Functions

Private Types

Private Member Functions

Specific criteria checking before status changes:
Class specific database operations:
Utility member functions:

Private Attributes

Static Private Attributes

Friends


Member Typedef Documentation

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.

Definition at line 391 of file tcdist.h.

typedef std::multimap< Id<ConnectionPt>, TzConfig> OSB_LIB::DistTcs::Config [private]

STL container to store the TZ configurations.

Its key is the connection point of the destination.

Definition at line 381 of file tcdist.h.

typedef std::map<TariffZone::Oid, TariffClass::Oid> OSB_LIB::DistTcs::ZoneClassMap

STL containers to manage tariff zone/tariff class pairs.

Definition at line 388 of file tcdist.h.


Constructor & Destructor Documentation

OSB_LIB::DistTcs::DistTcs ( const TcSystem::Oid tcsId  )  [explicit]

Constructor a distance tariff system object.

Parameters:
tcsId Object id of the tariff classification system.


Member Function Documentation

void OSB_LIB::DistTcs::addZone ( const TariffZone::Oid tzOid,
const TariffClass::Oid tcOid 
)

Add a new "tariff zone/tariff class" pair to map.

Parameters:
tzOid Unique object id of tariff zone to be added.
tcOid Unique object id of tariff class to be added.
Exceptions:
OsbException for the following errors:
  • Oid of tariff zone already exist.
  • DistTcs is not in status "editable".

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:

Parameters:
session Database session to use.
errors Container for detected errors.
Returns:
true if the TCS version can be freezed.

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:

Parameters:
session Database session to use.
errors Container for detected errors.
Returns:
true if the TCS version can be released.

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.

Parameters:
session Database session to use.
errors Container for detected errors.
Returns:
Always true.

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.

Parameters:
session Database session to use.
errors Container for detected errors.
Returns:
Always true.

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.

Parameters:
src TCS version from which to copy the configuration.
Exceptions:
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.

Parameters:
session Database session to use.
Returns:
true if success else false.

Implements OSB_LIB::TcsVersion.

bool OSB_LIB::DistTcs::findDest ( Id< ConnectionPt > &  dest,
const DateTime ts 
) const [private]

Find the configured destination.

Parameters:
dest Oid of the destination connection point.
ts Time stamp.
Returns:
true if found else false.

TariffZone::Oid OSB_LIB::DistTcs::findTzOid ( Id< ConnectionPt > &  origin,
const DateTime ts,
const Id< ConnectionPt > &  dest 
) const [private]

Find tariff zone id.

Parameters:
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.
Returns:
The id of the found tariff zone. It is not set if no matching tariff zone can be found.
Remarks:
Callers of the function must not rely on the value of origin if not matching tariff zone can be found (usually it will be not set).

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".

Parameters:
tzOid Object id of the tariff zone.
Returns:
Object id of the tariff class retrived.

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.

Parameters:
cdr Call record to classify.
service Service for which to determine the tariff zone and class.
The function populates tariff info members where appropriate.
Returns:
The id of the determined tariff class.
It is not set, if no match tariff class can be found.
Remarks:
If the tariff class can not be determined, the the following tariff information remains unchanged:

Implements OSB_LIB::TcsVersion.

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

Insert specific data members into database.

Parameters:
session Database session to use.
Returns:
true if success else false.

Implements OSB_LIB::TcsVersion.

void OSB_LIB::DistTcs::populate (  )  const [private]

Populate the data member config_.

This function copies the configuration of the tariff zones that are part of the TCS into config_.

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

Read specific data members from database.

Parameters:
session Database session to use.
Returns:
true if success else false.

Implements OSB_LIB::TcsVersion.

void OSB_LIB::DistTcs::removeZone ( const TariffZone::Oid tzOid  ) 

Remove a "tariff zone/tariff class" pair from map.

Parameters:
tzOid Unique object id of tariff zone to be removed.
Exceptions:
OsbException for the following errors:
  • Oid of tariff zone does not exist.
  • DistTcs is not in status "editable".

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.

Parameters:
tcOids Container for the object id of all tariff classes supported.

virtual TcSystem::TcsType OSB_LIB::DistTcs::type (  )  const [virtual]

return the actual type of tariff classification system.

Implements OSB_LIB::TcsVersion.

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

Update specific data members into database.

Parameters:
session Database session to use.
Returns:
true if success else false.

Implements OSB_LIB::TcsVersion.

const ZoneClassMap& OSB_LIB::DistTcs::zcMap (  )  const [inline]

Get the mapping pairs of tariff classes and tariff zones.

Definition at line 410 of file tcdist.h.

References zcMap_.


Friends And Related Function Documentation

friend struct OSB_DB::DistTcsGw [friend]

The database gateway need to populate data members.

Definition at line 374 of file tcdist.h.


Member Data Documentation

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.

Definition at line 655 of file tcdist.h.

const TcSystem::TcsType OSB_LIB::DistTcs::type_ = TcSystem::tcsDist [static, private]

The type of tariff classification system version.

Definition at line 384 of file tcdist.h.

ZoneClassMap OSB_LIB::DistTcs::zcMap_ [private]

Mapping info from a tariff zone id to a tariff class id.

Definition at line 658 of file tcdist.h.

Referenced by zcMap().


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