This singleton class provide access to the global tariff catalogue.
The OSB library internally uses only this tariff catalogue.
Definition at line 72 of file tcatmgr.h.
OSB_LIB::TcatMgr::TcatMgr | ( | ) | [private] |
OSB_LIB::TcatMgr::TcatMgr | ( | const TcatMgr & | ) | [private] |
static TariffCatalogue& OSB_LIB::TcatMgr::tcat | ( | ) | [static] |
Access to the global tariff catalogue.
If tcat_ is 0, the function allocates a new tariff catalogue. This is done in a fairly thread-safe way:
tcat() { // Seems that nobody has initialized yet: // create a tariff catalogue. if (0 == tcat_) { TariffCatalogue* tmp = new TariffCatalogue; // If the tcat pointer is still 0, set it. // Note: this is the thread critical statement. if (0 == tcat_) tcat_ = tmp; // Somebody else has initialized in the meantime: // use its tcat pointer. else delete tmp; } return *tcat_; }
TariffCatalogue* OSB_LIB::TcatMgr::tcat_ [static, private] |