WMPServiceManager.h
Go to the documentation of this file.
00001 /*------------------------------------------------------------------------
00002  *---------------------           ros_rt_wmp              --------------------
00003  *------------------------------------------------------------------------
00004  *                                                         V0.1B  15/09/11
00005  *
00006  *
00007  *  File: ./src/WMPServiceManager.h
00008  *  Authors: Danilo Tardioli
00009  *  ----------------------------------------------------------------------
00010  *  Copyright (C) 2000-2011, Universidad de Zaragoza, SPAIN
00011  *
00012  *  Contact Addresses: Danilo Tardioli                   dantard@unizar.es
00013  *
00014  *  RT-WMP is free software; you can  redistribute it and/or  modify it
00015  *  under the terms of the GNU General Public License  as published by the
00016  *  Free Software Foundation;  either  version 2, or (at  your option) any
00017  *  later version.
00018  *
00019  *  RT-WMP  is distributed  in the  hope  that  it will be   useful, but
00020  *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
00021  *  MERCHANTABILITY  or  FITNESS FOR A  PARTICULAR PURPOSE.    See the GNU
00022  *  General Public License for more details.
00023  *
00024  *  You should have received  a  copy of  the  GNU General Public  License
00025  *  distributed with RT-WMP;  see file COPYING.   If not,  write to the
00026  *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
00027  *  02111-1307, USA.
00028  *
00029  *  As a  special exception, if you  link this  unit  with other  files to
00030  *  produce an   executable,   this unit  does  not  by  itself cause  the
00031  *  resulting executable to be covered by the  GNU General Public License.
00032  *  This exception does  not however invalidate  any other reasons why the
00033  *  executable file might be covered by the GNU Public License.
00034  *
00035  *----------------------------------------------------------------------*/
00036 
00037 #ifndef WMPSERVICEMANAGER_H_
00038 #define WMPSERVICEMANAGER_H_
00039 
00040 #include "ServiceManager.h"
00041 
00042 template<class T> class WMPServiceManager: public ServiceManager<T> {
00043 public:
00044         WMPServiceManager(ros::NodeHandle * n, int port, std::string name) :
00045                         ServiceManager<T>(n, port, name, 0) {
00046                 n->deleteParam(ServiceManager<T>::param_dest);
00047         }
00048 
00049 protected:
00050 
00051         void fillDestination(typename T::Request &req) {
00052                 if (req.dest == wmpGetNodeId()) {
00053                         ROS_ERROR(
00054                                         "Forbidden to call local service in a remote fashion, call will fail");
00055                 } else {
00056                         ServiceManager<T>::host = req.dest;
00057                 }
00058         }
00059 
00060         int getPriority(typename T::Request &req) {
00061                 return req.priority;
00062         }
00063 
00064 };
00065 
00066 
00067 #endif /* WMPSERVICEMANAGER_H_ */


ros_rt_wmp
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Mon Oct 6 2014 08:27:11