kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
Clock.h
Go to the documentation of this file.
1 #ifndef _ROS_rosgraph_msgs_Clock_h
2 #define _ROS_rosgraph_msgs_Clock_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 rosgraph_msgs
11 {
12 
13  class Clock : public ros::Msg
14  {
15  public:
17 
18  Clock():
19  clock()
20  {
21  }
22 
23  virtual int serialize(unsigned char *outbuffer) const
24  {
25  int offset = 0;
26  *(outbuffer + offset + 0) = (this->clock.sec >> (8 * 0)) & 0xFF;
27  *(outbuffer + offset + 1) = (this->clock.sec >> (8 * 1)) & 0xFF;
28  *(outbuffer + offset + 2) = (this->clock.sec >> (8 * 2)) & 0xFF;
29  *(outbuffer + offset + 3) = (this->clock.sec >> (8 * 3)) & 0xFF;
30  offset += sizeof(this->clock.sec);
31  *(outbuffer + offset + 0) = (this->clock.nsec >> (8 * 0)) & 0xFF;
32  *(outbuffer + offset + 1) = (this->clock.nsec >> (8 * 1)) & 0xFF;
33  *(outbuffer + offset + 2) = (this->clock.nsec >> (8 * 2)) & 0xFF;
34  *(outbuffer + offset + 3) = (this->clock.nsec >> (8 * 3)) & 0xFF;
35  offset += sizeof(this->clock.nsec);
36  return offset;
37  }
38 
39  virtual int deserialize(unsigned char *inbuffer)
40  {
41  int offset = 0;
42  this->clock.sec = ((uint32_t) (*(inbuffer + offset)));
43  this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
44  this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
45  this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
46  offset += sizeof(this->clock.sec);
47  this->clock.nsec = ((uint32_t) (*(inbuffer + offset)));
48  this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
49  this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
50  this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
51  offset += sizeof(this->clock.nsec);
52  return offset;
53  }
54 
55  const char * getType(){ return "rosgraph_msgs/Clock"; };
56  const char * getMD5(){ return "a9c97c1d230cfc112e270351a944ee47"; };
57 
58  };
59 
60 }
61 #endif
uint32_t nsec
Definition: time.h:50
uint32_t sec
Definition: time.h:50
virtual int serialize(unsigned char *outbuffer) const
Definition: Clock.h:23
Definition: time.h:47
Definition: Clock.h:13
ros::Time clock
Definition: Clock.h:16
const char * getMD5()
Definition: Clock.h:56
Clock()
Definition: Clock.h:18
virtual int deserialize(unsigned char *inbuffer)
Definition: Clock.h:39
const char * getType()
Definition: Clock.h:55
Definition: msg.h:43