00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef _PRICELIST_I_H_
00035 #define _PRICELIST_I_H_
00036
00037
00038
00039
00040
00041
00042 #include <osbid.h>
00043
00044
00045 #include "pricelistS.h"
00046 #include "corba_utility.h"
00047 #include "productcat.h"
00048
00049
00050
00051 namespace OSB_LIB {
00052 class Pricelist;
00053 class PricelistCfg;
00054 }
00055
00056 namespace OSB_CORBA {
00057 class ProductCatalogue_i;
00058 }
00059
00060
00061
00062 namespace OSB_CORBA {
00063
00064 using namespace corba::pcat::pl;
00065 using corba::pcat::pl::ChargeTraitsId;
00066
00067
00068
00069
00070
00071
00072
00073
00074
00078 class Pricelist_i : public virtual POA_corba::pcat::pl::Pricelist {
00080 typedef OSB_LIB::PcatLockMgr::PricelistRg ReadGuard;
00081
00082 public:
00083 static const std::string IFC;
00084
00092 Pricelist_i(
00093 ProductCatalogue_i& pcati,
00094 const OSB_LIB::Id<OSB_LIB::Pricelist>& plId
00095 );
00096
00102 virtual PricelistId id() throw (CORBA::SystemException);
00103
00114 virtual Utf8String* name()
00115 throw(CORBA::SystemException, OsbCorbaException);
00116
00127 virtual Utf8String* desc()
00128 throw (CORBA::SystemException, OsbCorbaException);
00129
00138 virtual PricelistWriter_ptr getWriter()
00139 throw (CORBA::SystemException);
00140
00149 static OSB_LIB::PcatLockMgr::PricelistRg lockPricelist(
00150 const OSB_LIB::Pricelist::Oid& plOid
00151 ) throw (OsbCorbaException);
00152
00153 private:
00154
00162 ReadGuard lockPricelist() throw (OsbCorbaException);
00163
00164 private:
00166 ProductCatalogue_i& pcati_;
00168 OSB_LIB::Id<OSB_LIB::Pricelist> plId_;
00169 };
00170
00174 class PricelistWriter_i :
00175 public virtual POA_corba::pcat::pl::PricelistWriter,
00176 public virtual Pricelist_i
00177 {
00179 typedef OSB_LIB::PcatLockMgr::PricelistRg ReadGuard;
00180
00181 public:
00182
00183 static const std::string IFC;
00184
00193 PricelistWriter_i(
00194 ProductCatalogue_i& pcati,
00195 const OSB_LIB::Pricelist* pl
00196 );
00197
00203 virtual ~PricelistWriter_i();
00204
00210 virtual void setName(const Utf8String& name)
00211 throw (CORBA::SystemException);
00212
00219 virtual void setDesc(const Utf8String& desc)
00220 throw(CORBA::SystemException);
00221
00235 virtual void commitChanges(CORBA::Boolean noWait)
00236 throw (CORBA::SystemException, OsbCorbaException);
00237
00238 private:
00240 OSB_LIB::Pricelist* pl_;
00241 };
00242
00246 class PricelistCfg_i :
00247 public virtual POA_corba::pcat::pl::PricelistCfg
00248 {
00250 typedef OSB_LIB::PcatLockMgr::PricelistRg ReadGuard;
00251
00252 public:
00253
00254 static const std::string IFC;
00255
00263 PricelistCfg_i(
00264 ProductCatalogue_i& pcati,
00265 const OSB_LIB::Id<OSB_LIB::Pricelist>& plId
00266 );
00267
00274 virtual PricelistId plId() throw (CORBA::SystemException);
00275
00286 virtual ChargeTraitsId ctId()
00287 throw (CORBA::SystemException, OsbCorbaException);
00288
00299 virtual CORBA::Double charge()
00300 throw (CORBA::SystemException, OsbCorbaException);
00301
00312 virtual CfgStatus status()
00313 throw (CORBA::SystemException, OsbCorbaException);
00314
00326 virtual Date releaseDate()
00327 throw (CORBA::SystemException, OsbCorbaException);
00328
00337 virtual PricelistCfgWriter_ptr getWriter()
00338 throw (CORBA::SystemException);
00339
00340 private:
00348 ReadGuard lockPricelist() throw (OsbCorbaException);
00349
00351 const OSB_LIB::PricelistCfg& getPlCfg();
00352
00354 const OSB_LIB::PricelistCfg::OnetimeChargeDefs& getOtcDefs();
00355
00356 private:
00358 ProductCatalogue_i& pcati_;
00360 OSB_LIB::Id<OSB_LIB::Pricelist> plId_;
00361 };
00362
00366 class PricelistCfgWriter_i :
00367 public virtual POA_corba::pcat::pl::PricelistCfgWriter,
00368 public virtual PricelistCfg_i
00369 {
00370 public:
00371
00372 static const std::string IFC;
00373
00382 PricelistCfgWriter_i(
00383 ProductCatalogue_i& pcati,
00384 const OSB_LIB::PricelistCfg* plCfg
00385 );
00386
00392 virtual ~PricelistCfgWriter_i();
00393
00403 virtual void setChargeTraitsId(
00404 const ChargeTraitsId& id
00405 ) throw (CORBA::SystemException, OsbCorbaException);
00406
00416 virtual void setCharge(CORBA::Double charge)
00417 throw (CORBA::SystemException, OsbCorbaException);
00418
00430 virtual void commitChanges(CORBA::Boolean noWait)
00431 throw (CORBA::SystemException, OsbCorbaException);
00432
00433 private:
00434 OSB_LIB::OnetimeChargeDef& getOtcDef()
00435 throw (OsbCorbaException);
00436
00437 private:
00439 OSB_LIB::PricelistCfg* plCfg_;
00441 OSB_LIB::ChargeTraits::Oid ctOid_;
00443 double charge_;
00444 };
00445
00446 }
00447 #endif // #ifndef _PRICELIST_I_H_