OSB_LIB::TcsVersion Class Reference

Inheritance diagram for OSB_LIB::TcsVersion:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract class that serves as the base of all tariff classification system.

Definition at line 353 of file tariffclass.h.

Database operations:

Public Types

Public Member Functions

Read access to data members
Status changes:

Protected Member Functions

Private Member Functions

Specific criteria checking before status changes:
These are pure virtual functions that must be reimplement by all derieved classes. Every individual derieved class implementation will have to check for their specific requirement before changing the status. For derieved classes that do not have any specific criteria checking should return true.

Specific database operations for derived classes.
The following functions are used to perform derived class specific database operations. If a derived classes does not need a specific database operation, it must implement the respective function to return true.

Private Attributes

Friends


Member Typedef Documentation

typedef std::auto_ptr<TcsVersion> OSB_LIB::TcsVersion::AutoPtr

Short-cut for an auto pointer.

For details see quality manual, implementation patterns: Virtual copy construction.

Reimplemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

Definition at line 377 of file tariffclass.h.

typedef Id2<TcsVersion> OSB_LIB::TcsVersion::Oid

Unique id of tariff classification system and version number of tariff classification system configuration are kept in template Id2.

Definition at line 370 of file tariffclass.h.


Constructor & Destructor Documentation

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

Create a tariff classification system version.

Parameters:
tcsId Object id of the tariff classification system.

virtual OSB_LIB::TcsVersion::~TcsVersion (  )  [virtual]

Virtual destructor.


Member Function Documentation

virtual bool OSB_LIB::TcsVersion::canFreeze ( const OSB_DB::Session session,
OsbErrors errors 
) const [private, pure virtual]

Criteria checking before setting the status from editable to standby.

Parameters:
session Database session used.
errors Container for detected errors.
Returns:
true if the TCS version can be freezed, else false.

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

virtual bool OSB_LIB::TcsVersion::canRelease ( const OSB_DB::Session session,
OsbErrors errors 
) const [private, pure virtual]

Criteria checking before setting the status from standby to release.

Parameters:
session Database session used.
errors Container for detected errors.
Returns:
true if the TCS version can be released, else false.

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

virtual bool OSB_LIB::TcsVersion::canRevoke ( const OSB_DB::Session session,
OsbErrors errors 
) const [private, pure virtual]

Criteria checking before setting the status from release to standby.

Parameters:
session Database session used.
errors Container for detected errors.
Returns:
true if the TCS version can be revoked, else false.

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

virtual bool OSB_LIB::TcsVersion::canUnfreeze ( const OSB_DB::Session session,
OsbErrors errors 
) const [private, pure virtual]

Criteria checking before setting the status from standby to editable.

Parameters:
session Database session used.
errors Container for detected errors.
Returns:
true if the TCS version can be unfreezed, else false.

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

AutoPtr OSB_LIB::TcsVersion::clone (  )  const

Virtual copy construction.

For details see quality manual, implementation patterns.

Reimplemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

virtual TcsVersion* OSB_LIB::TcsVersion::clone_ (  )  const [private, pure virtual]

Virtual copy construction.

For details see quality manual, implementation patterns.

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

virtual void OSB_LIB::TcsVersion::copyCfg ( const TcsVersion src  )  [pure 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.

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

virtual bool OSB_LIB::TcsVersion::delSpecific ( const OSB_DB::Session session  )  [private, pure virtual]

Remove derived class specific data members from database.

Parameters:
session Database session.
Returns:
true if success else false.
Remarks:
Derived classes should return false if unexpectedly no specific data are deleted in the database. This is because the missing data indicate an inconsistent status either in the application or the database.

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

bool OSB_LIB::TcsVersion::freeze ( const OSB_DB::Session session,
OsbErrors errors 
) [virtual]

Set the status from editable to standby.

In order to freeze a tariff classification system version, the following criteria must be fulfilled:

Parameters:
session Database session used.
errors Container for detected errors.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

virtual TariffClass::Oid OSB_LIB::TcsVersion::getTc ( Cdr cdr,
UsedService service 
) const [pure virtual]

Get the tariff class applicable.

Parameters:
cdr Call record to classify.
service Used service to classify.
Returns:
The id of the determined tariff class.
It is not set if the tariff class can not be determined, an appropriate error must be stored in cdr in the case.

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

bool OSB_LIB::TcsVersion::insert ( const OSB_DB::Session session  )  [private]

This function allow a tariff system version 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).

