YarpDataFeedOutputPort.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 YarpDataFeedOutputPort.cpp
00024  * @Description YarpDataFeedOutputPort implementation
00025  * @Status Work in Progress
00026  * @Version $Id: YarpDataFeedOutputPort.cpp 1 2011-03-04 18:13:18Z jreis $
00027  * @Maintainer
00028  */
00029 
00030 #include "config.h"
00031 
00032 #include "YarpDataFeedOutputPort.hpp"
00033 
00034 #include <PortNamingConvention.hpp>
00035 
00036 #include <Exception.hpp>
00037 
00038 #include <yarp/os/all.h>
00039 
00040 using namespace mermaid::support::communication;
00041 
00042 using mermaid::support::errorhandling::Exception;
00043 using yarp::os::Network;
00044 
00045 YarpDataFeedOutputPort::YarpDataFeedOutputPort (std::string entityName, std::string serviceName, std::string datafeedName)
00046 {
00047   entityName_ = entityName;
00048   serviceName_ = serviceName;
00049   datafeedName_ = datafeedName;
00050   
00051   std::string portName = PortNamingConvention::getDataFeedOutputPortName (entityName, serviceName, datafeedName);
00052   
00053   //open port
00054   if (!open (portName.c_str())) {
00055     throw Exception ("YarpDataFeedOutputPort::YarpDataFeedOutputPort : could not open YARP port with name: " + portName);
00056   }
00057   
00058   //set strict output
00059   this->setStrict (true);
00060   
00061 }; // YarpDataFeedOutputPort();
00062 
00063 std::string YarpDataFeedOutputPort::getEntityName()
00064 {
00065   return entityName_;
00066 }; // getEntityName()
00067 
00068 std::string YarpDataFeedOutputPort::getServiceInstanceName()
00069 {
00070   return serviceName_;
00071 }; // getServiceInstanceName()
00072 
00073 std::string YarpDataFeedOutputPort::getDataFeedName()
00074 {
00075   return datafeedName_;
00076 }; // getDataFeedName()
Generated on Fri Mar 4 22:14:58 2011 for MeRMaID::support by  doxygen 1.6.3