1 #ifndef _ROS_diagnostic_msgs_KeyValue_h
2 #define _ROS_diagnostic_msgs_KeyValue_h
9 namespace diagnostic_msgs
24 virtual int serialize(
unsigned char *outbuffer)
const
27 uint32_t length_key = strlen(this->
key);
28 memcpy(outbuffer + offset, &length_key,
sizeof(uint32_t));
30 memcpy(outbuffer + offset, this->
key, length_key);
32 uint32_t length_value = strlen(this->
value);
33 memcpy(outbuffer + offset, &length_value,
sizeof(uint32_t));
35 memcpy(outbuffer + offset, this->
value, length_value);
36 offset += length_value;
44 memcpy(&length_key, (inbuffer + offset),
sizeof(uint32_t));
46 for(
unsigned int k= offset; k< offset+length_key; ++k){
47 inbuffer[k-1]=inbuffer[k];
49 inbuffer[offset+length_key-1]=0;
50 this->
key = (
char *)(inbuffer + offset-1);
52 uint32_t length_value;
53 memcpy(&length_value, (inbuffer + offset),
sizeof(uint32_t));
55 for(
unsigned int k= offset; k< offset+length_value; ++k){
56 inbuffer[k-1]=inbuffer[k];
58 inbuffer[offset+length_value-1]=0;
59 this->
value = (
char *)(inbuffer + offset-1);
60 offset += length_value;
64 const char *
getType(){
return "diagnostic_msgs/KeyValue"; };
65 const char *
getMD5(){
return "cf57fdc6617a881a88c16e768132149c"; };
virtual int serialize(unsigned char *outbuffer) const
Definition: KeyValue.h:24
const char * getType()
Definition: KeyValue.h:64
const char * key
Definition: KeyValue.h:15
KeyValue()
Definition: KeyValue.h:18
const char * getMD5()
Definition: KeyValue.h:65
Definition: KeyValue.h:12
virtual int deserialize(unsigned char *inbuffer)
Definition: KeyValue.h:40
const char * value
Definition: KeyValue.h:16