Identify Avp Rule by AvpId to avoid name collision for avps renamed. Fix 3GPP-Rat...
[anna.git] / include / anna / diameter / stack / AvpRule.hpp
index e31817f..ead1dc6 100644 (file)
@@ -75,13 +75,12 @@ public:
 private:
 
   const Dictionary *a_dictionary;
-  std::string a_avpName; // reference
+  AvpId a_avpId; // reference
   Presence::_v a_presence;
   std::string a_qual;
 
   void _initialize(const Dictionary *d) throw() {
     a_dictionary = d;
-    a_avpName = "";
     a_presence = Presence::None;
     a_qual = "";
   }
@@ -94,12 +93,12 @@ public:
 
 
   // get
-  const std::string & getAvpName(void) const throw() { return a_avpName; }
+  std::string getAvpName(void) const throw();
   const Presence::_v & getPresence(void) const throw() { return a_presence; }
   const std::string & getQual(void) const throw() { return a_qual; }
 
   // helpers
-  AvpId getId(void) const throw();
+  AvpId getId(void) const throw() { return a_avpId; }
   bool isAny(void) const throw(); // generic Avp
   bool isFixed(void) const throw() { return (a_presence == Presence::Fixed); }
   bool isMandatory(void) const throw() { return (a_presence == Presence::Mandatory); }
@@ -114,7 +113,7 @@ public:
 
   // set
   void initialize(const Dictionary *d = NULL) throw() { _initialize(d); }
-  void setAvpName(const std::string & an) throw() { a_avpName = an; }
+  void setAvpId(const AvpId & ai) throw() { a_avpId = ai; }
   void setPresence(const Presence::_v & p) throw() { a_presence = p; }
   void setQual(const std::string & q) throw(anna::RuntimeException);
 };