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.
Dependencies: mbed
StringString.h
00001 #ifndef _ROS_SERVICE_StringString_h 00002 #define _ROS_SERVICE_StringString_h 00003 #include <stdint.h> 00004 #include <string.h> 00005 #include <stdlib.h> 00006 #include "ros/msg.h" 00007 00008 namespace roseus 00009 { 00010 00011 static const char STRINGSTRING[] = "roseus/StringString"; 00012 00013 class StringStringRequest : public ros::Msg 00014 { 00015 public: 00016 typedef const char* _str_type; 00017 _str_type str; 00018 00019 StringStringRequest(): 00020 str("") 00021 { 00022 } 00023 00024 virtual int serialize(unsigned char *outbuffer) const 00025 { 00026 int offset = 0; 00027 uint32_t length_str = strlen(this->str); 00028 varToArr(outbuffer + offset, length_str); 00029 offset += 4; 00030 memcpy(outbuffer + offset, this->str, length_str); 00031 offset += length_str; 00032 return offset; 00033 } 00034 00035 virtual int deserialize(unsigned char *inbuffer) 00036 { 00037 int offset = 0; 00038 uint32_t length_str; 00039 arrToVar(length_str, (inbuffer + offset)); 00040 offset += 4; 00041 for(unsigned int k= offset; k< offset+length_str; ++k){ 00042 inbuffer[k-1]=inbuffer[k]; 00043 } 00044 inbuffer[offset+length_str-1]=0; 00045 this->str = (char *)(inbuffer + offset-1); 00046 offset += length_str; 00047 return offset; 00048 } 00049 00050 virtual const char * getType(){ return STRINGSTRING; }; 00051 virtual const char * getMD5(){ return "994972b6e03928b2476860ce6c4c8e17"; }; 00052 00053 }; 00054 00055 class StringStringResponse : public ros::Msg 00056 { 00057 public: 00058 typedef const char* _str_type; 00059 _str_type str; 00060 00061 StringStringResponse(): 00062 str("") 00063 { 00064 } 00065 00066 virtual int serialize(unsigned char *outbuffer) const 00067 { 00068 int offset = 0; 00069 uint32_t length_str = strlen(this->str); 00070 varToArr(outbuffer + offset, length_str); 00071 offset += 4; 00072 memcpy(outbuffer + offset, this->str, length_str); 00073 offset += length_str; 00074 return offset; 00075 } 00076 00077 virtual int deserialize(unsigned char *inbuffer) 00078 { 00079 int offset = 0; 00080 uint32_t length_str; 00081 arrToVar(length_str, (inbuffer + offset)); 00082 offset += 4; 00083 for(unsigned int k= offset; k< offset+length_str; ++k){ 00084 inbuffer[k-1]=inbuffer[k]; 00085 } 00086 inbuffer[offset+length_str-1]=0; 00087 this->str = (char *)(inbuffer + offset-1); 00088 offset += length_str; 00089 return offset; 00090 } 00091 00092 virtual const char * getType(){ return STRINGSTRING; }; 00093 virtual const char * getMD5(){ return "994972b6e03928b2476860ce6c4c8e17"; }; 00094 00095 }; 00096 00097 class StringString { 00098 public: 00099 typedef StringStringRequest Request; 00100 typedef StringStringResponse Response; 00101 }; 00102 00103 } 00104 #endif
Generated on Mon Sep 26 2022 13:47:03 by
