OSB_LIB::ToVersion Class Reference

Inheritance diagram for OSB_LIB::ToVersion:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class for tariff object versions.

This base class defines a uniform interface for all classes supporting tariff object versions.

Versions of tariff objects habe a typesafe object identifier Id2, the first part identifies the tariff object and the second part provides the version number. Because the template Id2 is type specific the base can not define the object id.

Derived classes should implement the object id as follows:

      // models the version of a tariff system
      class TsVersion : public ToVersion {
      public:
          // Typesafe object identifier.
          typedef Id2<TsVersion> Oid;
      public:
          // Default constructor with optional id of tariff object.
          explicit TsVersion(
              const TariffSystem::Oid& tsId = TariffSystem::Oid()
          ) : Oid(tsId.id())
          {
              // ... whatever is needed
          }

          // Read access to object id.
          const Oid& oid() const { return oid_; };
          // Id of the tariff system
          TariffSystem::Oid tsId()  const
          {
              return TariffSystem::Oid(oid_.id1_);
          }
      private:
          // Object identifier, database link.
          Oid oid_;
      }

Definition at line 238 of file tariffobject.h.

Public Member Functions

Protected Member Functions

Protected Attributes


Constructor & Destructor Documentation

OSB_LIB::ToVersion::ToVersion (  )  [protected]

Default constructor.

Note:
Derived classes should provide a default constructor with optional object id (see class description).

virtual OSB_LIB::ToVersion::~ToVersion (  )  [protected, virtual]

Virtual empty destructor.


Member Function Documentation

const std::string& OSB_LIB::ToVersion::name (  )  const

Name of tariff version.

long OSB_LIB::ToVersion::objVs (  )  const [protected]

Get object version.

ToVersion& OSB_LIB::ToVersion::operator= ( const ToVersion rhs  )  [protected]

Prevent assignment through base class.

virtual void OSB_LIB::ToVersion::setName ( const std::string &  name  )  [virtual]

Set the name.

Parameters:
name Name for tariff object.
Exceptions:
OsbException if name is empty.
OsbException if name is too long.


Member Data Documentation

std::string OSB_LIB::ToVersion::name_ [protected]

Name of tariff object.

Definition at line 268 of file tariffobject.h.

long OSB_LIB::ToVersion::objVs_ [protected]

Object version: set by the gateways during database operations.

Definition at line 271 of file tariffobject.h.


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