ipgroup_i.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00008 /*
00009   AUTHOR(S): Lilian Qin Lan (lan)
00010 
00011   RCS information
00012    $Name: OSB_060808 $
00013    $Revision: 1.15 $
00014 
00015   License
00016    OSB rating and billing library for communication networks
00017    Copyright (C) 2004, 2005, 2006  OSB systems
00018 
00019    This file may be distributed and/or modify under the terms of the
00020    GNU General Public License (GPL) as published by the Free Software
00021    Foundation which is provided in the file LICENSE.GPL included in the
00022    packaging of this file.
00023 
00024    The file is distributed in the hope that it will be useful, but WITHOUT
00025    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00026    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00027    for more details.
00028 
00029    Holders of a OSB Commercial License may use this file under the terms
00030    and conditions of this commercial license.
00031  */
00032 #ifndef _IPGROUP_I_H_
00033 #define _IPGROUP_I_H_
00034 
00035 // *********************************************************************
00036 // included header files
00037 // + standard includes
00038 
00039 // + local headers
00040 #include "resourcelists.h"
00041 
00042 #include "ipgroupS.h"
00043 #include "resource_i.h"
00044 
00045 // *********************************************************************
00046 // class definitions
00047 namespace OSB_CORBA {
00048     using namespace corba::common;
00049     using namespace corba::nwmgr;
00050     using namespace corba::nwmgr::nw;
00051     using namespace corba::nwmgr::nwe;
00052     using namespace corba::res;
00053 
00054     // *****************************************************************
00055     // class IpGroup_i
00061     class IpGroup_i :
00062         public virtual POA_corba::res::IpGroup,
00063         public virtual Resource_i
00064     {
00065     public:
00067         static const std::string IFC;
00068 
00070         IpGroup_i(
00071                   NetworkManager_i&       nmgri,
00072             const OSB_LIB::Resource::Oid& oid
00073         );
00074 
00076         virtual ~IpGroup_i();
00077 
00085 
00086         virtual Utf8String* desc()
00087             throw (CORBA::SystemException, OsbCorbaException);
00088 
00090         virtual AssignedIp4Seq* getIp4s()
00091             throw (CORBA::SystemException, OsbCorbaException);
00092 
00094         virtual Ip4AddressSeq* getCurIp4s()
00095             throw (CORBA::SystemException, OsbCorbaException);
00096 
00098         virtual AssignedIp4Seq* getCurAssIp4s()
00099             throw (CORBA::SystemException, OsbCorbaException);
00100 
00102         virtual AssignableIp4Seq* getAssignableIp4s()
00103             throw (CORBA::SystemException, OsbCorbaException);
00105 
00107         virtual IpGroupWriter_ptr getWriter()
00108             throw (CORBA::SystemException, OsbCorbaException);
00109 
00110     protected:
00112         typedef OSB_LIB::ResourceLists::IpGroupList IpgList;
00113 
00129         virtual IpgList::Rg lockIpg() const;
00130 
00131         // documentation from base class
00132         ReadGuard lock() const;
00133 
00135         virtual Ip4Address_ptr getAvailIp4(
00136             const ResourceId& id
00137         ) throw (CORBA::SystemException, OsbCorbaException);
00138     };
00139 
00140     // *****************************************************************
00141     // class IpGroupWriter_i
00147     class IpGroupWriter_i :
00148         public POA_corba::res::IpGroupWriter,
00149         public IpGroup_i,
00150         public ResourceWriter_i
00151     {
00152     public:
00154         static const std::string IFC;
00155 
00157         IpGroupWriter_i(
00158                   NetworkManager_i& nmgri,
00159             const OSB_LIB::IpGroup& ipg
00160         );
00161 
00163         virtual void setDesc(const Utf8String& desc)
00164             throw (CORBA::SystemException);
00165 
00182         virtual void addIp4(
00183             const ResourceId&           id,
00184                   corba::res::Direction dir,
00185             const Date&                 start,
00186                   CORBA::Boolean        noWait
00187         ) throw (OsbCorbaException);
00188 
00204         virtual void delIp4(
00205             const ResourceId&           id,
00206                   corba::res::Direction dir,
00207                   CORBA::Boolean        noWait
00208         ) throw (OsbCorbaException);
00209 
00210     private:
00216         IpGroup_i::IpgList::Rg lockIpg() const;
00217 
00218         // documentation from base
00219         OSB_LIB::Resource& resource();
00220         // documentation from base
00221         bool writeToList(bool isNew) const;
00222 
00223     private:
00225         OSB_LIB::IpGroup ipg_;
00226     };
00227 
00228 // *********************************************************************
00229 // OSB_CORBA utility
00230 
00237     OSB_LIB::IpGroup::Direction direction(
00238         corba::res::Direction dir
00239     );
00240 
00247     corba::res::Direction direction(
00248         const OSB_LIB::IpGroup::Direction& dir
00249     );
00250 
00251 
00252 }                                       // namespace OSB_CORBA
00253 #endif                                  // #ifndef _IPGROUP_I_H_

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