New feature to allow to register components with different names for same class:...
[anna.git] / example / diameter / launcher / ProgrammedAnswers.cpp
index 5f6dd4f..f617282 100644 (file)
@@ -19,8 +19,7 @@
 
 void ProgrammedAnswers::clear () throw() {
   for (reacting_answers_const_iterator it = a_deques.begin(); it != a_deques.end(); it++) {
-       anna::diameter::codec::Engine *engine = anna::functions::component <Engine> (ANNA_FILE_LOCATION);
-       engine->releaseMessage(*(it->second->begin()));
+       a_codecEngine->releaseMessage(*(it->second->begin()));
        delete(it->second);
   }
   a_deques.clear();
@@ -70,12 +69,11 @@ void ProgrammedAnswers::nextMessage(int code) throw() { //pops the deque and rel
   reacting_answers_const_iterator it = a_deques.find(code);
   if (it != a_deques.end()) {
        if (!it->second->empty()) {
-         anna::diameter::codec::Engine *engine = anna::functions::component <Engine> (ANNA_FILE_LOCATION);
          if (a_rotate) {
                addMessage(code, *(it->second->begin()));
          }
          else {
-               engine->releaseMessage(*(it->second->begin()));
+               a_codecEngine->releaseMessage(*(it->second->begin()));
          }
          it->second->pop_front();
        }
@@ -89,6 +87,8 @@ std::string ProgrammedAnswers::asString(const char *queueName) const throw() {
   aux += "', Rotation ";
   aux += a_rotate ? "enabled":"disabled";
   result += anna::functions::highlightJustify(aux);
+  result += "Codec engine: ";
+  result += a_codecEngine->getClassName();
   if(a_deques.size() != 0) {
        for(reacting_answers_const_iterator it = a_deques.begin(); it != a_deques.end(); it++) {
          if (it->second->size() != 0) {