Remove core-comm dependency through CounterManager/timex in core/oam subsystem. Basic...
[anna.git] / include / anna / diameter / codec / Avp.hpp
index cd6c100..77ae9fb 100644 (file)
@@ -43,7 +43,6 @@
 #include <anna/diameter/defines.hpp>
 #include <anna/diameter/codec/basetypes/basetypes.hpp>
 #include <anna/diameter/stack/Avp.hpp>
-#include <anna/diameter/helpers/tme/codectypes/codectypes.hpp>
 
 #include <anna/core/RuntimeException.hpp>
 
@@ -70,17 +69,6 @@ namespace anna {
 namespace diameter {
 
 
-namespace helpers {
-namespace tme {
-namespace codectypes {
-class Unsigned16;
-class ISDNNumber;
-class ISDNAddress;
-}
-}
-}
-
-
 namespace stack {
 class Dictionary;
 class Format;
@@ -124,7 +112,6 @@ typedef std::map<find_key, Avp*>::iterator find_iterator;
 
 
 using namespace basetypes;
-using namespace helpers::tme::codectypes;
 
 /**
 * Diameter avp generic container
@@ -201,14 +188,6 @@ class Avp {
   QoSFilterRule *a_QoSFilterRule;
   Unknown *a_Unknown;
 
-  // Derived formats ////////////////////////////////////////////
-  /* TME */
-  ISDNNumber *a_ISDNNumber;
-  ISDNAddress *a_ISDNAddress;
-  Unsigned16 *a_Unsigned16;
-
-
-
   // Grouped helpers
   find_container a_finds; // fast access for grouped and message first-level avps
 
@@ -250,7 +229,6 @@ class Avp {
   static const Avp* avp(const_avp_iterator ii) throw() { return ii->second; }
 
   // Internal
-  void assertFormat(const std::string &name) const throw(anna::RuntimeException);
   bool flagsOK() const throw(); // flags coherence regarding dictionary. Only must be called when AVP is identified at the dictionary.
   int addChild(Avp *avp) throw(anna::RuntimeException) { assertFormat("Grouped"); return addChild(a_avps, a_insertionPositionForChilds, avp); }
   bool hasChildren() throw() { return a_avps.size() != 0; }
@@ -293,80 +271,80 @@ class Avp {
 
   /**
   * Initializes Avp class information.
-  * Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+  * Default implementation supports all anna::diameter formats (including derived ones).
   * Diameter basic formats are managed at #initialize, which will invoke this method at the end.
   */
-  virtual void initializeByFormat() throw();
+  virtual void initializeByFormat() throw() {};
 
   /**
   * Gets avp data-part length.
-  * Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+  * Default implementation supports all anna::diameter formats (including derived ones).
   * Diameter basic formats are managed at #initialize, which will invoke this method at the end.
   *
   * @param stackFormat Stack avp format in which data extraction is based.
   *
   * @return Avp data-part size.
   */
-  virtual U24 getLengthByFormat(const anna::diameter::stack::Format *stackFormat) const throw();
+  virtual U24 getLengthByFormat(const anna::diameter::stack::Format *stackFormat) const throw() { return 0; };
 
   /**
      Gets data or hexadecimal data depending on avp format, for xml creating
-     Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+     Default implementation supports all anna::diameter formats (including derived ones).
      Diameter basic formats are managed at #initialize, which will invoke this method at the end.
 
      \param isHex Hexadecimal/Natural data when apply.
      \param stackFormat Stack avp format in which data extraction is based.
      \return xml data representation
   */
-  virtual std::string getXMLdataByFormat(bool & isHex, const anna::diameter::stack::Format *stackFormat) const throw();
+  virtual std::string getXMLdataByFormat(bool & isHex, const anna::diameter::stack::Format *stackFormat) const throw() { return ""; };
 
   /**
      Interpret xml data in order to dump over the class content.
-     Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+     Default implementation supports all anna::diameter formats (including derived ones).
      Diameter basic formats are managed at #initialize, which will invoke this method at the end.
 
      \param data Avp data attribute
      \param hexData Avp hex-data attribute
      \param stackFormat Stack avp format in which data extraction is based.
   */
-  virtual void fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException);
+  virtual void fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException) {};
 
 
   /**
      Encodes buffer with the class content.
-     Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+     Default implementation supports all anna::diameter formats (including derived ones).
      Diameter basic formats are managed at #initialize, which will invoke this method at the end.
 
      @param dataPart Data-part begin pointer
      @param stackFormat Stack avp format in which data extraction is based.
   */
-  virtual void codeByFormat(char* dataPart, const anna::diameter::stack::Format *stackFormat) const throw(anna::RuntimeException);
+  virtual void codeByFormat(char* dataPart, const anna::diameter::stack::Format *stackFormat) const throw(anna::RuntimeException) {};
 
 
   /**
      Decodes Avp data part.
-     Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+     Default implementation supports all anna::diameter formats (including derived ones).
      Diameter basic formats are managed at #initialize, which will invoke this method at the end.
 
      @param buffer Avp data part start pointer
      @param size Avp data part size
      @param stackFormat Stack avp format in which data extraction is based.
   */
-  virtual void decodeDataPartByFormat(const char * buffer, int size, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException);
+  virtual void decodeDataPartByFormat(const char * buffer, int size, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException) {};
 
   /**
      Reserves memory for data part depending on avp format for the identifier provided.
-     Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+     Default implementation supports all anna::diameter formats (including derived ones).
      Diameter basic formats are managed at #initialize, which will invoke this method at the end.
 
      @param stackFormat Stack avp format in which data extraction is based.
   */
-  virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) throw();
+  virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) throw() {};
 
   /**
   * Clears Avp data-part format containers.
   */
-  virtual void clearByFormat() throw();
+  virtual void clearByFormat() throw() {};
 
 
 
@@ -383,6 +361,10 @@ protected:
   */
   void initialize() throw();
 
+  /**
+  * Assert format regarding dictionary
+  */
+  void assertFormat(const std::string &name) const throw(anna::RuntimeException);
 
   /**
   * Gets avp total length based on internal data part and header configuration.
@@ -574,15 +556,6 @@ public:
   /** Access content for Unknown Avp in order to set data part */
   Unknown *            getUnknown() throw(anna::RuntimeException) { assertFormat("Unknown"); return a_Unknown; }
 
-  // Derived formats ////////////////////////////////////////////
-  /* TME */
-  /** Access content for ISDNNumber Avp in order to set data part */
-  ISDNNumber *        getISDNNumber() throw(anna::RuntimeException) { assertFormat("ISDNNumber"); return a_ISDNNumber; }
-  /** Access content for ISDNAddress Avp in order to set data part */
-  ISDNAddress *        getISDNAddress() throw(anna::RuntimeException) { assertFormat("ISDNAddress"); return a_ISDNAddress; }
-  /** Access content for Unsigned16 Avp in order to set data part */
-  Unsigned16 *        getUnsigned16() throw(anna::RuntimeException) { assertFormat("Unsigned16"); return a_Unsigned16; }
-
 
   /**
      Removes an Avp within grouped type (first level) and free resources.
@@ -714,16 +687,6 @@ public:
   const Unknown *            getUnknown() const throw(anna::RuntimeException) { assertFormat("Unknown"); return a_Unknown; }
 
 
-  // Derived formats ////////////////////////////////////////////
-  /* TME */
-  /** Access content for ISDNNumber Avp */
-  const ISDNNumber *         getISDNNumber() const throw(anna::RuntimeException) { assertFormat("ISDNNumber"); return a_ISDNNumber; }
-  /** Access content for ISDNAddress Avp */
-  const ISDNAddress *        getISDNAddress() const throw(anna::RuntimeException) { assertFormat("ISDNAddress"); return a_ISDNAddress; }
-  /** Access content for Unsigned16 Avp */
-  const Unsigned16 *        getUnsigned16() const throw(anna::RuntimeException) { assertFormat("Unsigned16"); return a_Unsigned16; }
-
-
   // Helpers
 
   /**