From d173257ab82b5982fc6bad09a6c5fe631b03a73b Mon Sep 17 00:00:00 2001 From: Ruben Smits Date: Fri, 10 Dec 2010 11:22:57 +0100 Subject: [PATCH] enable reporting of ports which are nested in Services Signed-off-by: Ruben Smits --- reporting/ReportingComponent.cpp | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/reporting/ReportingComponent.cpp b/reporting/ReportingComponent.cpp index 6ca9000..5ceba3d 100644 --- a/reporting/ReportingComponent.cpp +++ b/reporting/ReportingComponent.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "ocl/Component.hpp" #include @@ -261,7 +262,20 @@ namespace OCL log(Error) << "Could not report Component " << component <<" : no such peer."<ports()->getPort(port); + std::vector strs; + boost::split(strs, port, boost::is_any_of(".")); + Service::shared_ptr service=comp->provides(); + while ( strs.size() != 1 && service) { + service = service->getService( strs.front() ); + if (service) + strs.erase( strs.begin() ); + } + if (!service) { + log(Error) <<"No such service: '"<< strs.front() <<"' while looking for port '"<< port<<"'"<getPort(strs.front()); if ( !porti ) { log(Error) << "Could not report Port " << port <<" : no such port on Component "<