billingxml.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00008 /*
00009   AUTHOR(S): Andreas Huggel (ahu)
00010 
00011   RCS information
00012    $Name: OSB_060808 $
00013    $Revision: 1.61 $
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 _BILLINGXML_H_
00033 #define _BILLINGXML_H_
00034 
00035 // *********************************************************************
00036 // included header files
00037 // + standard includes
00038 #include <iosfwd>
00039 
00040 // + local headers
00041 #include "osbxml.h"
00042 #include "osbunit.h"
00043 #include "associate.h"
00044 #include "section.h"
00045 
00046 // + class declarations
00047 namespace OSB_LIB {
00048     class AssociateList;
00049     class AssociateInfo;
00050     class BaseAmount;
00051     class Contract;
00052     class Invoice;
00053     class InvoiceInfo;
00054     class InvoiceInfoItem;
00055     class OnetimeChargeItem;
00056     class Section;
00057     class SubsItem;
00058     class SumCdr01;
00059     class SumCdr01Detail;
00060     class SumCdr01Item;
00061     class SummaryCharges;
00062     class SummaryChargesInfo;
00063     class TaxAmount;
00064     class TotalItem;
00065     class Usagerecord;
00066     class UsagerecordDetail;
00067     class UsagerecordItem;
00068     struct OnetimeCharge;
00069     struct SubsCharge;
00070 };
00071 
00072 // *********************************************************************
00073 // namespace extensions
00074 namespace OSB_LIB {
00075 
00076 // *********************************************************************
00077 // class definitions
00078 
00079 
00113     class BillingXmlBase {
00114     public:
00120         BillingXmlBase(std::ostream& o)
00121             : xml(o),
00122               last_(Section::globalSection()),
00123               globalSectionWritten_(false)
00124         {};
00125 
00127         virtual ~BillingXmlBase() {}
00128 
00167         virtual void writeInvoice(
00168                   Invoice&       invoice,
00169             const Contract&      contract,
00170             const AssociateList& associates
00171         ) = 0;
00172 
00176         virtual void writeXmlHeader() = 0;
00177 
00181         virtual void writeXmlFooter() = 0;
00182 
00183         // -------------------------------------------------------------
00184         // public data members
00185 
00187         OsbXml xml;
00188 
00189     protected:
00197         Section last_;
00198 
00203         bool globalSectionWritten_;
00204     };  // Class BillingXmlBase
00205 
00239     class BillingXml : public BillingXmlBase {
00240     public:
00246         BillingXml(std::ostream& o) : BillingXmlBase(o) {}
00248         virtual ~BillingXml() {}
00249 
00288         virtual void writeInvoice(
00289             Invoice& invoice,
00290             const Contract& contract,
00291             const AssociateList& associates
00292         );
00293 
00298         virtual void writeUsagerecordItem(
00299             const UsagerecordItem& usagerecordItem
00300         );
00301 
00306         virtual void writeSubsItem(const SubsItem& subsItem);
00307 
00312         virtual void writeOtcItem(const OnetimeChargeItem& otcItem);
00313 
00318         virtual void writeTotalItem(const TotalItem& totalItem);
00319 
00324         virtual void writeOtc(const OnetimeCharge& otc);
00325 
00330         virtual void writeSubsCharge(const SubsCharge& subsCharge);
00331 
00336         virtual void writeBaseAmount(const BaseAmount& baseAmount);
00337 
00346         virtual void writeTaxAmount(const TaxAmount& taxAmount);
00347 
00354         virtual void writeMoney(
00355             const Money& money,
00356             bool withCurrency = true
00357         );
00358 
00364         virtual void writeAddress(
00365             const Address&    address,
00366                   AddressType addressType
00367         );
00368 
00373         virtual void writeAssociate(const Associate& associate);
00374 
00379         virtual void writeSummaryCharges(
00380             const SummaryCharges& sumCharges
00381         );
00382 
00387         virtual void writeInvoiceInfo(
00388             const InvoiceInfo& invInfo
00389         );
00390 
00403         void writeSection(
00404             const Section& section,
00405             const Contract& contract,
00406             const AssociateList& associates
00407         );
00408 
00412         virtual void writeXmlHeader();
00413 
00417         virtual void writeXmlFooter();
00418 
00423         virtual void writeUsagerecordDetail(
00424             const UsagerecordDetail& UsagerecordDetail
00425         );
00426     protected:
00431         virtual void writeUsagerecord(const Usagerecord& usagerecord);
00432     };
00433 
00434     class SumCdr01BillingXml : public BillingXml {
00435     public:
00441         SumCdr01BillingXml(std::ostream& o) : BillingXml(o) {}
00443         virtual ~SumCdr01BillingXml() {}
00444 
00449         virtual void writeSumCdr01Item(
00450             const SumCdr01Item& usageItem
00451         );
00452 
00457         virtual void writeSumCdr01Detail(
00458             const SumCdr01Detail& usageDetail
00459         );
00460     };
00461 }                                       // namespace OSB_LIB
00462 #endif                                  // #ifndef _BILLINGXML_H_

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