This class will classified the week days to different day classes, in addition, for those date needed to be classified specially, they will be stored into special date definitions. This class also support functions like accessors and modification to its members.
Definition at line 85 of file tariffperiod.h.
typedef Id<DayClass> OSB_LIB::DayClass::Oid |
Default constructor with optional object id.
bool OSB_LIB::DayClass::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 error messages if any. |
Implements OSB_LIB::ToCfgBase.
bool OSB_LIB::DayClass::insert | ( | const OSB_DB::Session & | session | ) | [private] |
Insert a date class 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:
|
bool OSB_LIB::DayClass::matchWeekDay | ( | const Weekday & | weekday | ) | const |
Match whether a given week day is in day class.
weekday | The given week day. |
const Oid& OSB_LIB::DayClass::oid | ( | ) | const |
Get object id.
bool OSB_LIB::DayClass::read | ( | const OSB_DB::Session & | session | ) |
Read a date class 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::DayClass::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 error messages if any. |
Implements OSB_LIB::ToCfgBase.
bool OSB_LIB::DayClass::remove | ( | const OSB_DB::Session & | session | ) | [private] |
Remove a date class 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::DayClass::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 error messages if any. |
Implements OSB_LIB::ToCfgBase.
bool OSB_LIB::DayClass::setWeekday | ( | Weekday | wd, | |
bool | add | |||
) |
Add or remove a weekday.
wd | Weekday to add or remove. | |
add | Flag to add (true) or remove (false) the weekday. |
OsbException | if the status is not editable. |
bool OSB_LIB::DayClass::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 error messages if any. |
Implements OSB_LIB::ToCfgBase.
bool OSB_LIB::DayClass::update | ( | const OSB_DB::Session & | session | ) | [private] |
Update a date class 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::DayClassGw [friend] |
friend class TariffCatalogue [friend] |
Let the class TariffCatalogue access to private function addDayClass, delDayClass, and modifyDayClass to prevent others from accessing.
Definition at line 95 of file tariffperiod.h.
bool OSB_LIB::DayClass::fri_ [private] |
bool OSB_LIB::DayClass::mon_ [private] |
Oid OSB_LIB::DayClass::oid_ [private] |
bool OSB_LIB::DayClass::sat_ [private] |
bool OSB_LIB::DayClass::sun_ [private] |
bool OSB_LIB::DayClass::thu_ [private] |
bool OSB_LIB::DayClass::tue_ [private] |
bool OSB_LIB::DayClass::wed_ [private] |