From ceeebd91917454b325b4a36a70e3c77a1e40041a Mon Sep 17 00:00:00 2001 From: Ruud Overeem <overeem@astron.nl> Date: Wed, 16 Jul 2008 12:56:41 +0000 Subject: [PATCH] Bug 1189: Moved headerfile of ClaimMgrTask to include directory. --- .../{src => include/APL/RTDBCommon}/ClaimMgrTask.h | 2 +- MAC/APL/RTDBCommon/include/APL/RTDBCommon/Makefile.am | 2 +- MAC/APL/RTDBCommon/src/ClaimMgrTask.cc | 10 ++++++++-- MAC/APL/RTDBCommon/src/Makefile.am | 2 +- MAC/APL/RTDBCommon/test/tClaimManager.cc | 4 +++- MAC/APL/RTDBCommon/test/tClaimManager.h | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) rename MAC/APL/RTDBCommon/{src => include/APL/RTDBCommon}/ClaimMgrTask.h (96%) diff --git a/MAC/APL/RTDBCommon/src/ClaimMgrTask.h b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h similarity index 96% rename from MAC/APL/RTDBCommon/src/ClaimMgrTask.h rename to MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h index 9c3e6754db4..3fc8c378e85 100644 --- a/MAC/APL/RTDBCommon/src/ClaimMgrTask.h +++ b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h @@ -51,7 +51,7 @@ public: static ClaimMgrTask* instance(bool temporary = false); static void release(); - // member functions + // Ask the claimManager the claim an object. An ClaimReply event is send to the given port. void claimObject(const string& objectType, const string& nameInAppl, GCFPortInterface& replyPort); diff --git a/MAC/APL/RTDBCommon/include/APL/RTDBCommon/Makefile.am b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/Makefile.am index aa8ccc6d38a..8b8a74bc5dd 100644 --- a/MAC/APL/RTDBCommon/include/APL/RTDBCommon/Makefile.am +++ b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/Makefile.am @@ -1,4 +1,4 @@ -INSTHDRS = RTDButilities.h +INSTHDRS = RTDButilities.h ClaimMgrTask.h NOINSTHDRS = TCCHDRS = diff --git a/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc b/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc index 666884f12fc..f6e998a35ac 100644 --- a/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc +++ b/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc @@ -26,8 +26,8 @@ #include <GCF/PVSS/GCF_PVString.h> #include <GCF/RTDB/DP_Protocol.ph> +#include <APL/RTDBCommon/ClaimMgrTask.h> #include "CM_Protocol.ph" -#include "ClaimMgrTask.h" namespace LOFAR { using namespace GCF::TM; @@ -219,7 +219,13 @@ GCFEvent::TResult ClaimMgrTask::operational(GCFEvent& event, GCFPortInterface& p } if (itsFieldsReceived >= 3) { LOG_DEBUG_STR("@@@@@ NewObjectName = " << itsResultDPname); - // ... BACK TO USER + // Report claimresult back to the user + CMClaimResultEvent cmEvent; + cmEvent.typeName = itsObjectType; + cmEvent.nameInAppl = itsNameInAppl; + cmEvent.DPname = itsResultDPname; + itsReplyPort->send(cmEvent); + // clear admin to reaceive a new calim request. itsObjectType.clear(); itsNameInAppl.clear(); itsResultDPname.clear(); diff --git a/MAC/APL/RTDBCommon/src/Makefile.am b/MAC/APL/RTDBCommon/src/Makefile.am index 0fd1c3f2912..855b277dafa 100644 --- a/MAC/APL/RTDBCommon/src/Makefile.am +++ b/MAC/APL/RTDBCommon/src/Makefile.am @@ -12,7 +12,7 @@ clean-local: bin_PROGRAMS = versionrtdbcommon -INSTHDRS = CM_Protocol.ph ClaimMgrTask.h +INSTHDRS = CM_Protocol.ph NOINSTHDRS = BUILT_SOURCES = CM_Protocol.cc \ CM_Protocol.ph diff --git a/MAC/APL/RTDBCommon/test/tClaimManager.cc b/MAC/APL/RTDBCommon/test/tClaimManager.cc index 7907bfa93aa..6fd330d3525 100644 --- a/MAC/APL/RTDBCommon/test/tClaimManager.cc +++ b/MAC/APL/RTDBCommon/test/tClaimManager.cc @@ -43,6 +43,8 @@ MgrTest::MgrTest(const string& name) : itsTimerPort = new GCFTimerPort(*this, "timerPort"); ASSERTSTR(itsTimerPort, "=@=@= Can't allocate GCFTimerPort"); + itsMsgPort = new GCFITCPort (*this, *this, "ITCPort", GCFPortInterface::SAP, CM_PROTOCOL); + ASSERTSTR(itsMsgPort, "=@=@= Can't allocate GCFITCPort"); registerProtocol(F_FSM_PROTOCOL, F_FSM_PROTOCOL_STRINGS); registerProtocol(CM_PROTOCOL, CM_PROTOCOL_STRINGS); @@ -71,7 +73,7 @@ GCFEvent::TResult MgrTest::doTest(GCFEvent& event, GCFPortInterface& port) ASSERTSTR(itsClaimMgrTask, "Can't construct a claimMgrTask"); LOG_DEBUG_STR("=@=@= Calling claimManager for 'Observation7'"); - itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation7", *itsTimerPort); + itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation7", *itsMsgPort); itsTimerPort->setTimer(10.0); break; diff --git a/MAC/APL/RTDBCommon/test/tClaimManager.h b/MAC/APL/RTDBCommon/test/tClaimManager.h index de6c02bfa1d..7d011b55ddd 100644 --- a/MAC/APL/RTDBCommon/test/tClaimManager.h +++ b/MAC/APL/RTDBCommon/test/tClaimManager.h @@ -40,6 +40,7 @@ public: private: GCFTimerPort* itsTimerPort; + GCFITCPort* itsMsgPort; ClaimMgrTask* itsClaimMgrTask; }; -- GitLab