kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
Int16.h
Go to the documentation of this file.
1 #ifndef _ROS_std_msgs_Int16_h
2 #define _ROS_std_msgs_Int16_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 
9 namespace std_msgs
10 {
11 
12  class Int16 : public ros::Msg
13  {
14  public:
15  int16_t data;
16 
17  Int16():
18  data(0)
19  {
20  }
21 
22  virtual int serialize(unsigned char *outbuffer) const
23  {
24  int offset = 0;
25  union {
26  int16_t real;
27  uint16_t base;
28  } u_data;
29  u_data.real = this->data;
30  *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF;
31  *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF;
32  offset += sizeof(this->data);
33  return offset;
34  }
35 
36  virtual int deserialize(unsigned char *inbuffer)
37  {
38  int offset = 0;
39  union {
40  int16_t real;
41  uint16_t base;
42  } u_data;
43  u_data.base = 0;
44  u_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0);
45  u_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1);
46  this->data = u_data.real;
47  offset += sizeof(this->data);
48  return offset;
49  }
50 
51  const char * getType(){ return "std_msgs/Int16"; };
52  const char * getMD5(){ return "8524586e34fbd7cb1c08c5f5f1ca0e57"; };
53 
54  };
55 
56 }
57 #endif
virtual int deserialize(unsigned char *inbuffer)
Definition: Int16.h:36
const char * getMD5()
Definition: Int16.h:52
Definition: Int16.h:12
Int16()
Definition: Int16.h:17
virtual int serialize(unsigned char *outbuffer) const
Definition: Int16.h:22
int16_t data
Definition: Int16.h:15
const char * getType()
Definition: Int16.h:51
Definition: msg.h:43