New feature to allow to register components with different names for same class:...
[anna.git] / source / diameter / codec / EngineImpl.cpp
index d9a6146..5d24eb9 100644 (file)
@@ -144,6 +144,9 @@ Avp* EngineImpl::createAvp(const AvpId *id) throw(anna::RuntimeException) {
   if((result = allocateAvp()) == NULL)
     throw anna::RuntimeException("diameter::codec::EngineImpl::allocateAvp returns NULL", ANNA_FILE_LOCATION);
 
+  // Sets engine
+  result->setEngine((Engine*)this);
+
   //result->clear(); better clear this at releaseAvp(), see class-help implementation example
   if(id) result->setId(*id);
 
@@ -161,6 +164,9 @@ Message* EngineImpl::createMessage(const CommandId *id) throw(anna::RuntimeExcep
   if((result = allocateMessage()) == NULL)
     throw anna::RuntimeException("diameter::codec::EngineImpl::allocateMessage returns NULL", ANNA_FILE_LOCATION);
 
+  // Sets engine
+  result->setEngine((Engine*)this);
+
   //result->clear(); better clear this at releaseMessage(), see class-help implementation example
   if(id) result->setId(*id);