In this class, it store all of information about tariff period system version attributes and configuration. It also provide fucntions to access and change those attributes and configuration.
Definition at line 760 of file tariffperiod.h.
typedef Id2<TpsVersion> OSB_LIB::TpsVersion::Oid |
Default constructor with optional object id.
OSB_LIB::TpsVersion::TpsVersion | ( | const TpSystem::Oid & | tpsId | ) | [explicit] |
Constructor for a new TPS version.
const TpsConfig& OSB_LIB::TpsVersion::config | ( | ) | const |
Read access to the switch times.
bool OSB_LIB::TpsVersion::freeze | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Set 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 errors and warnings. |
Implements OSB_LIB::ToCfgBase.
TariffPeriod::Oid OSB_LIB::TpsVersion::getTp | ( | const DateTime & | ts | ) | const |
Determine the tariff period for a time-stamp.
ts | Time-stamp for which to determine the tariff period. |
bool OSB_LIB::TpsVersion::insert | ( | const OSB_DB::Session & | session | ) | [private] |
Insert a tariff period system version 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:
|
const Oid& OSB_LIB::TpsVersion::oid | ( | ) | const |
Get object id.
bool OSB_LIB::TpsVersion::read | ( | const OSB_DB::Session & | session | ) |
Read a tariff period system version 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::TpsVersion::release | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Set 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 errors and warnings. |
Implements OSB_LIB::ToCfgBase.
bool OSB_LIB::TpsVersion::remove | ( | const OSB_DB::Session & | session | ) | [private] |
Remove a tariff period system version 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:
|
bool OSB_LIB::TpsVersion::revoke | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Set the status from release to standby.
In order to set the status from release to standby, the following criteria must be fulfilled:
session | Database session to use. | |
errors | Container for errors and warnings. |
Implements OSB_LIB::ToCfgBase.
void OSB_LIB::TpsVersion::setConfig | ( | const TpsConfig & | cfg | ) |
Set the configuration.
cfg | New configuration to use. |
OsbException | if status is not editable. |
void OSB_LIB::TpsVersion::supportedTp | ( | std::set< TariffPeriod::Oid > & | tpOids | ) | const |
Retrieve all tariff periods supported.
tpOids | Container for the object id of the tariff periods supported. |
TpSystem::Oid OSB_LIB::TpsVersion::tpsId | ( | ) | const |
Get the tariff period system id.
bool OSB_LIB::TpsVersion::unfreeze | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Set the status from standby to editable.
In order to set the status from standby to editable, the following criteria must be fulfilled:
session | Database session to use. | |
errors | Container for errors and warnings. |
Implements OSB_LIB::ToCfgBase.
bool OSB_LIB::TpsVersion::update | ( | const OSB_DB::Session & | session | ) | [private] |
Update a tariff period system version 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::TpsVersionGw [friend] |
friend class TariffCatalogue [friend] |
Tariff Catalogue is the only object that is allow to invoke the private functions of this class.
Definition at line 768 of file tariffperiod.h.
TpsConfig OSB_LIB::TpsVersion::config_ [private] |
Oid OSB_LIB::TpsVersion::oid_ [private] |