1 #ifndef _ROS_sensor_msgs_PointField_h
2 #define _ROS_sensor_msgs_PointField_h
36 virtual int serialize(
unsigned char *outbuffer)
const
39 uint32_t length_name = strlen(this->
name);
40 memcpy(outbuffer + offset, &length_name,
sizeof(uint32_t));
42 memcpy(outbuffer + offset, this->
name, length_name);
43 offset += length_name;
44 *(outbuffer + offset + 0) = (this->offset >> (8 * 0)) & 0xFF;
45 *(outbuffer + offset + 1) = (this->offset >> (8 * 1)) & 0xFF;
46 *(outbuffer + offset + 2) = (this->offset >> (8 * 2)) & 0xFF;
47 *(outbuffer + offset + 3) = (this->offset >> (8 * 3)) & 0xFF;
48 offset +=
sizeof(this->
offset);
49 *(outbuffer + offset + 0) = (this->
datatype >> (8 * 0)) & 0xFF;
51 *(outbuffer + offset + 0) = (this->
count >> (8 * 0)) & 0xFF;
52 *(outbuffer + offset + 1) = (this->
count >> (8 * 1)) & 0xFF;
53 *(outbuffer + offset + 2) = (this->
count >> (8 * 2)) & 0xFF;
54 *(outbuffer + offset + 3) = (this->
count >> (8 * 3)) & 0xFF;
55 offset +=
sizeof(this->
count);
63 memcpy(&length_name, (inbuffer + offset),
sizeof(uint32_t));
65 for(
unsigned int k= offset; k< offset+length_name; ++k){
66 inbuffer[k-1]=inbuffer[k];
68 inbuffer[offset+length_name-1]=0;
69 this->
name = (
char *)(inbuffer + offset-1);
70 offset += length_name;
71 this->offset = ((uint32_t) (*(inbuffer + offset)));
72 this->offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
73 this->offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
74 this->offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
75 offset +=
sizeof(this->
offset);
76 this->
datatype = ((uint8_t) (*(inbuffer + offset)));
78 this->
count = ((uint32_t) (*(inbuffer + offset)));
79 this->
count |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
80 this->
count |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
81 this->
count |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
82 offset +=
sizeof(this->
count);
86 const char *
getType(){
return "sensor_msgs/PointField"; };
87 const char *
getMD5(){
return "268eacb2962780ceac86cbd17e328150"; };
const char * getType()
Definition: PointField.h:86
Definition: PointField.h:22
uint32_t count
Definition: PointField.h:18
Definition: PointField.h:20
PointField()
Definition: PointField.h:28
const char * getMD5()
Definition: PointField.h:87
Definition: PointField.h:24
virtual int serialize(unsigned char *outbuffer) const
Definition: PointField.h:36
Definition: PointField.h:12
Definition: PointField.h:19
Definition: PointField.h:25
virtual int deserialize(unsigned char *inbuffer)
Definition: PointField.h:59
uint32_t offset
Definition: PointField.h:16
const char * name
Definition: PointField.h:15
Definition: PointField.h:23
Definition: PointField.h:21
Definition: PointField.h:26
uint8_t datatype
Definition: PointField.h:17