The main purpose of this class is to define a unique interface for all tariff objects.
Because the OSB library uses typesafe object identifiers (see template class Id) this base class can not define the object id.
Derived classes should implement the object id as follows:
class TariffSystem : public TariffObject { public: // Typesafe object identifier. typedef Id<TariffSystem> Oid; public: // Default constructor with optional object id. explicit TariffSystem( const Oid& oid = Oid() ); // Read access to object id. const Oid& oid() const { return oid_; }; private: // Object identifier, database link. Oid oid_; };
Definition at line 304 of file tariffobject.h.
OSB_LIB::TariffObject::TariffObject | ( | ) | [protected] |
Default constructor.
virtual OSB_LIB::TariffObject::~TariffObject | ( | ) | [protected, pure virtual] |
Virtual empty destructor.
const std::string& OSB_LIB::TariffObject::des | ( | ) | const |
Description of tariff object.
const std::string& OSB_LIB::TariffObject::name | ( | ) | const |
Name of tariff object.
long OSB_LIB::TariffObject::objVs | ( | ) | const [protected] |
Get object version.
TariffObject& OSB_LIB::TariffObject::operator= | ( | const TariffObject & | rhs | ) | [protected] |
Prevent assignment through base class.
void OSB_LIB::TariffObject::setDes | ( | const std::string & | des | ) |
Set the description.
des | Description for the tariff object. |
OsbException | if des is too long. |
void OSB_LIB::TariffObject::setName | ( | const std::string & | name | ) |
Set the name.
name | Name for tariff object. |
OsbException | if name is empty. | |
OsbException | if name is too long. |
std::string OSB_LIB::TariffObject::des_ [protected] |
std::string OSB_LIB::TariffObject::name_ [protected] |
Name of tariff object.
session | Database session to use. | |
noWait | Wait if locked by another session? |
ObjectNotFound | if the object as identified by its object id does not exist in the database. | |
ObjectModified | if objVs_ does not match the object version in the database. | |
OsbException | if noWait is true and another application has the object locked. |
Definition at line 364 of file tariffobject.h.
long OSB_LIB::TariffObject::objVs_ [protected] |
Object version: set by the gateways during database operations.
Definition at line 369 of file tariffobject.h.