RequestMessageInfo.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_SERVICE_RequestMessageInfo_h
19 #define _ROS_SERVICE_RequestMessageInfo_h
20 #include <stdint.h>
21 #include <string.h>
22 #include <stdlib.h>
23 #include "ros/msg.h"
24 
25 namespace rosserial_msgs
26 {
27 
28 static const char REQUESTMESSAGEINFO[] = "rosserial_msgs/RequestMessageInfo";
29 
31  {
32  public:
33  const char* type;
34 
36  type("")
37  {
38  }
39 
40  virtual int serialize(unsigned char *outbuffer) const
41  {
42  int offset = 0;
43  uint32_t length_type = strlen(this->type);
44  memcpy(outbuffer + offset, &length_type, sizeof(uint32_t));
45  offset += 4;
46  memcpy(outbuffer + offset, this->type, length_type);
47  offset += length_type;
48  return offset;
49  }
50 
51  virtual int deserialize(unsigned char *inbuffer)
52  {
53  int offset = 0;
54  uint32_t length_type;
55  memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t));
56  offset += 4;
57  for(unsigned int k= offset; k< offset+length_type; ++k){
58  inbuffer[k-1]=inbuffer[k];
59  }
60  inbuffer[offset+length_type-1]=0;
61  this->type = (char *)(inbuffer + offset-1);
62  offset += length_type;
63  return offset;
64  }
65 
66  const char * getType(){ return REQUESTMESSAGEINFO; };
67  const char * getMD5(){ return "dc67331de85cf97091b7d45e5c64ab75"; };
68 
69  };
70 
72  {
73  public:
74  const char* md5;
75  const char* definition;
76 
78  md5(""),
79  definition("")
80  {
81  }
82 
83  virtual int serialize(unsigned char *outbuffer) const
84  {
85  int offset = 0;
86  uint32_t length_md5 = strlen(this->md5);
87  memcpy(outbuffer + offset, &length_md5, sizeof(uint32_t));
88  offset += 4;
89  memcpy(outbuffer + offset, this->md5, length_md5);
90  offset += length_md5;
91  uint32_t length_definition = strlen(this->definition);
92  memcpy(outbuffer + offset, &length_definition, sizeof(uint32_t));
93  offset += 4;
94  memcpy(outbuffer + offset, this->definition, length_definition);
95  offset += length_definition;
96  return offset;
97  }
98 
99  virtual int deserialize(unsigned char *inbuffer)
100  {
101  int offset = 0;
102  uint32_t length_md5;
103  memcpy(&length_md5, (inbuffer + offset), sizeof(uint32_t));
104  offset += 4;
105  for(unsigned int k= offset; k< offset+length_md5; ++k){
106  inbuffer[k-1]=inbuffer[k];
107  }
108  inbuffer[offset+length_md5-1]=0;
109  this->md5 = (char *)(inbuffer + offset-1);
110  offset += length_md5;
111  uint32_t length_definition;
112  memcpy(&length_definition, (inbuffer + offset), sizeof(uint32_t));
113  offset += 4;
114  for(unsigned int k= offset; k< offset+length_definition; ++k){
115  inbuffer[k-1]=inbuffer[k];
116  }
117  inbuffer[offset+length_definition-1]=0;
118  this->definition = (char *)(inbuffer + offset-1);
119  offset += length_definition;
120  return offset;
121  }
122 
123  const char * getType(){ return REQUESTMESSAGEINFO; };
124  const char * getMD5(){ return "fe452186a069bed40f09b8628fe5eac8"; };
125 
126  };
127 
129  public:
132  };
133 
134 }
135 #endif
virtual int deserialize(unsigned char *inbuffer)
virtual int deserialize(unsigned char *inbuffer)
virtual int serialize(unsigned char *outbuffer) const
virtual int serialize(unsigned char *outbuffer) const
RequestMessageInfoResponse Response
RequestMessageInfoRequest Request
Definition: msg.h:26
static const char REQUESTMESSAGEINFO[]


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