PortNamingConvention.cpp

Go to the documentation of this file.
00001 /*
00002 Copyright 2007, 2008, 2009, 2010, 2011 Instituto de Sistemas e Robotica, Instituto Superior Tecnico
00003 
00004 This file is part of MeRMaID.
00005 
00006 MeRMaID is free software: you can redistribute it and/or modify
00007 it under the terms of the GNU Lesser General Public License as published by
00008 the Free Software Foundation, either version 3 of the License, or
00009 (at your option) any later version.
00010 
00011 MeRMaID is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU Lesser General Public License for more details.
00015 
00016 You should have received a copy of the GNU Lesser General Public License
00017 along with MeRMaID.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00019 
00020 
00021 
00022 /**
00023  * @Filename PortNamingConvention.cpp
00024  * @Description PortNamingConvention implementation
00025  * @Status Work in Progress
00026  * @Version $Id: PortNamingConvention.cpp 1 2011-03-04 18:13:18Z jreis $
00027  * @Maintainer
00028  */
00029 
00030 #include "config.h"
00031 
00032 #include "PortNamingConvention.hpp"
00033 
00034 #include <sstream>
00035 #include <string>
00036 
00037 using namespace mermaid::support::communication;
00038 
00039 std::string PortNamingConvention::getServiceRequestRequestPortName (std::string requesterEntityName, std::string requesterServiceName, std::string targetEntityName, std::string targetServiceName)
00040 {
00041   std::stringstream ss;
00042   
00043   ss << "/" << requesterEntityName << "/" << requesterServiceName << "/" << "service-request" << "/" << "request" << "/" << targetEntityName << "/" << targetServiceName;
00044   
00045   return ss.str();
00046 }; // getServiceRequestRequestPort()
00047 
00048 std::string PortNamingConvention::getServiceRequestInputPortName (std::string entityName, std::string serviceName)
00049 {
00050   std::stringstream ss;
00051   
00052   ss << "/" << entityName << "/" << serviceName << "/" << "service-request" << "/" << "input";
00053   
00054   return ss.str();
00055 }; // getServiceRequestInputPortName()
00056 
00057 
00058 std::string PortNamingConvention::getServiceRequestOutputPortName (std::string entityName, std::string serviceName, std::string requesterEntityName, std::string requesterServiceName)
00059 {
00060   std::stringstream ss;
00061   
00062   ss << "/" << entityName << "/" << serviceName << "/" << "service-request" << "/" << "output" << "/" << requesterEntityName << "/" << requesterServiceName;
00063   
00064   return ss.str();
00065 }; // getServiceRequestOutputPortName()
00066 
00067 std::string PortNamingConvention::getServiceRequestReplyPortName (std::string requesterEntityName, std::string requesterServiceName, std::string targetEntityName, std::string targetServiceName)
00068 {
00069   std::stringstream ss;
00070   
00071   ss << "/" << requesterEntityName << "/" << requesterServiceName << "/" << "service-request" << "/" << "reply" << "/" << targetEntityName << "/" << targetServiceName;
00072   
00073   return ss.str();
00074 }; // getServiceRequestReplyPortName()
00075 
00076 std::string PortNamingConvention::getDataFeedOutputPortName (std::string producerEntityName, std::string producerServiceName, std::string producerDatafeedName)
00077 {
00078   std::stringstream ss;
00079   
00080   ss << "/" << producerEntityName << "/" << producerServiceName << "/" << "data-feed" << "/" << "output" << "/" << producerDatafeedName;
00081   return ss.str();
00082 }; // getDataFeedOutputPortName()
00083 
00084 std::string PortNamingConvention::getDataFeedInputPortName (std::string consumerEntityName, std::string consumerServiceName, std::string producerEntityName, std::string producerServiceName, std::string producerDatafeedName)
00085 {
00086   std::stringstream ss;
00087   
00088   ss << "/" << consumerEntityName << "/" << consumerServiceName << "/" << "data-feed" << "/" << "input" << "/" << producerEntityName << "/" << producerServiceName << "/" << producerDatafeedName;
00089   return ss.str();
00090 }; // getDataFeedInputPortName()
Generated on Fri Mar 4 22:14:58 2011 for MeRMaID::support by  doxygen 1.6.3