tobill.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00006 /*
00007   AUTHOR(S): Stephan Broennimann (vb)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.13 $
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 _TOBILL_H_
00031 #define _TOBILL_H_
00032 
00033 // *********************************************************************
00034 // included header files
00035 // + standard includes
00036 #include <set>
00037 
00038 // + local headers
00039 #include "chrono.h"
00040 #include "osbid.h"
00041 
00042 // *********************************************************************
00043 // class declarations
00044 namespace OSB_LIB {
00045     class Associate;
00046     class Contract;
00047     class Billcycle;
00048     class BsPage;
00049 }
00050 
00051 namespace OSB_DB {
00052     class Session;
00053 }
00054 
00055 // *********************************************************************
00056 // namespace extensions
00057 namespace OSB_LIB {
00058 
00059 // *********************************************************************
00060 // class definitions
00061 
00086     class ToBill {
00087     public:
00092         typedef std::set< Id<Contract> > Batch;
00093 
00094     public:
00096         ToBill() : endDate_(Date::max()), batchSize_(0) {}
00098         ToBill(
00099             const Date& endDate
00100         ) : endDate_(endDate), batchSize_(0) {}
00101 
00106         ToBill(
00107             const Id<Billcycle>& bcId,
00108             const Date&          endDate,
00109                   long           batchSize
00110         ) : endDate_(endDate),
00111             bcId_(bcId), batchSize_(batchSize) {}
00112 
00113     public:
00142         long loadContracts(
00143             const OSB_DB::Session& session
00144         );
00145 
00149         long loadContracts(
00150             const OSB_DB::Session& session,
00151             const Id<Associate>&   ownerId
00152         );
00153 
00162         bool loadContract(
00163             const OSB_DB::Session& session,
00164             const Id<Contract>&    coId
00165         );
00166 
00167     public:
00168         Batch batch_;                   
00169 
00176         Date endDate_;
00177         Id<Billcycle> bcId_;            
00178         long batchSize_;                
00179         Id<Contract> lastCoId_;         
00180 
00181     public:
00220         static bool pageToBill(
00221                   BsPage&        page,
00222             const Id<Billcycle>& bcId,
00223             const Date&          endDate
00224         );
00225     };
00226 }                                       // namespace OSB_LIB
00227 #endif                                  // #ifndef _TOBILL_H_

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