kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
GoalID.h
Go to the documentation of this file.
1 #ifndef _ROS_actionlib_msgs_GoalID_h
2 #define _ROS_actionlib_msgs_GoalID_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 #include "ros/time.h"
9 
10 namespace actionlib_msgs
11 {
12 
13  class GoalID : public ros::Msg
14  {
15  public:
17  const char* id;
18 
19  GoalID():
20  stamp(),
21  id("")
22  {
23  }
24 
25  virtual int serialize(unsigned char *outbuffer) const
26  {
27  int offset = 0;
28  *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF;
29  *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF;
30  *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF;
31  *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF;
32  offset += sizeof(this->stamp.sec);
33  *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF;
34  *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF;
35  *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF;
36  *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF;
37  offset += sizeof(this->stamp.nsec);
38  uint32_t length_id = strlen(this->id);
39  memcpy(outbuffer + offset, &length_id, sizeof(uint32_t));
40  offset += 4;
41  memcpy(outbuffer + offset, this->id, length_id);
42  offset += length_id;
43  return offset;
44  }
45 
46  virtual int deserialize(unsigned char *inbuffer)
47  {
48  int offset = 0;
49  this->stamp.sec = ((uint32_t) (*(inbuffer + offset)));
50  this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
51  this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
52  this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
53  offset += sizeof(this->stamp.sec);
54  this->stamp.nsec = ((uint32_t) (*(inbuffer + offset)));
55  this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
56  this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
57  this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
58  offset += sizeof(this->stamp.nsec);
59  uint32_t length_id;
60  memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t));
61  offset += 4;
62  for(unsigned int k= offset; k< offset+length_id; ++k){
63  inbuffer[k-1]=inbuffer[k];
64  }
65  inbuffer[offset+length_id-1]=0;
66  this->id = (char *)(inbuffer + offset-1);
67  offset += length_id;
68  return offset;
69  }
70 
71  const char * getType(){ return "actionlib_msgs/GoalID"; };
72  const char * getMD5(){ return "302881f31927c1df708a2dbab0e80ee8"; };
73 
74  };
75 
76 }
77 #endif
uint32_t nsec
Definition: time.h:50
uint32_t sec
Definition: time.h:50
Definition: time.h:47
Definition: GoalID.h:13
GoalID()
Definition: GoalID.h:19
const char * getMD5()
Definition: GoalID.h:72
virtual int deserialize(unsigned char *inbuffer)
Definition: GoalID.h:46
const char * getType()
Definition: GoalID.h:71
Definition: msg.h:43
virtual int serialize(unsigned char *outbuffer) const
Definition: GoalID.h:25
ros::Time stamp
Definition: GoalID.h:16
const char * id
Definition: GoalID.h:17