Hard refactoring. CodecEngine is associated to a unique stack.
[anna.git] / include / anna / diameter / codec / tme / Avp.hpp
index b4a1917..0b25df7 100644 (file)
@@ -41,11 +41,13 @@ class ISDNAddress;
 
 namespace codec {
 
+class Engine;
+
 namespace tme {
 
 class Avp;
 class Message;
-class Engine;
+//class Engine;
 
 
 using namespace helpers::tme::codectypes;
@@ -70,24 +72,27 @@ class Avp : public anna::diameter::codec::Avp {
   virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) throw();
   virtual void clearByFormat() throw();
 
-protected:
+//protected:
 
-  /** Codec Engine getter: avoids have to create base engine when using its child */
-  virtual anna::diameter::codec::Engine * getEngine() const throw(anna::RuntimeException);
+//  /** Codec Engine getter: avoids have to create base engine when using its child */
+//  virtual anna::diameter::codec::Engine * getEngine() const throw(anna::RuntimeException);
 
 
 public:
 
   /**
   * Default constructor
+  * @param engine Codec engine used
   */
-  Avp();
+  Avp(Engine *engine = NULL) : anna::diameter::codec::Avp(engine) {;}
 
   /**
   * Identified constructor
-  * @param id Avp identifier as pair (code,vendorID).
+  * @param id Avp identifier as pair (code,vendor-id).
+  * @param engine Codec engine used
   */
-  Avp(AvpId id);
+  Avp(AvpId id, Engine *engine = NULL) : anna::diameter::codec::Avp(id, engine) {;}
+
 
   /**
   * Destructor
@@ -114,7 +119,7 @@ public:
 
 
   friend class Message;
-  friend class Engine;
+  friend class anna::diameter::codec::Engine;
 };
 
 }