usagetype.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.8 $
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 _USAGETYPE_H_
00031 #define _USAGETYPE_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 #include <string>
00037 #include <vector>
00038 
00039 // + libraries
00040 
00041 // + local headers
00042 #include "cdr.h"
00043 
00044 // + class declarations
00045 namespace OSB_LIB {
00046     class Cdr;
00047 }
00048 
00049 namespace OSB_DB {
00050     class Session;
00051 }
00052 
00053 // ************************************************************************
00054 // namespace extensions
00055 namespace OSB_LIB {
00056 
00057 // ************************************************************************
00058 // class definitions
00067     struct UsageType : public Cdr::UsageType {
00069         enum Type {
00071             utOriginated      =  1,
00073             utTerminated      =  2,
00075             utRoaming         =  3,
00077             utIncomingGateway =  4,
00079             utOutgoingGateway =  5,
00081             utTransit         =  6,
00083             utCallForward     =  7,
00085             utEvent           =  8,
00087             utRoaOriginated   =  9,
00089             utRoaTerminated   = 10,
00091             utRoaEvent        = 11
00092         };
00094         UsageType(const Cdr::UsageType& type = Cdr::UsageType());
00096         UsageType(Type type);
00098         operator Type() const;
00100         bool operator==(const UsageType& rhs) const;
00102         bool operator==(const Cdr::UsageType& rhs) const;
00103     };                                  // struct UsageType
00104 
00110     bool operator==(const Cdr::UsageType& lhs, const UsageType& rhs);
00111 
00115     class UsageTypeList {
00116     public:
00118         struct Info {
00120             Cdr::UsageType type_;
00122             std::string name_;
00124             bool rated_;
00126             std::string des_;
00127         };
00128 
00130         typedef std::vector<Info> Cont;
00132         typedef Cont::const_iterator ConstIterator;
00133     public:
00141         void read(const OSB_DB::Session& session);
00142 
00144         const Cont& infoList() const;
00146         ConstIterator begin() const;
00148         ConstIterator end() const;
00149 
00158         const Info* findInfo(const Cdr::UsageType& type) const;
00159 
00167         const Info& getInfo(const Cdr::UsageType& type) const;
00168     private:
00170         Cont infoList_;
00171     };                                  // class UsageTypeList
00172 }                                       // namespace OSB_LIB
00173 #endif                                  // #ifndef _USAGETYPE_H_

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