Go to the documentation of this file.00001 #ifndef _ROS_SERVICE_MuxSelect_h
00002 #define _ROS_SERVICE_MuxSelect_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007
00008 namespace topic_tools
00009 {
00010
00011 static const char MUXSELECT[] = "topic_tools/MuxSelect";
00012
00013 class MuxSelectRequest : public ros::Msg
00014 {
00015 public:
00016 const char* topic;
00017
00018 virtual int serialize(unsigned char *outbuffer) const
00019 {
00020 int offset = 0;
00021 uint32_t length_topic = strlen(this->topic);
00022 memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t));
00023 offset += 4;
00024 memcpy(outbuffer + offset, this->topic, length_topic);
00025 offset += length_topic;
00026 return offset;
00027 }
00028
00029 virtual int deserialize(unsigned char *inbuffer)
00030 {
00031 int offset = 0;
00032 uint32_t length_topic;
00033 memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t));
00034 offset += 4;
00035 for(unsigned int k= offset; k< offset+length_topic; ++k){
00036 inbuffer[k-1]=inbuffer[k];
00037 }
00038 inbuffer[offset+length_topic-1]=0;
00039 this->topic = (char *)(inbuffer + offset-1);
00040 offset += length_topic;
00041 return offset;
00042 }
00043
00044 const char * getType(){ return MUXSELECT; };
00045 const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; };
00046
00047 };
00048
00049 class MuxSelectResponse : public ros::Msg
00050 {
00051 public:
00052 const char* prev_topic;
00053
00054 virtual int serialize(unsigned char *outbuffer) const
00055 {
00056 int offset = 0;
00057 uint32_t length_prev_topic = strlen(this->prev_topic);
00058 memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t));
00059 offset += 4;
00060 memcpy(outbuffer + offset, this->prev_topic, length_prev_topic);
00061 offset += length_prev_topic;
00062 return offset;
00063 }
00064
00065 virtual int deserialize(unsigned char *inbuffer)
00066 {
00067 int offset = 0;
00068 uint32_t length_prev_topic;
00069 memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t));
00070 offset += 4;
00071 for(unsigned int k= offset; k< offset+length_prev_topic; ++k){
00072 inbuffer[k-1]=inbuffer[k];
00073 }
00074 inbuffer[offset+length_prev_topic-1]=0;
00075 this->prev_topic = (char *)(inbuffer + offset-1);
00076 offset += length_prev_topic;
00077 return offset;
00078 }
00079
00080 const char * getType(){ return MUXSELECT; };
00081 const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; };
00082
00083 };
00084
00085 class MuxSelect {
00086 public:
00087 typedef MuxSelectRequest Request;
00088 typedef MuxSelectResponse Response;
00089 };
00090
00091 }
00092 #endif