servicepart_i.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00009 /*
00010   AUTHOR(S): Yeo Han Kwang (yhk)
00011 
00012   RCS information
00013    $Name: OSB_060808 $
00014    $Revision: 1.8 $
00015 
00016   License
00017    OSB rating and billing library for communication networks
00018    Copyright (C) 2004, 2005, 2006  OSB systems
00019 
00020    This file may be distributed and/or modify under the terms of the
00021    GNU General Public License (GPL) as published by the Free Software
00022    Foundation which is provided in the file LICENSE.GPL included in the
00023    packaging of this file.
00024 
00025    The file is distributed in the hope that it will be useful, but WITHOUT
00026    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00027    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00028    for more details.
00029 
00030    Holders of a OSB Commercial License may use this file under the terms
00031    and conditions of this commercial license.
00032  */
00033 #ifndef _SERVICEPART_I_H_
00034 #define _SERVICEPART_I_H_
00035 
00036 // *********************************************************************
00037 // included header files
00038 // + OSB library
00039 #include "serviceitem.h"
00040 
00041 // + local headers
00042 #include "servicepartS.h"
00043 #include "productpart_i.h"
00044 
00045 namespace OSB_CORBA {
00046 
00047     using namespace corba::pcat::pp;
00048     using corba::common::OsbCorbaException;
00049 
00050     // *****************************************************************
00051     // class ServicePartBase_i
00058     class ServicePartBase_i :
00059         public virtual POA_corba::pcat::pp::ServicePart,
00060         public virtual ProductPartBase_i
00061     {
00062     public:
00070         virtual pp::ServiceTuple* getServiceTuple()
00071             throw (CORBA::SystemException, OsbCorbaException);
00072 
00073     private:
00075         pp::ServiceElement getServiceElement (
00076             const OSB_LIB::ServiceElement& se
00077         ) throw (OsbCorbaException);
00078 
00084         virtual const OSB_LIB::ServiceItem* getServiceItem(
00085             const ProductPartBase_i::NodeRg& guard,
00086             const std::string&               ifc,
00087             const std::string&               module
00088         ) const throw (OsbCorbaException) = 0;
00089     };
00090 
00091     // *****************************************************************
00092     // class ServicePart_i
00099     class ServicePart_i :
00100         public virtual ServicePartBase_i,
00101         public virtual ProductPart_i
00102     {
00103     public:
00104 
00106         static const std::string IFC;
00107 
00115         ServicePart_i(
00116                   Product_i& pd,
00117             const NodeOid&   pnId,
00118             const ItemOid&   piId
00119         );
00120 
00121     private:
00133         virtual const OSB_LIB::ServiceItem* getServiceItem(
00134             const ProductPartBase_i::NodeRg& guard,
00135             const std::string&               ifc,
00136             const std::string&               module
00137         ) const throw (OsbCorbaException);
00138 
00140         const std::string& ifc() const;
00141     };
00142 
00143     // *****************************************************************
00144     // class ServicePartWriter_i
00151     class ServicePartWriter_i :
00152         public virtual POA_corba::pcat::pp::ServicePartWriter,
00153         public virtual ProductPartWriter_i,
00154         public virtual ServicePartBase_i
00155     {
00156     public:
00157 
00159         static const std::string IFC;
00160 
00171         ServicePartWriter_i(
00172             ProductWriter_i&      prod,
00173             OSB_LIB::ProductNode& node,
00174             OSB_LIB::ServiceItem& sItem
00175         );
00176 
00178         ~ServicePartWriter_i();
00179 
00185         virtual void setServiceTuple(const pp::ServiceTuple& service)
00186             throw (CORBA::SystemException);
00187 
00188     private:
00190         OSB_LIB::ServiceItem& sItem_;
00191 
00192     private:                        // required by ServicePartBase_i
00194         const std::string& ifc() const;
00195 
00196     private:                        // required by ProductPartWriter_i
00198         virtual OSB_LIB::ProductItem* pItem();
00200         virtual const OSB_LIB::ProductItem* pItem() const;
00201 
00203         virtual const OSB_LIB::ServiceItem* getServiceItem(
00204             const ProductPartBase_i::NodeRg& guard,
00205             const std::string&               ifc,
00206             const std::string&               module
00207         ) const throw (OsbCorbaException);
00208     };
00209 
00210 // *********************************************************************
00211 // inline definitions
00212 
00213 }                                       // namespace OSB_CORBA
00214 #endif                                  // #ifndef _SERVICEPART_I_H_

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