Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more
DemuxDelete.h
00001 #ifndef _ROS_SERVICE_DemuxDelete_h 00002 #define _ROS_SERVICE_DemuxDelete_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 DEMUXDELETE[] = "topic_tools/DemuxDelete"; 00012 00013 class DemuxDeleteRequest : public ros::Msg 00014 { 00015 public: 00016 const char* topic; 00017 00018 DemuxDeleteRequest(): 00019 topic("") 00020 { 00021 } 00022 00023 virtual int serialize(unsigned char *outbuffer) const 00024 { 00025 int offset = 0; 00026 uint32_t length_topic = strlen(this->topic); 00027 memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); 00028 offset += 4; 00029 memcpy(outbuffer + offset, this->topic, length_topic); 00030 offset += length_topic; 00031 return offset; 00032 } 00033 00034 virtual int deserialize(unsigned char *inbuffer) 00035 { 00036 int offset = 0; 00037 uint32_t length_topic; 00038 memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); 00039 offset += 4; 00040 for(unsigned int k= offset; k< offset+length_topic; ++k){ 00041 inbuffer[k-1]=inbuffer[k]; 00042 } 00043 inbuffer[offset+length_topic-1]=0; 00044 this->topic = (char *)(inbuffer + offset-1); 00045 offset += length_topic; 00046 return offset; 00047 } 00048 00049 const char * getType(){ return DEMUXDELETE; }; 00050 const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; 00051 00052 }; 00053 00054 class DemuxDeleteResponse : public ros::Msg 00055 { 00056 public: 00057 00058 DemuxDeleteResponse() 00059 { 00060 } 00061 00062 virtual int serialize(unsigned char *outbuffer) const 00063 { 00064 int offset = 0; 00065 return offset; 00066 } 00067 00068 virtual int deserialize(unsigned char *inbuffer) 00069 { 00070 int offset = 0; 00071 return offset; 00072 } 00073 00074 const char * getType(){ return DEMUXDELETE; }; 00075 const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; 00076 00077 }; 00078 00079 class DemuxDelete { 00080 public: 00081 typedef DemuxDeleteRequest Request; 00082 typedef DemuxDeleteResponse Response; 00083 }; 00084 00085 } 00086 #endif
Generated on Tue Jul 12 2022 18:39:38 by
1.7.2