OSB_LIB::DayClass Class Reference

Inheritance diagram for OSB_LIB::DayClass:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Store the info about day definition.

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.

Public Types

Public Member Functions

Private Member Functions

Modifying database operations:
Status changes:

Private Attributes

Friends


Member Typedef Documentation

typedef Id<DayClass> OSB_LIB::DayClass::Oid

Type of object id of day class.

Definition at line 98 of file tariffperiod.h.


Constructor & Destructor Documentation

OSB_LIB::DayClass::DayClass ( const Oid oid = Oid()  )  [explicit]

Default constructor with optional object id.


Member Function Documentation

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:

Parameters:
session Database session to use.
errors Container for error messages if any.
Returns:
true if success else false.

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.

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

bool OSB_LIB::DayClass::matchWeekDay ( const Weekday weekday  )  const

Match whether a given week day is in day class.

Parameters:
weekday The given week day.
Returns:
Whether it can be matched.

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.

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

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:

Parameters:
session Database session to use.
errors Container for error messages if any.
Returns:
true if success else false.

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.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object not found.
  • Object has been modified.
  • Version object exists.

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:

Parameters:
session Database session to use.
errors Container for error messages if any.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

bool OSB_LIB::DayClass::setWeekday ( Weekday  wd,
bool  add 
)

Add or remove a weekday.

Parameters:
wd Weekday to add or remove.
add Flag to add (true) or remove (false) the weekday.
Returns:
Previous setting for the weekday.
Exceptions:
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:

Parameters:
session Database session to use.
errors Container for error messages if any.
Returns:
true if success else false.

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.

Parameters:
session Database session used.
Returns:
true if success else false.
Exceptions:
OsbException for the following erros:
  • Name too long.
  • Object not found.
  • Object has been modified.


Friends And Related Function Documentation

friend struct OSB_DB::DayClassGw [friend]

Gateway need to populate the data members.

Definition at line 89 of file tariffperiod.h.

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.


Member Data Documentation

bool OSB_LIB::DayClass::fri_ [private]

Check whether Fri is in this class.

Definition at line 268 of file tariffperiod.h.

bool OSB_LIB::DayClass::mon_ [private]

Check whether Mon is in this class.

Definition at line 264 of file tariffperiod.h.

Oid OSB_LIB::DayClass::oid_ [private]

Unique identifier: database link.

Definition at line 263 of file tariffperiod.h.

bool OSB_LIB::DayClass::sat_ [private]

Check whether Sat is in this class.

Definition at line 269 of file tariffperiod.h.

bool OSB_LIB::DayClass::sun_ [private]

Check whether Sun is in this class.

Definition at line 270 of file tariffperiod.h.

bool OSB_LIB::DayClass::thu_ [private]

Check whether Thu is in this class.

Definition at line 267 of file tariffperiod.h.

bool OSB_LIB::DayClass::tue_ [private]

Check whether Tue is in this class.

Definition at line 265 of file tariffperiod.h.

bool OSB_LIB::DayClass::wed_ [private]

Check whether Wed is in this class.

Definition at line 266 of file tariffperiod.h.


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