Time.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef _ROS_std_msgs_Time_h
19 #define _ROS_std_msgs_Time_h
20 
21 #include <stdint.h>
22 #include <string.h>
23 #include <stdlib.h>
24 #include "ros/msg.h"
25 #include "ros/time.h"
26 
27 namespace std_msgs
28 {
29 
30  class Time : public ros::Msg
31  {
32  public:
34 
35  Time():
36  data()
37  {
38  }
39 
40  virtual int serialize(unsigned char *outbuffer) const
41  {
42  int offset = 0;
43  *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF;
44  *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF;
45  *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF;
46  *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF;
47  offset += sizeof(this->data.sec);
48  *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF;
49  *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF;
50  *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF;
51  *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF;
52  offset += sizeof(this->data.nsec);
53  return offset;
54  }
55 
56  virtual int deserialize(unsigned char *inbuffer)
57  {
58  int offset = 0;
59  this->data.sec = ((uint32_t) (*(inbuffer + offset)));
60  this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
61  this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
62  this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
63  offset += sizeof(this->data.sec);
64  this->data.nsec = ((uint32_t) (*(inbuffer + offset)));
65  this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
66  this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
67  this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
68  offset += sizeof(this->data.nsec);
69  return offset;
70  }
71 
72  const char * getType(){ return "std_msgs/Time"; };
73  const char * getMD5(){ return "cd7166c74c552c311fbcc2fe5a7bc289"; };
74 
75  };
76 
77 }
78 #endif
Definition: time.h:30
ros::Time data
Definition: Time.h:33
virtual int deserialize(unsigned char *inbuffer)
Definition: Time.h:56
const char * getMD5()
Definition: Time.h:73
virtual int serialize(unsigned char *outbuffer) const
Definition: Time.h:40
const char * getType()
Definition: Time.h:72
Definition: msg.h:26


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Tue Oct 20 2020 03:35:57