Parameters:
session database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Duplicate name.

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

Insert derived class specific data members into database.

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

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

template<typename T>
const T * OSB_LIB::TcsVersion::isa ( const T *&  ptr  )  const

Downcasting: see template<typename T> T* isa(T*& ptr).

Definition at line 930 of file tariffclass.h.

template<typename T>
T * OSB_LIB::TcsVersion::isa ( T *&  ptr  ) 

Downcast to a derived class.

The function uses dynamic_cast<T*> to downcast an object of TcsVersion to an object of a derived class.

          ptr = dynamic_cast<T*>(this);
          return ptr;

An example is given below:

          class DerivedTcs : public TcsVersion {
              ...
          };

          void foo(const TcsVersion& tcsVs)
          {
              ...
              DerivedTcs *pTcs;
              if (0 != tcsVs.isa(pTcs)) {
                  // work with newTcs.
              }
          }

Parameters:
ptr Pointer to cast to. It gets the result of the downcast. It's value will be 0 if the cast fails.
Returns:
The argument pointer `ptr' after the downcast.

Definition at line 924 of file tariffclass.h.

const Oid& OSB_LIB::TcsVersion::oid (  )  const

Return the oid of this tarif classification system version.

TcsVersion& OSB_LIB::TcsVersion::operator= ( const TcsVersion rhs  )  [protected]

Assignment operator.

Remarks:
The operator is protected in order to avoid partial assignments of derived classes through pointers or references to the base class.

bool OSB_LIB::TcsVersion::read ( const OSB_DB::Session session  ) 

This function allow a tariff system version 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.

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

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

Read derived class specific data members from database.

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

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

bool OSB_LIB::TcsVersion::release ( const OSB_DB::Session session,
OsbErrors errors 
) [virtual]

Set the status from standby to release.

In order to release a tariff classification system version, the following criteria must be fulfilled:

Afterwards the virtual member canRelease() is called for any TCS type specific checks.

Parameters:
session Database session used.
errors Container for detected errors.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

bool OSB_LIB::TcsVersion::remove ( const OSB_DB::Session session  )  [private]

This function allow tariff system version 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.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object is not editable.

bool OSB_LIB::TcsVersion::revoke ( const OSB_DB::Session session,
OsbErrors errors 
) [virtual]

Set the status from release to standby.

In order to revoke a tariff classification system version, the following criteria must be fulfilled:

Parameters:
session Database session used.
errors Container for detected errors.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

virtual void OSB_LIB::TcsVersion::supportedTc ( std::set< TariffClass::Oid > &  tcOids  )  const [pure virtual]

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.

const TcSystem::Oid OSB_LIB::TcsVersion::tcsId (  )  const

Return the tariff classification system id.

virtual TcSystem::TcsType OSB_LIB::TcsVersion::type (  )  const [pure virtual]

Return the type of tariff classification system version.

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

bool OSB_LIB::TcsVersion::unfreeze ( const OSB_DB::Session session,
OsbErrors errors 
) [virtual]

Set the status from standby to editable.

In order to unfreeze a tariff classification system version, the following criteria must be fulfilled:

Parameters:
session Database session used.
errors Container for detected errors.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

bool OSB_LIB::TcsVersion::update ( const OSB_DB::Session session  )  [private]

This function allow tariff system version to update itself into database.

This function will update an existing tariff system version object in the database. If the function completed successfully, the object's objVs will increment by 1.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object does not exist.

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

Update derived class specific data members into database.

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

Implemented in OSB_LIB::DistTcs, and OSB_LIB::MappingDistTcs.

long OSB_LIB::TcsVersion::vs (  )  const

Return the version number of tariff classification system.


Friends And Related Function Documentation

friend struct OSB_DB::TcsVersionGw [friend]

The database gateway need to populate data members after construction.

Definition at line 358 of file tariffclass.h.

friend class TariffCatalogue [friend]

The tariff catalogue is the only object that is allow to invoke the database functions of this class.

Definition at line 363 of file tariffclass.h.


Member Data Documentation

Oid OSB_LIB::TcsVersion::oid_ [private]

Unique id of this object.

Definition at line 766 of file tariffclass.h.


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