A tariff classification system classifies usage records into classes for which the same tariff period system is used to determine the applicable tariff.
It is not possible to change the type of tariff classification system. Instead a new TCS must be created in the tariff catalogue (and the obsolete one deleted).
Definition at line 210 of file tariffclass.h.
typedef Id<TcSystem> OSB_LIB::TcSystem::Oid |
Available tariff classification system types.
tcsUnknown | Unknown TCS type. |
tcsDist | DistTcs (see there). |
tcsMapping | MappingDistTcs (see there). |
Definition at line 223 of file tariffclass.h.
Constructor with optional object id.
Constructor with only object id given. Object constructed should call read(...) to populate its data members.
bool OSB_LIB::TcSystem::insert | ( | const OSB_DB::Session & | session | ) | [private] |
Insert a tariff classification system into database.
A new object is inserted. All attributes of the object has been set except object id. The object id will only be set by the function if the insertion is successful.
session | Database session. |
OsbException | for the following errors:
|
Convert a long into a TCS type.
t | Value to convert. |
const Oid& OSB_LIB::TcSystem::oid | ( | ) | const |
Get unique id of tariff classification system.
bool OSB_LIB::TcSystem::read | ( | const OSB_DB::Session & | session | ) |
Read a tariff classification system from database.
The object id is used to gather other info from database and then populate all the object's data members.
session | Database session. |
bool OSB_LIB::TcSystem::remove | ( | const OSB_DB::Session & | session | ) | [private] |
Remove a tariff classification system from database.
After the function call, oid of this object will be unset to indicate that there is no such entry anymore in the database.
session | Database session. |
OsbException | for the following errors:
|
void OSB_LIB::TcSystem::setTcsType | ( | TcsType | tcsType | ) |
Set the tariff classification system type.
tcsType | New type of the TC system. |
OsbException | if a version with a type other than tcsType exists. |
const std::set<TariffClass::Oid> OSB_LIB::TcSystem::supportedTc | ( | ) | const |
Get list of supported tariff classes.
TcsType OSB_LIB::TcSystem::tcsType | ( | ) | const |
Get the type of the tariff classification system.
Convert a TCS type into long.
t | TCS type to convert. |
bool OSB_LIB::TcSystem::update | ( | const OSB_DB::Session & | session | ) | [private] |
Update a tariff classification system in the database.
Old entry in the database indentify by the object id will be replaced with the new data from the passed in, upated object.
session | Database session used. |
OsbException | for the following erros:
|
friend struct OSB_DB::TcSystemGw [friend] |
Database gateway needs to populate private data members.
Definition at line 212 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 217 of file tariffclass.h.
Oid OSB_LIB::TcSystem::oid_ [private] |
TcsType OSB_LIB::TcSystem::tcsType_ [private] |