productpart_i.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00020 /*
00021   AUTHOR(S): Zhang Min (zm)
00022              Stephan Broennimann (vb)
00023 
00024   RCS information
00025    $Name: OSB_060808 $
00026    $Revision: 1.39 $
00027 
00028   License
00029    OSB rating and billing library for communication networks
00030    Copyright (C) 2004, 2005, 2006  OSB systems
00031 
00032    This file may be distributed and/or modify under the terms of the
00033    GNU General Public License (GPL) as published by the Free Software
00034    Foundation which is provided in the file LICENSE.GPL included in the
00035    packaging of this file.
00036 
00037    The file is distributed in the hope that it will be useful, but WITHOUT
00038    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00039    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00040    for more details.
00041 
00042    Holders of a OSB Commercial License may use this file under the terms
00043    and conditions of this commercial license.
00044 */
00045 
00046 #ifndef PRODUCTPART_I_H
00047 #define PRODUCTPART_I_H
00048 
00049 // *********************************************************************
00050 // included header files
00051 // + standard inlcudes
00052 
00053 // + local headers
00054 #include "productpartS.h"
00055 #include "productcat.h"    // for ProductNodeRg
00056 #include "trunkresource.h"
00057 #include "accessnumber.h"
00058 #include "ipaddress.h"
00059 
00060 // + class declarations
00061 namespace OSB_CORBA {
00062     class Product_i;
00063     class ProductWriter_i;
00064 }
00065 
00066 // ************************************************************************
00067 // namespace extensions
00068 namespace OSB_CORBA {
00069 
00070     using namespace corba::common;
00071     using namespace corba::pcat;
00072     using namespace corba::pcat::pp;
00073 
00074     // *****************************************************************
00075     // class forward declarations
00076 
00077     // *****************************************************************
00078     // class ProductPartBase_i
00092     class ProductPartBase_i :
00093         public virtual POA_corba::pcat::pp::ProductPart
00094     {
00095     public:                             // CORBA interface
00097         virtual ProductPartId id()
00098             throw (OsbCorbaException);
00099 
00101         virtual Utf8String* name()
00102             throw (OsbCorbaException);
00103 
00105         virtual Utf8String* desc()
00106             throw (OsbCorbaException);
00107 
00109         virtual PpTypeId tid()
00110             throw (OsbCorbaException);
00111 
00113         virtual PpCfgType cfgType()
00114             throw (OsbCorbaException);
00115 
00117         virtual PpDefPersType defPersType()
00118             throw (OsbCorbaException);
00119 
00121         virtual Utf8String* configDes()
00122             throw (OsbCorbaException);
00123 
00125         virtual Utf8String* defPersDes()
00126             throw (OsbCorbaException);
00127 
00129         virtual CORBA::Long mandatory()
00130             throw (OsbCorbaException);
00131 
00133         virtual PpCfgPersType canPersonalize()
00134             throw (OsbCorbaException);
00135 
00142         virtual ProductPartId parentId()
00143             throw (OsbCorbaException);
00144 
00146         virtual ProductPartSeq* getParts()
00147             throw (OsbCorbaException);
00148 
00149     // Typedefs for OSB library object ids.
00150     protected:
00152         typedef OSB_LIB::Product::Oid ProductOid;
00154         typedef OSB_LIB::ProductNode::Oid NodeOid;
00156         typedef OSB_LIB::ProductItem::Oid ItemOid;
00157 
00158     // Provide OSB library object ids: in order to avoid multiuser
00159     // problem we return objects and not references.
00160     public:
00162         ProductOid prodId() const;
00164         virtual NodeOid nodeId() const = 0;
00166         virtual ItemOid itemId() const = 0;
00167 
00168     protected:
00170         typedef OSB_LIB::PcatLockMgr::ProductNodeRg NodeRg;
00171 
00179         const OSB_LIB::ProductNode* getNode(
00180             const NodeRg&      guard,
00181             const std::string& ifc,
00182             const std::string& module
00183         ) const throw (OsbCorbaException);
00184 
00195         const OSB_LIB::ProductItem* getItem(
00196             const NodeRg&      guard,
00197             const std::string& ifc,
00198             const std::string& module
00199         ) const throw (OsbCorbaException);
00200 
00206         virtual NodeRg lockNode() const = 0;
00207 
00209         virtual Product_i& productServant() = 0;
00211         virtual const Product_i& productServant() const = 0;
00212 
00214         virtual const std::string& ifc() const = 0;
00215     };                                  // class ProductPartBase_i
00216 
00217     // *****************************************************************
00218     // class ProductPart_i
00225     class ProductPart_i : public virtual ProductPartBase_i
00226     {
00227     // Construction & destruction.
00228     public:
00243         ProductPart_i(
00244                   Product_i& pd,
00245             const NodeOid&   pnId,
00246             const ItemOid&   piId
00247         );
00248 
00250         virtual ~ProductPart_i() = 0;
00251 
00252     protected:                          // required by ProductPartBase_i
00262         virtual NodeRg lockNode() const;
00263 
00264     public:                             // required by ProductPartBase_i
00265         // Documentation from base class.
00266         virtual NodeOid nodeId() const;
00267         // Documentation from base class.
00268         virtual ItemOid itemId() const;
00269 
00270     private:                            // required by ProductPartBase_i
00271         // Documentation from base class.
00272         virtual Product_i& productServant();
00273         // Documentation from base class.
00274         virtual const Product_i& productServant() const;
00275 
00276     private:                            // data members
00278         Product_i&       prodi_;
00280         const NodeOid    pnId_;
00281     protected:
00283         const ItemOid    piId_;
00284     };                                  // class ProductPart_i
00285 
00286     // *****************************************************************
00287     // class ProductPartWriter_i
00301     class ProductPartWriter_i :
00302         public virtual POA_corba::pcat::pp::ProductPartWriter,
00303         public virtual ProductPartBase_i
00304     {
00305     // Construction & destruction.
00306     public:
00308         ProductPartWriter_i(
00309             ProductWriter_i&      prod,
00310             OSB_LIB::ProductNode& node
00311         );
00312 
00313     // Implementation of ProductPartWriter's abstract methods.
00314     public:
00316         virtual void setName(const Utf8String& name)
00317           throw (OsbCorbaException);
00318 
00320         virtual void setDesc(const Utf8String& desc)
00321           throw (OsbCorbaException);
00322 
00324         virtual void setConfigDes(const Utf8String& desc)
00325           throw (OsbCorbaException);
00326 
00328         virtual void setDefPersDes(const Utf8String& desc)
00329           throw (OsbCorbaException);
00330 
00332         virtual void setMandatory(int value)
00333           throw (OsbCorbaException);
00334 
00336         virtual ProductPartWriter_ptr addPart(const PpTypeId& tid)
00337           throw (OsbCorbaException);
00338 
00340         virtual void removePart(const ProductPartId& pid)
00341           throw (OsbCorbaException);
00342 
00343     protected:                          // required by ProductPartBase_i
00345         virtual NodeRg lockNode() const;
00346 
00347     public:                             // required by ProductPartBase_i
00348         // Documentation from base class.
00349         virtual NodeOid nodeId() const;
00350         // Documentation from base class.
00351         virtual ItemOid itemId() const;
00352 
00353     private:                            // required by ProductPartBase_i
00354         // Documentation from base class.
00355         virtual Product_i& productServant();
00356         // Documentation from base class.
00357         virtual const Product_i& productServant() const;
00358 
00359     private:
00361 
00362 
00363         virtual OSB_LIB::ProductItem* pItem() = 0;
00365         virtual const OSB_LIB::ProductItem* pItem() const = 0;
00367 
00368     private:                            // data members
00370         ProductWriter_i& product_;
00372         OSB_LIB::ProductNode& node_;
00373     };                                  // class ProductPartWriter_i
00374 
00375     // *****************************************************************
00376     // class DescPartBase_i
00385     class DescPartBase_i :
00386         public virtual POA_corba::pcat::pp::DescriptionPart,
00387         public virtual ProductPartBase_i
00388     {
00389     private:
00395         virtual const OSB_LIB::DescriptionItem* getDescItem(
00396             const ProductPartBase_i::NodeRg& guard,
00397             const std::string&               ifc,
00398             const std::string&               module
00399         ) const throw (OsbCorbaException) = 0;
00400    };
00401 
00402     // *****************************************************************
00403     // class DescPart_i
00410     class DescPart_i :
00411         public virtual DescPartBase_i,
00412         public virtual ProductPart_i
00413     {
00414     public:
00416         static const std::string IFC;
00417 
00418     public:
00426         DescPart_i(
00427                   Product_i& pd,
00428             const NodeOid&   pnId,
00429             const ItemOid&   piId
00430         );
00431 
00432     private:
00434         DescPart_i(const DescPart_i&);
00436         DescPart_i& operator=(const DescPart_i&);
00437 
00449         virtual const OSB_LIB::DescriptionItem* getDescItem(
00450             const ProductPartBase_i::NodeRg& guard,
00451             const std::string&               ifc,
00452             const std::string&               module
00453         ) const throw (OsbCorbaException);
00455         const std::string& ifc() const;
00456     };                                  // class DescPart_i
00457 
00458     // *****************************************************************
00459     // class DescPartWriter_i
00463     class DescPartWriter_i :
00464         public virtual POA_corba::pcat::pp::DescriptionPartWriter,
00465         public virtual ProductPartWriter_i,
00466         public virtual DescPartBase_i
00467     {
00468     public:
00470         static const std::string IFC;
00471 
00472     public:
00490         DescPartWriter_i(
00491             ProductWriter_i&          prod,
00492             OSB_LIB::ProductNode&     node,
00493             OSB_LIB::DescriptionItem& item
00494         );
00495 
00496     private:
00498 
00499 
00500         DescPartWriter_i(const DescPartWriter_i& rhs);
00502         DescPartWriter_i& operator=(const DescPartWriter_i& rhs);
00504 
00505     private:
00507         OSB_LIB::DescriptionItem& item_;
00508 
00509     private:                        // required by ProductPartWriter_i
00510         // Documentation from base class.
00511         virtual OSB_LIB::ProductItem* pItem();
00512         // Documentation from base class.
00513         virtual const OSB_LIB::ProductItem* pItem() const;
00514 
00516         virtual const OSB_LIB::DescriptionItem* getDescItem(
00517             const ProductPartBase_i::NodeRg& guard,
00518             const std::string&               ifc,
00519             const std::string&               module
00520         ) const throw (OsbCorbaException);
00522         const std::string& ifc() const;
00523     };                                  // class DescPartWriter_i
00524 
00525     // *****************************************************************
00526     // class AnPartBase_i
00532     class AnPartBase_i :
00533         public virtual POA_corba::pcat::pp::AnPart,
00534         public virtual ProductPartBase_i
00535     {
00536 
00537     private:
00543         virtual const OSB_LIB::AnItem* getAnItem(
00544             const ProductPartBase_i::NodeRg& guard,
00545             const std::string&               ifc,
00546             const std::string&               module
00547         ) const throw (OsbCorbaException) = 0;
00548     };
00549 
00550     // *****************************************************************
00551     // class AnPart_i
00558     class AnPart_i :
00559         public virtual AnPartBase_i,
00560         public virtual ProductPart_i
00561     {
00562     public:
00564         static const std::string IFC;
00565 
00573         AnPart_i(
00574                   Product_i& pd,
00575             const NodeOid&   pnId,
00576             const ItemOid&   piId
00577         );
00578 
00579     private:
00591         virtual const OSB_LIB::AnItem* getAnItem(
00592             const ProductPartBase_i::NodeRg& guard,
00593             const std::string&               ifc,
00594             const std::string&               module
00595         ) const throw (OsbCorbaException);
00596 
00598         const std::string& ifc() const;
00599     };                                  // class AnPart_i
00600 
00601     // *****************************************************************
00602     // class AnPartWriter_i
00609     class AnPartWriter_i :
00610         public virtual POA_corba::pcat::pp::AnPartWriter,
00611         public virtual ProductPartWriter_i,
00612         public virtual AnPartBase_i
00613     {
00614     public:
00616         static const std::string IFC;
00617 
00628         AnPartWriter_i(
00629             ProductWriter_i&      prod,
00630             OSB_LIB::ProductNode& node,
00631             OSB_LIB::AnItem&      item
00632         );
00633 
00634     private:
00636         OSB_LIB::AnItem& item_;
00637 
00638     private:                        // required by AnPartBase_i
00640         const std::string& ifc() const;
00641 
00642     private:                        // required by ProductPartWriter_i
00644         virtual OSB_LIB::ProductItem* pItem();
00646         virtual const OSB_LIB::ProductItem* pItem() const;
00647 
00649         virtual const OSB_LIB::AnItem* getAnItem(
00650             const ProductPartBase_i::NodeRg& guard,
00651             const std::string&               ifc,
00652             const std::string&               module
00653         ) const throw (OsbCorbaException);
00654     };
00655 
00656     // *****************************************************************
00657     // class IpGroupPartBase_i
00663     class IpGroupPartBase_i :
00664         public virtual POA_corba::pcat::pp::IpGroupPart,
00665         public virtual ProductPartBase_i
00666     {
00667 
00668     private:
00674         virtual const OSB_LIB::IpGroupItem* getIpGroupItem(
00675             const ProductPartBase_i::NodeRg& guard,
00676             const std::string&               ifc,
00677             const std::string&               module
00678         ) const throw (OsbCorbaException) = 0;
00679     };
00680 
00681     // *****************************************************************
00682     // class IpGroupPart_i
00689     class IpGroupPart_i :
00690         public virtual IpGroupPartBase_i,
00691         public virtual ProductPart_i
00692     {
00693     public:
00695         static const std::string IFC;
00696 
00704         IpGroupPart_i(
00705                   Product_i& pd,
00706             const NodeOid&   pnId,
00707             const ItemOid&   piId
00708         );
00709 
00710     private:
00722         virtual const OSB_LIB::IpGroupItem* getIpGroupItem(
00723             const ProductPartBase_i::NodeRg& guard,
00724             const std::string&               ifc,
00725             const std::string&               module
00726         ) const throw (OsbCorbaException);
00727 
00729         const std::string& ifc() const;
00730     };                                  // class IpGroupPart_i
00731 
00732     // *****************************************************************
00733     // class IpGroupPartWriter_i
00740     class IpGroupPartWriter_i :
00741         public virtual POA_corba::pcat::pp::IpGroupPartWriter,
00742         public virtual ProductPartWriter_i,
00743         public virtual IpGroupPartBase_i
00744     {
00745     public:
00747         static const std::string IFC;
00748 
00759         IpGroupPartWriter_i(
00760             ProductWriter_i&      prod,
00761             OSB_LIB::ProductNode& node,
00762             OSB_LIB::IpGroupItem& item
00763         );
00764 
00765     private:
00767         OSB_LIB::IpGroupItem& item_;
00768 
00769     private:                        // required by IpGroupPartBase_i
00771         const std::string& ifc() const;
00772 
00773     private:                        // required by ProductPartWriter_i
00775         virtual OSB_LIB::ProductItem* pItem();
00777         virtual const OSB_LIB::ProductItem* pItem() const;
00778 
00780         virtual const OSB_LIB::IpGroupItem* getIpGroupItem(
00781             const ProductPartBase_i::NodeRg& guard,
00782             const std::string&               ifc,
00783             const std::string&               module
00784         ) const throw (OsbCorbaException);
00785     };                                  // class IpGroupPartWriter_i
00786 
00787     // *****************************************************************
00788     // class TrunkPartBase_i
00794     class TrunkPartBase_i :
00795         public virtual POA_corba::pcat::pp::TrunkPart,
00796         public virtual ProductPartBase_i
00797     {
00798     private:
00804         virtual const OSB_LIB::TrunkItem* getTrunkItem(
00805             const ProductPartBase_i::NodeRg& guard,
00806             const std::string&               ifc,
00807             const std::string&               module
00808         ) const throw (OsbCorbaException) = 0;
00809     };                                  // class TrunkPartBase_i
00810 
00811     // *****************************************************************
00812     // class TrunkPart_i
00819     class TrunkPart_i :
00820         public virtual TrunkPartBase_i,
00821         public virtual ProductPart_i
00822     {
00823     public:
00825         static const std::string IFC;
00826 
00834         TrunkPart_i(
00835                   Product_i& pd,
00836             const NodeOid&   pnId,
00837             const ItemOid&   piId
00838         );
00839 
00840     private:
00852         virtual const OSB_LIB::TrunkItem* getTrunkItem(
00853             const ProductPartBase_i::NodeRg& guard,
00854             const std::string&               ifc,
00855             const std::string&               module
00856         ) const throw (OsbCorbaException);
00857 
00859         const std::string& ifc() const;
00860     };                                  // class TrunkPart_i
00861 
00862     // *****************************************************************
00863     // class TrunkPartWriter_i
00870     class TrunkPartWriter_i :
00871         public virtual POA_corba::pcat::pp::TrunkPartWriter,
00872         public virtual ProductPartWriter_i,
00873         public virtual TrunkPartBase_i
00874     {
00875     public:
00877         static const std::string IFC;
00878 
00889         TrunkPartWriter_i(
00890             ProductWriter_i&      prod,
00891             OSB_LIB::ProductNode& node,
00892             OSB_LIB::TrunkItem&   item
00893         );
00894 
00895     private:
00897         OSB_LIB::TrunkItem& item_;
00898 
00899     private:                        // required by TrunkPartBase_i
00901         const std::string& ifc() const;
00902 
00903     private:                        // required by ProductPartWriter_i
00905         virtual OSB_LIB::ProductItem* pItem();
00907         virtual const OSB_LIB::ProductItem* pItem() const;
00908 
00910         virtual const OSB_LIB::TrunkItem* getTrunkItem(
00911             const ProductPartBase_i::NodeRg& guard,
00912             const std::string&               ifc,
00913             const std::string&               module
00914         ) const throw (OsbCorbaException);
00915     };                                  // class TrunkPartWriter_i :
00916 
00917     // *****************************************************************
00918     // class PpType_i
00919 
00921     class PpType_i : public virtual POA_corba::pcat::pp::PpType
00922     {
00923     public:
00925         PpType_i(
00926             const OSB_LIB::ProductItemTypes::Info& info
00927         );
00928 
00930         PpTypeId id() throw ();
00932         Utf8String* name() throw ();
00934         Utf8String* desc() throw ();
00936         CORBA::Boolean isProductPart() throw();
00937     private:
00939         OSB_LIB::ProductItemTypes::Info info_;
00940     };
00941 }                                       // namespace OSB_CORBA
00942 #endif

Generated on Sat Sep 2 14:25:53 2006 for OSB Library by  doxygen 1.4.7