Remove core-comm dependency through CounterManager/timex in core/oam subsystem. Basic...
[anna.git] / example / diameter / launcher / main.cpp
index 17200e8..1f5a2e0 100644 (file)
 // Authors: eduardo.ramos.testillano@gmail.com
 //          cisco.tierra@gmail.com
 
-
-/*
-   Establece un manejador externo para controlar el teclado, recoge los parametros de la operacion
-   por este y envia la peticion al servidor.
-*/
 #include <iostream>
 #include <fstream>
 
@@ -86,6 +81,7 @@ namespace diameter {
 namespace comm {
 class Entity;
 class Response;
+class LocalServer;
 }
 }
 }
@@ -98,8 +94,7 @@ class Response;
 anna::diameter::comm::Message G_commMsgSent2c, G_commMsgSent2e, G_commMsgFwd2c, G_commMsgFwd2e;
 anna::diameter::comm::Message G_commMsg;
 anna::diameter::codec::Message G_codecMsg, G_codecAnsMsg;
-anna::Recycler<anna::diameter::comm::Message> G_commMessages; // create en el forward de requets sin answer programada
-// realease en el forward de answers
+anna::Recycler<anna::diameter::comm::Message> G_commMessages; // create on requests forwards without programmed answer / release in answers forward
 
 
 // Auxiliary resources for answers programming
@@ -187,6 +182,7 @@ private:
 };
 
 
+/*
 class MyCounterRecorder : public anna::oam::CounterRecorder {
 
    // pure virtual definitions:
@@ -195,7 +191,7 @@ class MyCounterRecorder : public anna::oam::CounterRecorder {
    void close() throw() {;}
    std::string asString() const throw() { return "Physical dump not implemented: see memory accumulations writting context (kill -10 <pid>)"; }
 };
-
+*/
 
 class Launcher : public anna::comm::Application {
 
@@ -207,7 +203,7 @@ class Launcher : public anna::comm::Application {
    bool a_splitLog, a_detailedLog;
    anna::time::Date a_start_time;
    anna::timex::Engine* a_timeEngine;
-   MyCounterRecorder *a_counterRecorder;
+   //MyCounterRecorder *a_counterRecorder;
    std::string a_cerPathfile;
    std::string a_dwrPathfile;
 
@@ -908,7 +904,7 @@ Launcher::Launcher() : anna::comm::Application("launcher", "DiameterLauncher", "
    a_splitLog = false;
    a_detailedLog = false;
    a_timeEngine = NULL;
-   a_counterRecorder = NULL;
+   //a_counterRecorder = NULL;
    a_entity = NULL;
    a_diameterLocalServer = NULL;
    a_cerPathfile = "cer.xml";
@@ -1182,7 +1178,7 @@ throw(anna::RuntimeException) {
 //      workMode = anna::comm::Communicator::WorkMode::Clone;
    a_communicator = new MyCommunicator(workMode);
    a_timeEngine = new anna::timex::Engine((anna::Millisecond)300000, (anna::Millisecond)150);
-   a_counterRecorder = new MyCounterRecorder();
+   //a_counterRecorder = new MyCounterRecorder();
 }
 
 void Launcher::run()
@@ -1297,10 +1293,10 @@ throw(anna::RuntimeException) {
    oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::LevelValidation__FailedRuleForCardinalityMoreThanNeeded,                 "", 17 /*2017*/);
    oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::LevelValidation__FailedGenericAvpRuleForCardinalityFoundDisregardedItem, "", 18 /*2018*/);
    oamDiameterCodec.registerCounter(anna::diameter::codec::OamModule::Counter::LevelValidation__FoundDisregardedItemsAndGenericAVPWasNotSpecified,      "", 19 /*2019*/);
-   anna::oam::CounterManager& cm = anna::oam::CounterManager::instantiate();
-   cm.setEngine(a_timeEngine);
-   cm.setRecordPeriod(Millisecond(300000));
-   cm.setCounterRecorder(static_cast<anna::oam::CounterRecorder*>(a_counterRecorder));
+   //anna::oam::CounterManager& cm = anna::oam::CounterManager::instantiate();
+   //cm.setEngine(a_timeEngine);
+   //cm.setRecordPeriod(Millisecond(300000));
+   ////cm.setCounterRecorder(static_cast<anna::oam::CounterRecorder*>(a_counterRecorder));  ... will be NULL
 
    // Checking command line parameters
    if (cl.exists("sessionBasedModelsClientSocketSelection")) {