1 #ifndef _ROS_SERVICE_MuxList_h
2 #define _ROS_SERVICE_MuxList_h
11 static const char MUXLIST[] =
"topic_tools/MuxList";
21 virtual int serialize(
unsigned char *outbuffer)
const
34 const char *
getMD5(){
return "d41d8cd98f00b204e9800998ecf8427e"; };
50 virtual int serialize(
unsigned char *outbuffer)
const
54 *(outbuffer + offset++) = 0;
55 *(outbuffer + offset++) = 0;
56 *(outbuffer + offset++) = 0;
58 uint32_t length_topicsi = strlen(this->
topics[i]);
59 memcpy(outbuffer + offset, &length_topicsi,
sizeof(uint32_t));
61 memcpy(outbuffer + offset, this->
topics[i], length_topicsi);
62 offset += length_topicsi;
70 uint8_t topics_lengthT = *(inbuffer + offset++);
72 this->
topics = (
char**)realloc(this->
topics, topics_lengthT *
sizeof(
char*));
76 uint32_t length_st_topics;
77 memcpy(&length_st_topics, (inbuffer + offset),
sizeof(uint32_t));
79 for(
unsigned int k= offset; k< offset+length_st_topics; ++k){
80 inbuffer[k-1]=inbuffer[k];
82 inbuffer[offset+length_st_topics-1]=0;
83 this->
st_topics = (
char *)(inbuffer + offset-1);
84 offset += length_st_topics;
91 const char *
getMD5(){
return "b0eef9a05d4e829092fc2f2c3c2aad3d"; };