sumcdr-gw.h

Go to the documentation of this file.
00001 // OSB library ************************************************ -*- C++ -*-
00006 /*
00007   AUTHOR(S): Tang Boon Leong (tbl)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.14 $
00012 
00013   License
00014    OSB rating and billing library for communication networks
00015    Copyright (C) 2004, 2005, 2006  OSB systems
00016 
00017    This file may be distributed and/or modify under the terms of the
00018    GNU General Public License (GPL) as published by the Free Software
00019    Foundation which is provided in the file LICENSE.GPL included in the
00020    packaging of this file.
00021 
00022    The file is distributed in the hope that it will be useful, but WITHOUT
00023    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00024    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00025    for more details.
00026 
00027    Holders of a OSB Commercial License may use this file under the terms
00028    and conditions of this commercial license.
00029  */
00030 #ifndef _SUMCDRGW_H_
00031 #define _SUMCDRGW_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + local headers
00038 #include "sumcdr.h"
00039 
00040 // ************************************************************************
00041 // class declarations
00042 namespace OSB_LIB {
00043     class BsPage;
00044     template<typename T> class Id;
00045 }
00046 
00047 // ************************************************************************
00048 // namespace extensions
00049 namespace OSB_DB {
00050 
00051 // ************************************************************************
00052 // class definitions
00053 
00054     // ********************************************************************
00055     // class SumCdrGw
00062     class SumCdrGw {
00063     public:
00079         void getChargeDetails(
00080             const Session&   session,
00081             OSB_LIB::SumCdr& sumCdr
00082         );
00083 
00090         void insChargeDetails(
00091             const Session&         session,
00092             const OSB_LIB::SumCdr& sumCdr
00093         );
00094 
00102         void updChargeDetails(
00103             const Session&         session,
00104             const OSB_LIB::SumCdr& sumCdr
00105         );
00106 
00114         void delChargeDetails(
00115             const Session&                      session,
00116             const OSB_LIB::Id<OSB_LIB::BsPage>& pageId
00117         );
00119 
00125         long nextSumCdrId(
00126             const Session& session
00127         );
00128 
00129     private:
00134 
00143         long nextSeq(
00144             const Session&              session,
00145             const OSB_LIB::SumCdr::Oid& sumCdrId
00146         );
00147 
00156         void insVolume(
00157             const Session&               session,
00158             const OSB_LIB::SumCdr::Oid&  sumCdrId,
00159                   long                   seq,
00160             const OSB_LIB::ChargeDetail& cDetail
00161         );
00162 
00171         long updVolume(
00172             const Session&               session,
00173             const OSB_LIB::SumCdr::Oid&  sumCdrId,
00174             const OSB_LIB::ChargeDetail& cDetail
00175         );
00176 
00184         void delVolume(
00185             const Session&                      session,
00186             const OSB_LIB::Id<OSB_LIB::BsPage>& pageId
00187         );
00188 
00197         void insMoneyInfoList(
00198             const Session&                session,
00199             const OSB_LIB::SumCdr::Oid&   sumCdrId,
00200                   long                    seq,
00201             const OSB_LIB::MoneyInfoList& mInfoList
00202         );
00203 
00213         void updMoneyInfoList(
00214             const Session&                session,
00215             const OSB_LIB::SumCdr::Oid&   sumCdrId,
00216                   long                    seq,
00217             const OSB_LIB::MoneyInfoList& mInfoList
00218         );
00219 
00227         void delMoneyInfoList(
00228             const Session&                      session,
00229             const OSB_LIB::Id<OSB_LIB::BsPage>& pageId
00230         );
00231 
00240         void getMoneyInfo(
00241             const Session&                session,
00242                   OSB_LIB::MoneyInfoList& mInfoList,
00243             const OSB_LIB::SumCdr::Oid&   sumCdrId,
00244                   long                    seq
00245         );
00246 
00256         void insMoney(
00257             const Session&                    session,
00258             const OSB_LIB::SumCdr::Oid&       sumCdrId,
00259                   long                        seq,
00260             const OSB_LIB::Money&             money,
00261             const OSB_LIB::ChargeTraits::Oid& ctId
00262         );
00263 
00275         bool updMoney(
00276             const Session&                    session,
00277             const OSB_LIB::SumCdr::Oid&       sumCdrId,
00278                   long                        seq,
00279             const OSB_LIB::Money&             money,
00280             const OSB_LIB::ChargeTraits::Oid& ctId
00281         );
00283     };
00284 
00285     // ********************************************************************
00286     // class SumCdr01Gw
00290     class SumCdr01Gw {
00291 
00293         friend class OSB_LIB::SumCdr01;
00294 
00296         friend class OSB_LIB::SumCdr01List;
00297 
00312         long fetch(
00313             const Session&                      session,
00314                   std::list<OSB_LIB::SumCdr*>&  sumCdrs,
00315             const OSB_LIB::Id<OSB_LIB::BsPage>& pageId
00316         );
00317 
00318     private:
00329         void insert(
00330             const Session&           session,
00331                   OSB_LIB::SumCdr01& sumCdr
00332         );
00333 
00340         void remove(
00341             const Session&                      session,
00342             const OSB_LIB::Id<OSB_LIB::BsPage>& pageId
00343         );
00344 
00358         bool update(
00359             const Session&           session,
00360                   OSB_LIB::SumCdr01& sumCdr
00361         );
00362     };
00363 
00364 // ************************************************************************
00365 // inline definitions
00366 
00367 }                                       // namespace OSB_DB
00368 #endif                                  // #ifndef _SUMCDRGW_H_

Generated on Sat Sep 2 14:06:34 2006 for OSB Library by  doxygen 1.4.7