balancesheet-gw.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00006 /*
00007    AUTHOR(S): Vipul Gupta (vg)
00008 
00009    RCS information
00010     $Name: OSB_060808 $
00011     $Revision: 1.39 $
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 _BALANCESHEETGW_H_
00031 #define _BALANCESHEETGW_H_
00032 
00033 // *********************************************************************
00034 // included header files
00035 // + standard includes
00036 #include <deque>
00037 
00038 // + local headers
00039 #include "balancesheet.h"
00040 
00041 // ************************************************************************
00042 // class declarations
00043 namespace OSB_DB {
00044     class Session;
00045 }
00046 
00047 // *********************************************************************
00048 // namespace extensions
00049 namespace OSB_DB {
00050 
00051 // *********************************************************************
00052 // class definitions
00053 
00054     // *****************************************************************
00055     // struct BalanceSheetGw
00059     class BalanceSheetGw {
00061 
00062         friend class OSB_LIB::BsPage;
00063         friend class OSB_LIB::BalanceSheet;
00065 
00067 
00068     public:
00078         bool readRerate(
00079             const Session&                            session,
00080                   std::deque<OSB_LIB::Contract::Oid>& dest
00081         );
00082 
00083     private:
00097         bool read(
00098             const Session&               session,
00099                   OSB_LIB::BalanceSheet& bs
00100         );
00101 
00109         void readBsPages(
00110             const Session&               session,
00111                   OSB_LIB::BalanceSheet& bs,
00112                   bool                   incClosed
00113         );
00114 
00132         OSB_LIB::ObjectStatus lock(
00133             const Session&               session,
00134                   OSB_LIB::BalanceSheet& bs,
00135                   bool                   noWait
00136         );
00137 
00146         bool insert(
00147             const Session&               session,
00148                   OSB_LIB::BalanceSheet& bs
00149         );
00150 
00159         OSB_LIB::ObjectStatus checkObjVs(
00160             const Session&               session,
00161             const OSB_LIB::BalanceSheet& bs
00162         );
00164 
00166 
00167 
00180         bool readInfo(
00181             const Session&         session,
00182                   OSB_LIB::BsPage& page
00183         );
00184 
00196         long fetchOnetimeCharges(
00197             const Session&         session,
00198                   OSB_LIB::BsPage& page
00199         );
00200 
00212         long fetchAdvanceCharges(
00213             const Session&         session,
00214                   OSB_LIB::BsPage& page
00215         );
00217 
00219 
00220 
00221         bool setStatus(
00222             const Session&                session,
00223                   OSB_LIB::BsPage&        bs,
00224                   OSB_LIB::BsPage::Status status
00225         );
00227 
00229 
00230 
00243         bool insert(
00244             const Session&         session,
00245                   OSB_LIB::BsPage& page
00246         );
00247 
00264         bool remove(
00265             const Session&         session,
00266                   OSB_LIB::BsPage& page
00267         );
00269 
00271 
00272 
00285         bool updLastCharged(
00286             const Session&         session,
00287                   OSB_LIB::BsPage& page
00288         );
00289 
00298         bool updRecoveryId(
00299             const Session&              session,
00300             const OSB_LIB::BsPage::Oid& pageId,
00301                   long                  recoveryId
00302         );
00303 
00309         bool incrUsgTotal(
00310             const Session&                    session,
00311             const OSB_LIB::BsPage::Oid&       pageId,
00312             const OSB_LIB::BsTotal::SubTotal& st
00313         );
00314 
00320         bool incrOtcTotal(
00321             const Session&                    session,
00322             const OSB_LIB::BsPage::Oid&       pageId,
00323             const OSB_LIB::BsTotal::SubTotal& st
00324         );
00325 
00331         bool incrAdvTotal(
00332             const Session&                    session,
00333             const OSB_LIB::BsPage::Oid&       pageId,
00334             const OSB_LIB::BsTotal::SubTotal& st
00335         );
00336 
00349         bool close(
00350             const Session&         session,
00351             const OSB_LIB::BsPage& page
00352         );
00353 
00363         bool insert(
00364             const Session&                session,
00365                   OSB_LIB::OnetimeCharge& otc
00366         );
00367 
00380         bool remove(
00381             const Session&                session,
00382                   OSB_LIB::OnetimeCharge& otc
00383         );
00385 
00386     private:
00388 
00389 
00390         void readTotals(
00391             const Session&         session,
00392                   OSB_LIB::BsPage& page
00393         );
00395         bool insert(
00396             const Session&                session,
00397             const OSB_LIB::BsPage::Oid&   pageId,
00398             const OSB_LIB::Currency::Oid& cc
00399         );
00401         OSB_LIB::DateTime sysDate(
00402             const Session& session
00403         );
00405         long nextVal(
00406             const Session&     session,
00407             const std::string& seqName
00408         );
00427         bool incrSubTotal(
00428             const Session&                session,
00429             const std::string&            column,
00430             const OSB_LIB::BsPage::Oid&   pageId,
00431             const OSB_LIB::Currency::Oid& cc,
00432             const OSB_LIB::Decimal&       delta
00433         );
00435     };                                  // BalanceSheetGw
00436 }                                       // namespace OSB_DB
00437 #endif                                  // #ifndef _BALANCESHEETGW_H_

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