OSB_LIB::TariffPeriod Class Reference

Inheritance diagram for OSB_LIB::TariffPeriod:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Class tariff period.

The class stores the information about a tariff period and provide the functionality to access and modify the tariff period attributes and configurations.

Definition at line 500 of file tariffperiod.h.

Database operations:

Public Types

Public Member Functions

Private Attributes

Friends


Member Typedef Documentation

typedef Id<TariffPeriod> OSB_LIB::TariffPeriod::Oid

Type of object id of tariff period.

Definition at line 511 of file tariffperiod.h.


Constructor & Destructor Documentation

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

Default constructor with optional object id.


Member Function Documentation

std::string OSB_LIB::TariffPeriod::color (  )  const [inline]

Get the color.

Definition at line 521 of file tariffperiod.h.

References color_.

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

Insert a tariff period 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.

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

Get object id.

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

Read a tariff period 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::TariffPeriod::remove ( const OSB_DB::Session session  )  [private]

Remove a tariff period 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.

void OSB_LIB::TariffPeriod::setColor ( const std::string &  color  ) 

Set the color.

Parameters:
color New color.

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

Update a tariff period 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::TariffPeriodGw [friend]

Gateway need to populate the data members.

Definition at line 502 of file tariffperiod.h.

friend class TariffCatalogue [friend]

Tariff Catalogue is the only object that is allow to invoke the private functions of this class.

Definition at line 508 of file tariffperiod.h.


Member Data Documentation

std::string OSB_LIB::TariffPeriod::color_ [private]

GUI color of the tariff period, format: #RRGGBB.

Definition at line 593 of file tariffperiod.h.

Referenced by color().

Oid OSB_LIB::TariffPeriod::oid_ [private]

Unique id and database link.

Definition at line 591 of file tariffperiod.h.


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