OSB_LIB::TcSystem Class Reference

Inheritance diagram for OSB_LIB::TcSystem:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Tariff classification system.

A tariff classification system classifies usage records into classes for which the same tariff period system is used to determine the applicable tariff.

It is not possible to change the type of tariff classification system. Instead a new TCS must be created in the tariff catalogue (and the obsolete one deleted).

Definition at line 210 of file tariffclass.h.

Public Types

Public Member Functions

Static Public Member Functions

Private Member Functions

Modifying database operations:

Private Attributes

Friends


Member Typedef Documentation

typedef Id<TcSystem> OSB_LIB::TcSystem::Oid

Type-safe, unique id of tariff classification system.

Definition at line 220 of file tariffclass.h.


Member Enumeration Documentation

enum OSB_LIB::TcSystem::TcsType

Available tariff classification system types.

Enumerator:
tcsUnknown  Unknown TCS type.
tcsDist  DistTcs (see there).
tcsMapping  MappingDistTcs (see there).

Definition at line 223 of file tariffclass.h.


Constructor & Destructor Documentation

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

Constructor with optional object id.

Constructor with only object id given. Object constructed should call read(...) to populate its data members.


Member Function Documentation

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

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

static TcsType OSB_LIB::TcSystem::mkTcsType ( long  t  )  throw () [static]

Convert a long into a TCS type.

Parameters:
t Value to convert.
Returns:
The corresponding tariff system type. Its value is tcsUnknown if `t' is not supported.

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

Get unique id of tariff classification system.

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

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

Remove a tariff classification system 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::TcSystem::setTcsType ( TcsType  tcsType  ) 

Set the tariff classification system type.

Parameters:
tcsType New type of the TC system.
Exceptions:
OsbException if a version with a type other than tcsType exists.

const std::set<TariffClass::Oid> OSB_LIB::TcSystem::supportedTc (  )  const

Get list of supported tariff classes.

Returns:
The set of tariff classes supported by any version of the TC system that is not editable.
It is empty if no freezed version exists.

TcsType OSB_LIB::TcSystem::tcsType (  )  const

Get the type of the tariff classification system.

static long OSB_LIB::TcSystem::toLong ( TcsType  t  )  throw () [static]

Convert a TCS type into long.

Parameters:
t TCS type to convert.
Returns:
The corresponding long value. Its value is (long)tcsUnknown if `t' is not supported.

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

Update a tariff classification system 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::TcSystemGw [friend]

Database gateway needs to populate private data members.

Definition at line 212 of file tariffclass.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 217 of file tariffclass.h.


Member Data Documentation

Oid OSB_LIB::TcSystem::oid_ [private]

Unique id of tariff zone.

Definition at line 337 of file tariffclass.h.

TcsType OSB_LIB::TcSystem::tcsType_ [private]

Type of TC system.

Definition at line 338 of file tariffclass.h.


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