OSB_LIB::TpsVersion Class Reference

Inheritance diagram for OSB_LIB::TpsVersion:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Class TpsVersion.

In this class, it store all of information about tariff period system version attributes and configuration. It also provide fucntions to access and change those attributes and configuration.

Definition at line 760 of file tariffperiod.h.

Public Types

Public Member Functions

Private Member Functions

Modifying database operations:
Status changes:

Private Attributes

Friends


Member Typedef Documentation

typedef Id2<TpsVersion> OSB_LIB::TpsVersion::Oid

Type of object id of tariff period system version.

Definition at line 771 of file tariffperiod.h.


Constructor & Destructor Documentation

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

Default constructor with optional object id.

OSB_LIB::TpsVersion::TpsVersion ( const TpSystem::Oid tpsId  )  [explicit]

Constructor for a new TPS version.


Member Function Documentation

const TpsConfig& OSB_LIB::TpsVersion::config (  )  const

Read access to the switch times.

bool OSB_LIB::TpsVersion::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 errors and warnings.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

TariffPeriod::Oid OSB_LIB::TpsVersion::getTp ( const DateTime ts  )  const

Determine the tariff period for a time-stamp.

Parameters:
ts Time-stamp for which to determine the tariff period.
Returns:
The id of the tariff period for ts. It is not set if the tariff period can not be determined.

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

Insert a tariff period system version 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::TpsVersion::oid (  )  const

Get object id.

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

Read a tariff period system version 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::TpsVersion::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 errors and warnings.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

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

Remove a tariff period system version 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::TpsVersion::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 errors and warnings.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

void OSB_LIB::TpsVersion::setConfig ( const TpsConfig cfg  ) 

Set the configuration.

Parameters:
cfg New configuration to use.
Exceptions:
OsbException if status is not editable.

void OSB_LIB::TpsVersion::supportedTp ( std::set< TariffPeriod::Oid > &  tpOids  )  const

Retrieve all tariff periods supported.

Parameters:
tpOids Container for the object id of the tariff periods supported.

TpSystem::Oid OSB_LIB::TpsVersion::tpsId (  )  const

Get the tariff period system id.

bool OSB_LIB::TpsVersion::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 errors and warnings.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

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

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

Gateway need to populate data members.

Definition at line 762 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 768 of file tariffperiod.h.


Member Data Documentation

TpsConfig OSB_LIB::TpsVersion::config_ [private]

Configuration: list of switch-over times.

Definition at line 956 of file tariffperiod.h.

Oid OSB_LIB::TpsVersion::oid_ [private]

Unique object id and database link.

Definition at line 954 of file tariffperiod.h.


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