00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _USAGETYPE_H_
00031 #define _USAGETYPE_H_
00032
00033
00034
00035
00036 #include <string>
00037 #include <vector>
00038
00039
00040
00041
00042 #include "cdr.h"
00043
00044
00045 namespace OSB_LIB {
00046 class Cdr;
00047 }
00048
00049 namespace OSB_DB {
00050 class Session;
00051 }
00052
00053
00054
00055 namespace OSB_LIB {
00056
00057
00058
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 };
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 };
00172 }
00173 #endif // #ifndef _USAGETYPE_H_