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.
OSB_LIB::ToVersion::ToVersion | ( | ) | [protected] |
Default constructor.
virtual OSB_LIB::ToVersion::~ToVersion | ( | ) | [protected, virtual] |
Virtual empty destructor.
const std::string& OSB_LIB::ToVersion::name | ( | ) | const |
Name of tariff version.
long OSB_LIB::ToVersion::objVs | ( | ) | const [protected] |
Get object version.
Prevent assignment through base class.
virtual void OSB_LIB::ToVersion::setName | ( | const std::string & | name | ) | [virtual] |
Set the name.
name | Name for tariff object. |
OsbException | if name is empty. | |
OsbException | if name is too long. |
std::string OSB_LIB::ToVersion::name_ [protected] |
long OSB_LIB::ToVersion::objVs_ [protected] |
Object version: set by the gateways during database operations.
Definition at line 271 of file tariffobject.h.