OSB_LIB::Tariff Class Reference

Inheritance diagram for OSB_LIB::Tariff:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Tariff of a tariff class, tariff period pair.

This class stores the unique id, name and description of the tariff that defines the rating of the network usage for a given tariff class and tariff period.

Definition at line 209 of file tariff.h.

Public Types

Public Member Functions

Read access to data members
Modify data members

Private Member Functions

Modifying database operations:

Private Attributes

Friends


Member Typedef Documentation

typedef Id<Tariff> OSB_LIB::Tariff::Oid

Type-safe, unique id of a tariff.

Definition at line 227 of file tariff.h.


Constructor & Destructor Documentation

OSB_LIB::Tariff::Tariff ( const Oid oid = Oid()  ) 

Default constructor with optional object id.


Member Function Documentation

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

This function allow tariff to insert itself into database.

The object's id is not set before the function call. If the function completed successfully, the object will have it's id set, else the id will still be the same (not set).

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

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

Get unique id of tariff.

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

This function allow tariff to read itself from database.

Object id must be set before the function call. The id is used to retrieve other details from database and populate the object.

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

bool OSB_LIB::Tariff::remove ( const OSB_DB::Session session  )  [private]

This function allow tariff to remove itself from database.

Object id must be set before the function call. The id will be unset if the function completed successfully, else no changes to the object.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object is not editable.
  • Object to be removed not found.

bool OSB_LIB::Tariff::rounded (  )  const

Get round flag of tariff.

void OSB_LIB::Tariff::setRounded ( bool  rounded  ) 

Set round flag of tariff.

This function set the round flag of the tariff object. The new flag will only be updated in the database after the updTariff function is called.

Parameters:
rounded Round flag of tariff.

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

This function allow tariff to update itself into database.

This function will update an existing tairff object in the database. If the function completed successfully, the object's objVs will increment by 1.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object does not exist.


Friends And Related Function Documentation

friend struct OSB_DB::TariffGw [friend]

The database gateway needs to populate data members after construction.

Definition at line 219 of file tariff.h.

friend class OSB_DB::TariffSystemGw [friend]

Allow create function at the gateway to assign unique id to newly created tariff objects.

Definition at line 214 of file tariff.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 224 of file tariff.h.


Member Data Documentation

Oid OSB_LIB::Tariff::oid_ [private]

Unique id of tariff.

Definition at line 317 of file tariff.h.

bool OSB_LIB::Tariff::rounded_ [private]

Flag if round volume?

Definition at line 318 of file tariff.h.


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