cdrasn1.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00021 /*
00022   AUTHOR(S): Narendranath Reddy (nr)
00023              Stephan Broennimann (vb)
00024 
00025   RCS information
00026    $Name: OSB_060808 $
00027    $Revision: 1.70 $
00028 
00029   License
00030    OSB rating and billing library for communication networks
00031    Copyright (C) 2004, 2005, 2006  OSB systems
00032 
00033    This file may be distributed and/or modify under the terms of the
00034    GNU General Public License (GPL) as published by the Free Software
00035    Foundation which is provided in the file LICENSE.GPL included in the
00036    packaging of this file.
00037 
00038    The file is distributed in the hope that it will be useful, but WITHOUT
00039    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00040    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00041    for more details.
00042 
00043    Holders of a OSB Commercial License may use this file under the terms
00044    and conditions of this commercial license.
00045  */
00046 #ifndef _CDRASN1_H_
00047 #define _CDRASN1_H_
00048 
00049 // + local headers
00050 #include "asn1decode.h"
00051 #include "asn1encode.h"
00052 #include "asn1tagid.h"
00053 #include "cdr.h"
00054 #include "cdrtags.h"
00055 #include "rawcdr.h"
00056 #include "recordstreamdef.h"
00057 
00058 // *********************************************************************
00059 // class declarations
00060 namespace OSB_LIB {
00061     class OsbErrors;
00062     class RecordStreamInfo;
00063 }
00064 
00065 // ************************************************************************
00066 // namespace extensions
00067 namespace OSB_LIB {
00068 
00069 // *********************************************************************
00070 // class definitions
00071 
00072     // ********************************************************************
00073     // Encoders for toplevel classes (ASN.1 records)
00077     class Cdr2Asn1 : public Asn1Encoder {
00078     public:
00080         Cdr2Asn1(const Cdr& src) : src_(src) {}
00081 
00082         // Documentation from base class.
00083         void operator()(Asn1Buffer& dest) const;
00084 
00085         // Documentation from base class.
00086         size_t tagValue() const { return tag_; }
00087 
00088     private:
00090         static const size_t tag_ = asn1Cdr;
00092         const Cdr& src_;
00093     };                                  // class Cdr2Asn1
00094 
00098     class RawCdr2Asn1 : public Asn1Encoder {
00099     public:
00101         RawCdr2Asn1(const RawCdr& src) : src_(src) {}
00102 
00103         // Documentation from base class.
00104         void operator()(Asn1Buffer& dest) const;
00105 
00106         // Documentation from base class.
00107         size_t tagValue() const { return tag_; }
00108     private:
00110         static const size_t tag_ = asn1RawCdr;
00112         const RawCdr& src_;
00113     };                                  // class RawCdr2Asn1
00114 
00115     // *****************************************************************
00116     // ASN.1 encoders: convert OSB related types into ASN.1
00120     class IdToAsn1 : public Long2Asn1 {
00121     public:
00131          template<typename T>
00132          IdToAsn1(
00133             CdrAsn1Tag   tag,
00134             const Id<T>& src
00135          ) : Long2Asn1(tag, src.id()) {}
00136     };
00137 
00141     class Id2ToAsn1 : public Asn1Encoder {
00142     public:
00151         template<typename T>
00152         Id2ToAsn1(
00153             CdrAsn1Tag    tag,
00154             const Id2<T>& src,
00155             CdrAsn1Tag    id1Tag,
00156             CdrAsn1Tag    id2Tag
00157         ) : tag_(tag),
00158             id1Encoder_(id1Tag, src.id1_),
00159             id2Encoder_(id2Tag, src.id2_)
00160         {
00161             // empty body
00162         }
00163 
00164         // Documentation from base class.
00165         void operator()(Asn1Buffer& dest) const;
00166         // Documentation from base class.
00167         size_t tagValue() const { return tag_; }
00168 
00169     private:
00170         size_t    tag_;                 
00171         Long2Asn1 id1Encoder_;          
00172         Long2Asn1 id2Encoder_;          
00173     };
00174 
00178     class ToVs2Asn1 : public Id2ToAsn1 {
00179     public:
00190         template<typename T>
00191         ToVs2Asn1(
00192             CdrAsn1Tag    tag,
00193             const Id2<T>& src
00194         ) : Id2ToAsn1(tag, src, tagTariffObjectId, tagTariffObjectVs)
00195         {
00196             // empty body
00197         }
00198     };
00199 
00203     class Decimal2Asn1 : public Asn1DataEncoder {
00204     public:
00206         Decimal2Asn1(
00207                   CdrAsn1Tag tag,
00208             const Decimal&   src
00209         ) : tag_(tag), src_(src) {}
00210 
00212         void operator()(Asn1Data& dest) const;
00213 
00215         size_t tagValue() const { return tag_; }
00216     private:
00218         size_t tag_;
00220         const Decimal& src_;
00221     };
00222 
00226     class DateTime2Asn1 : public Asn1Encoder {
00227     public:
00234         DateTime2Asn1(
00235             CdrAsn1Tag      tag,
00236             const DateTime& src
00237         ) : tag_(tag), src_(src) {}
00238 
00239         // Documentation from base class.
00240         void operator()(Asn1Buffer& dest) const;
00241         // Documentation from base class.
00242         size_t tagValue() const { return tag_; }
00243     private:
00245         const size_t tag_;
00247         const DateTime& src_;
00248     };
00249 
00256     class NwAddress2Asn1 : public Asn1Encoder {
00258         static const CdrAsn1Tag defTagId = tagNwAddress;
00259     public:
00267         explicit NwAddress2Asn1(
00268             const NwAddress& src
00269         ) : tag_(tagNwAddress), src_(src) {}
00270 
00277         NwAddress2Asn1(
00278                   CdrAsn1Tag tag,
00279             const NwAddress& src
00280         ) : tag_(tag), src_(src) {}
00281 
00282     public:
00283         // Documentation from base class.
00284         void operator()(Asn1Buffer& dest) const;
00285 
00286         // Documentation from base class.
00287         size_t tagValue() const { return tag_; }
00288     private:
00290         const size_t tag_;
00292         const NwAddress& src_;
00293     };
00294 
00298     class RatedParty2Asn1 : public Asn1Encoder {
00299     public:
00301         RatedParty2Asn1(const RatedParty& src) : src_(src) {}
00302 
00303     public:
00312         void operator()(Asn1Buffer& dest) const;
00313 
00314         // Documentation from base class.
00315         size_t tagValue() const { return tag_; }
00316     private:
00318         static const size_t tag_ = tagRatedParty;
00320         const RatedParty& src_;
00321     };
00322 
00323     class Resource2Asn1 : public Asn1Encoder {
00324     public:
00326         Resource2Asn1(
00327                   CdrAsn1Tag  tag,
00328             const RatedParty& src
00329         ) : tag_(tag), src_(src) {}
00330 
00331     public:
00332         // Documentation from base class.
00333         void operator()(Asn1Buffer& dest) const;
00334 
00335         // Documentation from base class.
00336         size_t tagValue() const { return tag_; }
00337     private:
00339         const size_t tag_;
00341         const RatedParty& src_;
00342     };
00343 
00347     class ServedParty2Asn1 : public Asn1Encoder {
00348     public:
00350         ServedParty2Asn1(const Cdr::ServedParty& src) : src_(src) {}
00351 
00352         // Documentation from base class.
00353         void operator()(Asn1Buffer& dest) const;
00354 
00355         // Documentation from base class.
00356         size_t tagValue() const { return tag_; }
00357     private:
00359         static const size_t tag_ = tagServedParty;
00361         const Cdr::ServedParty& src_;
00362     };
00363 
00367     class UsedServices2Asn1 : public Asn1Encoder {
00368     public:
00370         UsedServices2Asn1(const UsedServices& src) : src_(src) {}
00371 
00372         // Documentation from base class.
00373         void operator()(Asn1Buffer& dest) const;
00374 
00375         // Documentation from base class.
00376         size_t tagValue() const { return tag_; }
00377     private:
00379         static const size_t tag_ = tagUsedServices;
00381         const UsedServices&  src_;
00382     };
00383 
00387     class UsedService2Asn1 : public Asn1Encoder {
00388     public:
00390         UsedService2Asn1(const UsedService& src) : src_(src) {}
00391 
00392         // Documentation from base class.
00393         void operator()(Asn1Buffer& dest) const;
00394 
00395         // Documentation from base class.
00396         size_t tagValue() const { return tag_; }
00397     private:
00399         static const size_t tag_ = tagUsedService;
00401         const UsedService&   src_;
00402     };
00403 
00407     class ExtChargeInfo2Asn1 : public Asn1Encoder {
00408     public:
00410         ExtChargeInfo2Asn1(const ExtChargeInfo& src) : src_(src) {}
00411 
00412         // Documentation from base class.
00413         void operator()(Asn1Buffer& dest) const;
00414 
00415         // Documentation from base class.
00416         size_t tagValue() const { return tag_; }
00417     private:
00419         static const size_t tag_ = tagExtChargeInfo;
00421         const ExtChargeInfo&  src_;
00422     };
00423 
00427     class ExtChargeList2Asn1 : public Asn1Encoder {
00429         typedef std::vector<ExternalCharge> Charges;
00430     public:
00432         ExtChargeList2Asn1(const Charges& src) : src_(src) {}
00433 
00434         // Documentation from base class.
00435         void operator()(Asn1Buffer& dest) const;
00436 
00437         // Documentation from base class.
00438         size_t tagValue() const { return tag_; }
00439     private:
00441         static const size_t tag_ = tagExtChargeList;
00443         const Charges& src_;
00444     };                                  // class ExtChargeList2Asn1
00445 
00449     class ExtCharge2Asn1 : public Asn1Encoder {
00450     public:
00452         ExtCharge2Asn1(const ExternalCharge& src) : src_(src) {}
00453 
00454         // Documentation from base class.
00455         void operator()(Asn1Buffer& dest) const;
00456 
00457         // Documentation from base class.
00458         size_t tagValue() const { return tag_; }
00459     private:
00461         static const size_t tag_ = tagExtCharge;
00463         const ExternalCharge& src_;
00464     };                                  // class ExtCharge2Asn1
00465 
00469     class ExtTaxList2Asn1 : public Asn1Encoder {
00471         typedef std::vector<ExternalTax> Taxes;
00472     public:
00474         ExtTaxList2Asn1(const Taxes& src) : src_(src) {}
00475 
00476         // Documentation from base class.
00477         void operator()(Asn1Buffer& dest) const;
00478 
00479         // Documentation from base class.
00480         size_t tagValue() const { return tag_; }
00481     private:
00483         static const size_t tag_ = tagExtTaxList;
00485         const Taxes& src_;
00486     };                                  // class ExtTaxList2Asn1
00487 
00491     class  ExtTax2Asn1 : public Asn1Encoder {
00492     public:
00494          ExtTax2Asn1(const ExternalTax& src) : src_(src) {}
00495 
00496         // Documentation from base class.
00497         void operator()(Asn1Buffer& dest) const;
00498 
00499         // Documentation from base class.
00500         size_t tagValue() const { return tag_; }
00501     private:
00503         static const size_t tag_ = tagExtTax;
00505         const ExternalTax& src_;
00506     };                                  // class  ExtTax2Asn1
00507 
00516     class TariffInfo2Asn1 : public Asn1Encoder {
00517     public:
00524         TariffInfo2Asn1(
00525             const UsedService& src
00526         ) : src_(src)
00527         {
00528             // empty
00529         }
00530 
00531         // Documentation from base class.
00532         void operator()(Asn1Buffer& dest) const;
00533 
00534         // Documentation from base class.
00535         size_t tagValue() const { return tag_; }
00536 
00537     private:
00539         static const size_t tag_ = tagTariffInfo;
00541         const UsedService&  src_;
00542     };
00543 
00560     class TcInfo2Asn1 : public Asn1Encoder {
00561     public:
00566         TcInfo2Asn1(
00567             const UsedService& src
00568         ) : src_(src)
00569         {
00570             // empty
00571         }
00572 
00573         // Documentation from base class.
00574         void operator()(Asn1Buffer& dest) const;
00575 
00576         // Documentation from base class.
00577         size_t tagValue() const { return tag_; }
00578 
00579     private:
00581         static const size_t tag_ = tagTcInfo;
00583         const UsedService&  src_;
00584     };
00585 
00592     class DistInfo2Asn1 : public Asn1Encoder {
00593     public:
00600         DistInfo2Asn1(const UsedService& src) : src_(src) {}
00601 
00602         // Documentation from base class.
00603         void operator()(Asn1Buffer& dest) const;
00604 
00605         // Documentation from base class.
00606         size_t tagValue() const { return tag_; }
00607     private:
00609         static const size_t tag_ = tagTcDistInfo;
00611         const UsedService&  src_;
00612     };
00613 
00617     class ChargeDetails2Asn1 : public Asn1Encoder {
00618     public:
00620         ChargeDetails2Asn1(
00621             const ChargeDetails& src
00622         ) : src_(src) {}
00623 
00624         // Documentation from base class.
00625         void operator()(Asn1Buffer& dest) const;
00626 
00627         // Documentation from base class.
00628         size_t tagValue() const { return tag_; }
00629     private:
00631         static const size_t tag_ = tagChargeDetails;
00633         const ChargeDetails& src_;
00634     };
00635 
00639     class ChargeDetail2Asn1 : public Asn1Encoder {
00640     public:
00642         ChargeDetail2Asn1(
00643             const ChargeDetail& src
00644         ) : src_(src) {}
00645 
00646         // Documentation from base class.
00647         void operator()(Asn1Buffer& dest) const;
00648 
00649         // Documentation from base class.
00650         size_t tagValue() const { return tag_; }
00651     private:
00653         static const size_t tag_ = tagChargeDetail;
00655         const ChargeDetail& src_;
00656     };
00657 
00661     class MoneyInfoList2Asn1 : public Asn1Encoder {
00662     public:
00664         MoneyInfoList2Asn1(
00665             const MoneyInfoList& src
00666         ) : src_(src) {}
00667 
00668         // Documentation from base class.
00669         void operator()(Asn1Buffer& dest) const;
00670 
00671         // Documentation from base class.
00672         size_t tagValue() const { return tag_; }
00673     private:
00675         static const size_t tag_ = tagMoneyInfoList;
00677         const MoneyInfoList& src_;
00678     };
00679 
00683     class MoneyInfo2Asn1 : public Asn1Encoder {
00684     public:
00686         MoneyInfo2Asn1(const MoneyInfo& src) : src_(src) {}
00687 
00688         // Documentation from base class.
00689         void operator()(Asn1Buffer& dest) const;
00690 
00691         // Documentation from base class.
00692         size_t tagValue() const { return tag_; }
00693     private:
00695         static const size_t tag_ = tagMoneyInfo;
00697         const MoneyInfo& src_;
00698     };
00699 
00703     class Money2Asn1 : public Asn1Encoder {
00704     public:
00706         Money2Asn1(const Money& src) : src_(src) {}
00707 
00708         // Documentation from base class.
00709         void operator()(Asn1Buffer& dest) const;
00710 
00711         // Documentation from base class.
00712         size_t tagValue() const { return tag_; }
00713     private:
00715         static const size_t tag_ = tagMoney;
00717         const Money&         src_;
00718     };
00719 
00723     class ServiceTuple2Asn1 : public Asn1Encoder {
00724     public:
00726         ServiceTuple2Asn1(const ServiceTuple& src) : src_(src) {}
00727 
00728         // Documentation from base class.
00729         void operator()(Asn1Buffer& dest) const;
00730 
00731         // Documentation from base class.
00732         size_t tagValue() const { return tag_; }
00733     private:
00735         static const size_t tag_ = tagServiceTuple;
00737         const ServiceTuple&  src_;
00738     };
00739 
00743     class ServiceElement2Asn1 : public Asn1Encoder {
00744     public:
00746         ServiceElement2Asn1(const ServiceElement& src) : src_(src) {}
00747 
00748         // Documentation from base class.
00749         void operator()(Asn1Buffer& dest) const;
00750 
00751         // Documentation from base class.
00752         size_t tagValue() const { return tag_; }
00753     private:
00755         static const size_t tag_ = tagServiceElement;
00757         const ServiceElement& src_;
00758     };
00759 
00763     class OrigCountList2Asn1 : public Asn1Encoder {
00764     public:
00766         OrigCountList2Asn1(const Cdr::OrigCountList& src) : src_(src) {}
00767 
00768         // Documentation from base class.
00769         void operator()(Asn1Buffer& dest) const;
00770 
00771         // Documentation from base class.
00772         size_t tagValue() const { return tag_; }
00773     private:
00775         static const size_t tag_ = tagOrigCountList;
00777         const Cdr::OrigCountList& src_;
00778     };
00779 
00783     class OrigCount2Asn1 : public Asn1Encoder {
00784     public:
00786         OrigCount2Asn1(
00787             const Id<RecordStreamInfo>& streamId,
00788             const Fraction&             fraction
00789         ) : streamId_(streamId), fraction_(fraction) {}
00790 
00791         // Documentation from base class.
00792         void operator()(Asn1Buffer& dest) const;
00793 
00794         // Documentation from base class.
00795         size_t tagValue() const { return tag_; }
00796     private:
00798         static const size_t tag_ = tagOrigCount;
00800         const Id<RecordStreamInfo>&  streamId_;
00801         const Fraction&              fraction_;
00802     };
00803 
00807     class OsbErrors2Asn1 : public Asn1Encoder {
00808     public:
00810         OsbErrors2Asn1(const OsbErrors& src) : src_(src) {}
00811 
00812         // Documentation from base class.
00813         void operator()(Asn1Buffer& dest) const;
00814 
00815         // Documentation from base class.
00816         size_t tagValue() const { return tag_; }
00817     private:
00819         static const size_t tag_ = tagOsbErrors;
00821         const OsbErrors& src_;
00822     };
00823 
00827     class OsbError2Asn1 : public Asn1Encoder {
00828     public:
00830         OsbError2Asn1(const OsbError& src) : src_(src) {}
00831 
00832         // Documentation from base class.
00833         void operator()(Asn1Buffer& dest) const;
00834 
00835         // Documentation from base class.
00836         size_t tagValue() const { return tag_; }
00837     private:
00839         static const size_t tag_ = tagOsbError;
00841         const OsbError& src_;
00842     };
00843 
00847     class OsbErrArgs2Asn1 : public Asn1Encoder {
00848     public:
00850         OsbErrArgs2Asn1(const BaseError::Args& src) : src_(src) {}
00851 
00852         // Documentation from base class.
00853         void operator()(Asn1Buffer& dest) const;
00854 
00855         // Documentation from base class.
00856         size_t tagValue() const { return tag_; }
00857     private:
00859         static const size_t tag_ = tagOsbErrorArgs;
00861         const BaseError::Args& src_;
00862     };
00863 
00864     // ********************************************************************
00865     // Decoders for toplevel classes (ASN.1 records)
00869     class Asn1ToCdr : public Asn1Decoder {
00870     public:
00872         explicit Asn1ToCdr(Cdr& dest)
00873           : dest_(dest)
00874         {
00875             // empty
00876         }
00877     public:
00878         // Documentation from base class.
00879         size_t operator()(
00880             Asn1Info&  src,
00881             OsbErrors& errors
00882         );
00883     private:
00885         Cdr& dest_;
00886     };                                  // class Asn1ToCdr
00887 
00891     class Asn1ToRawCdr : public Asn1Decoder {
00892     public:
00894         explicit Asn1ToRawCdr(
00895             RawCdr& dest
00896         ) : dest_(dest)
00897         {
00898             // empty
00899         }
00900 
00901         // Documentation from base class.
00902         size_t operator()(
00903             Asn1Info&  src,
00904             OsbErrors& errors
00905         );
00906 
00907     private:
00909         RawCdr& dest_;
00910     };                                  // class Asn1ToRawCdr
00911 
00912     // *****************************************************************
00913     // ASN.1 decoders: convert ASN.1 encoded data into OSB related types.
00915     class Asn1ToId : public Asn1Int2Long {
00916     public:
00928         template<typename T>
00929         void value(Id<T>& id) const
00930         {
00931             id = Id<T>(Asn1Int2Long::value());
00932         }
00933     };
00934 
00936     class Asn1ToId2 : public Asn1Decoder {
00937     public:
00944         Asn1ToId2(
00945             CdrAsn1Tag id1Tag,
00946             CdrAsn1Tag id2Tag
00947         );
00948 
00960         size_t operator()(
00961             Asn1Info&  src,
00962             OsbErrors& errors
00963         );
00964 
00970         template<typename T>
00971         void value(Id2<T>& dest) const
00972         {
00973             dest = Id2<T>(id1_, id2_);
00974         }
00975     private:
00976         Asn1Int2Long     decoder_;       
00977         const CdrAsn1Tag id1Tag_;        
00978         const CdrAsn1Tag id2Tag_;        
00979         long             id1_;           
00980         long             id2_;           
00981 
00983         size_t decodeId(
00984                   long&      dest,
00985             const Asn1Info&  src,
00986                   CdrAsn1Tag expectedTag,
00987                   OsbErrors& errors
00988         );
00989     };
00990 
00994     class Asn1ToVs2Id2 : public Asn1ToId2 {
00995     public:
01002         Asn1ToVs2Id2() :
01003           Asn1ToId2(tagTariffObjectId, tagTariffObjectVs) {}
01004     };
01005 
01009     class Asn1ToDecimal : public Asn1DataDecoder {
01010     public:
01012         explicit Asn1ToDecimal(
01013             Decimal& dest
01014         ) : dest_ (dest) {}
01015 
01016         // documentation from base class.
01017         int operator()(const Asn1Info& src);
01018 
01019     private:
01021         Decimal& dest_;
01022     };
01023 
01027     class Asn1ToDateTime : public Asn1Decoder {
01028     public:
01030         explicit Asn1ToDateTime(DateTime& dest) : dest_(dest) {}
01031     public:
01032         // Documentation from base class.
01033         size_t operator()(
01034             Asn1Info&  src,
01035             OsbErrors& errors
01036         );
01037     private:
01039         DateTime& dest_;
01040     };
01041 
01045     class Asn1ToNwAddress : public Asn1Decoder {
01046     public:
01050         explicit Asn1ToNwAddress(
01051             NwAddress& dest
01052         ) : dest_(dest) {}
01053         // Documentation from base class.
01054         size_t operator()(
01055             Asn1Info&  src,
01056             OsbErrors& errors
01057         );
01058     private:
01060         NwAddress& dest_;
01061     };
01062 
01066     class Asn1ToRatedParty : public Asn1Decoder {
01067     public:
01069         Asn1ToRatedParty(RatedParty& dest) : dest_(dest) {}
01070 
01071     public:
01072         // Documentation from base class.
01073         size_t operator()(
01074             Asn1Info&  src,
01075             OsbErrors& errors
01076         );
01077     private:
01079         RatedParty& dest_;
01080     };
01081 
01086     class Asn1ToResource : public Asn1Decoder {
01087     public:
01092         Asn1ToResource(RatedParty& dest) : dest_(dest) {}
01093 
01094     public:
01095         // Documentation from base class.
01096         size_t operator()(
01097             Asn1Info&  src,
01098             OsbErrors& errors
01099         );
01100     private:
01102         RatedParty& dest_;
01103     };
01104 
01108     class Asn1ToServedParty : public Asn1Decoder {
01109     public:
01111         explicit Asn1ToServedParty(
01112             Cdr::ServedParty& dest
01113         ) : dest_(dest) {}
01114 
01115     public:
01116         // Documentation from base class.
01117         size_t operator()(
01118             Asn1Info&  src,
01119             OsbErrors& errors
01120         );
01121     private:
01123         Cdr::ServedParty& dest_;
01124     };
01125 
01129     class Asn1ToUsedServices : public Asn1Decoder {
01130     public:
01132         explicit Asn1ToUsedServices(
01133             UsedServices& dest
01134         ) : dest_(dest) {}
01135 
01136         // Documentation from base class.
01137         size_t operator()(
01138             Asn1Info&  src,
01139             OsbErrors& errors
01140         );
01141 
01142     private:
01148         UsedServices& dest_;
01149     };
01150 
01154     class Asn1ToUsedService : public Asn1Decoder {
01155     public:
01157         explicit Asn1ToUsedService(
01158             UsedService& dest
01159         ) : dest_(dest) {}
01160 
01161         // Documentation from base class.
01162         size_t operator()(
01163             Asn1Info&  src,
01164             OsbErrors& errors
01165         );
01166 
01167     private:
01169         UsedService& dest_;
01170     };                                  // class Asn1ToUsedService
01171 
01175     class Asn1ToExtChargeInfo : public Asn1Decoder {
01176     public:
01178         explicit Asn1ToExtChargeInfo(
01179             ExtChargeInfo& dest
01180         ) : dest_(dest) {}
01181 
01182         // Documentation from base class.
01183         size_t operator()(
01184             Asn1Info&  src,
01185             OsbErrors& errors
01186         );
01187 
01188     private:
01190         ExtChargeInfo& dest_;
01191     };                                  // class Asn1ToExtChargeInfo
01192 
01194     class Asn1ToExtChargeList : public Asn1Decoder {
01196         typedef std::vector<ExternalCharge> Charges;
01197     public:
01199         explicit Asn1ToExtChargeList(
01200             Charges& dest
01201         ) : dest_(dest) {}
01202 
01203         // Documentation from base class.
01204         size_t operator()(
01205             Asn1Info&  src,
01206             OsbErrors& errors
01207         );
01208 
01209     private:
01215         Charges& dest_;
01216     };                                  // class Asn1ToExtChargeList
01217 
01219     class Asn1ToExtCharge : public Asn1Decoder {
01220     public:
01222         explicit Asn1ToExtCharge(
01223             ExternalCharge& dest
01224         ) : dest_(dest) {}
01225 
01226         // Documentation from base class.
01227         size_t operator()(
01228             Asn1Info&  src,
01229             OsbErrors& errors
01230         );
01231 
01232     private:
01234         ExternalCharge& dest_;
01235     };                                  // class Asn1ToExtCharge
01236 
01238     class Asn1ToExtTaxList : public Asn1Decoder {
01240         typedef std::vector<ExternalTax> Taxes;
01241     public:
01243         explicit Asn1ToExtTaxList(
01244             Taxes& dest
01245         ) : dest_(dest) {}
01246 
01247         // Documentation from base class.
01248         size_t operator()(
01249             Asn1Info&  src,
01250             OsbErrors& errors
01251         );
01252 
01253     private:
01259         Taxes& dest_;
01260     };                                  // class Asn1ToExtTaxList
01261 
01263     class Asn1ToExtTax : public Asn1Decoder {
01264     public:
01266         explicit Asn1ToExtTax(
01267             ExternalTax& dest
01268         ) : dest_(dest) {}
01269 
01270         // Documentation from base class.
01271         size_t operator()(
01272             Asn1Info&  src,
01273             OsbErrors& errors
01274         );
01275 
01276     private:
01278         ExternalTax& dest_;
01279     };                                  // class Asn1ToExtTax
01280 
01288     class Asn1ToTariffInfo : public Asn1Decoder {
01289     public:
01291         explicit Asn1ToTariffInfo(
01292             UsedService& dest
01293         ) : dest_(dest) {}
01294 
01295         // Documentation from base class.
01296         size_t operator()(
01297             Asn1Info&  src,
01298             OsbErrors& errors
01299         );
01300     private:
01302         UsedService& dest_;
01303 
01312         size_t decodeTcInfo(
01313             Asn1Info&  src,
01314             OsbErrors& errors
01315         );
01316     };
01317 
01326     class Asn1DistInfo : public Asn1Decoder {
01327     public:
01329         Asn1DistInfo(UsedService& dest) : dest_(dest) {}
01330 
01331         // Documentation from base class.
01332         size_t operator()(
01333             Asn1Info&  src,
01334             OsbErrors& errors
01335         );
01336     private:
01338         UsedService& dest_;
01339     };
01340 
01344     class Asn1ToChargeDetails : public Asn1Decoder {
01345     public:
01347         explicit Asn1ToChargeDetails(
01348             ChargeDetails& dest
01349         ) : dest_(dest) {}
01350 
01351         // Documentation from base class.
01352         size_t operator()(
01353             Asn1Info&  src,
01354             OsbErrors& errors
01355         );
01356     private:
01358 
01363         ChargeDetails& dest_;
01364     };
01365 
01369     class Asn1ToChargeDetail : public Asn1Decoder {
01370     public:
01372         explicit Asn1ToChargeDetail(
01373             ChargeDetail& dest
01374         ) : dest_(dest) {}
01375 
01376         // Documentation from base class.
01377         size_t operator()(
01378             Asn1Info&  src,
01379             OsbErrors& errors
01380         );
01381     private:
01383         ChargeDetail& dest_;
01384     };
01385 
01389     class Asn1ToMoneyInfoList : public Asn1Decoder {
01390     public:
01392         explicit Asn1ToMoneyInfoList(
01393             MoneyInfoList& dest
01394         ) : dest_(dest) {}
01395 
01396         // Documentation from base class.
01397         size_t operator()(
01398             Asn1Info&  src,
01399             OsbErrors& errors
01400         );
01401     private:
01407         MoneyInfoList& dest_;
01408     };
01409 
01420     class Asn1ToMoneyInfo : public Asn1Decoder {
01421     public:
01422         // Documentation from base class.
01423         size_t operator()(
01424             Asn1Info&  src,
01425             OsbErrors& errors
01426         );
01427 
01429         const MoneyInfo value() const
01430         {
01431             return MoneyInfo(Money(currency_, amount_),
01432                              chargeTraitsId_);
01433         }
01434 
01435     private:
01437 
01438 
01439         Currency::Oid currency_;
01440 
01442         Decimal amount_;
01444 
01446         ChargeTraits::Oid chargeTraitsId_;
01447     };
01448 
01452     class Asn1ToServiceTuple : public Asn1Decoder {
01453     public:
01455         explicit Asn1ToServiceTuple(
01456             ServiceTuple& dest
01457         ) : dest_(dest) {}
01458 
01459         // Documentation from base class.
01460         size_t operator()(
01461             Asn1Info&  src,
01462             OsbErrors& errors
01463         );
01464     private:
01466         ServiceTuple& dest_;
01467     };
01468 
01472     class Asn1ToServiceElement : public Asn1Decoder {
01473     public:
01475         explicit Asn1ToServiceElement(
01476             ServiceElement& dest
01477         ) : dest_(dest) {}
01478 
01479         // Documentation from base class.
01480         size_t operator()(
01481             Asn1Info&  src,
01482             OsbErrors& errors
01483         );
01484     private:
01486         ServiceElement& dest_;
01487     };
01488 
01492     class Asn1ToOrigCountList : public Asn1Decoder {
01493     public:
01495         Asn1ToOrigCountList(Cdr::OrigCountList& dest) : dest_(dest) {}
01496         // Documentation from base class.
01497         size_t operator()(
01498             Asn1Info&  src,
01499             OsbErrors& errors
01500         );
01501 
01502     private:
01504         Cdr::OrigCountList& dest_;
01505     };
01506 
01515     class Asn1ToOrigCount : public Asn1Decoder {
01516     public:
01517         // Documentation from base class.
01518         size_t operator()(
01519             Asn1Info&  src,
01520             OsbErrors& errors
01521         );
01523         const Id<RecordStreamInfo>&
01524         streamId() const { return streamId_; }
01526         const Fraction& fraction() const { return fraction_; }
01527     private:
01529         Id<RecordStreamInfo> streamId_;
01531         Fraction              fraction_;
01532     };
01533 
01537     class Asn1ToOsbErrors : public Asn1Decoder {
01538     public:
01540         explicit Asn1ToOsbErrors(OsbErrors& dest) : dest_(dest) {}
01541 
01542         // Documentation from base class.
01543         size_t operator()(
01544             Asn1Info&  src,
01545             OsbErrors& errors
01546         );
01547     private:
01549         OsbErrors& dest_;
01550     };
01551 
01555     class Asn1ToOsbError : public Asn1Decoder {
01556     public:
01558         explicit Asn1ToOsbError(OsbError& dest) : dest_(dest) {}
01559 
01560         // Documentation from base class.
01561         size_t operator()(
01562             Asn1Info&  src,
01563             OsbErrors& errors
01564         );
01565     private:
01567         OsbError& dest_;
01568     };
01569 
01573     class Asn1ToOsbErrArgs : public Asn1Decoder {
01574     public:
01576         explicit Asn1ToOsbErrArgs(
01577             BaseError::Args& dest
01578         ) : dest_(dest) {}
01579 
01580         // Documentation from base class.
01581         size_t operator()(
01582             Asn1Info&  src,
01583             OsbErrors& errors
01584         );
01585     private:
01587         BaseError::Args& dest_;
01588     };
01589 }                                       // namespace OSB_LIB
01590 #endif                                  // #ifndef _CDRASN1_H_

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