RequestMessageInfo.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *   http://www.apache.org/licenses/LICENSE-2.0
00009 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016  
00017 
00018 #ifndef _ROS_SERVICE_RequestMessageInfo_h
00019 #define _ROS_SERVICE_RequestMessageInfo_h
00020 #include <stdint.h>
00021 #include <string.h>
00022 #include <stdlib.h>
00023 #include "ros/msg.h"
00024 
00025 namespace rosserial_msgs
00026 {
00027 
00028 static const char REQUESTMESSAGEINFO[] = "rosserial_msgs/RequestMessageInfo";
00029 
00030   class RequestMessageInfoRequest : public ros::Msg
00031   {
00032     public:
00033       const char* type;
00034 
00035     RequestMessageInfoRequest():
00036       type("")
00037     {
00038     }
00039 
00040     virtual int serialize(unsigned char *outbuffer) const
00041     {
00042       int offset = 0;
00043       uint32_t length_type = strlen(this->type);
00044       memcpy(outbuffer + offset, &length_type, sizeof(uint32_t));
00045       offset += 4;
00046       memcpy(outbuffer + offset, this->type, length_type);
00047       offset += length_type;
00048       return offset;
00049     }
00050 
00051     virtual int deserialize(unsigned char *inbuffer)
00052     {
00053       int offset = 0;
00054       uint32_t length_type;
00055       memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t));
00056       offset += 4;
00057       for(unsigned int k= offset; k< offset+length_type; ++k){
00058           inbuffer[k-1]=inbuffer[k];
00059       }
00060       inbuffer[offset+length_type-1]=0;
00061       this->type = (char *)(inbuffer + offset-1);
00062       offset += length_type;
00063      return offset;
00064     }
00065 
00066     const char * getType(){ return REQUESTMESSAGEINFO; };
00067     const char * getMD5(){ return "dc67331de85cf97091b7d45e5c64ab75"; };
00068 
00069   };
00070 
00071   class RequestMessageInfoResponse : public ros::Msg
00072   {
00073     public:
00074       const char* md5;
00075       const char* definition;
00076 
00077     RequestMessageInfoResponse():
00078       md5(""),
00079       definition("")
00080     {
00081     }
00082 
00083     virtual int serialize(unsigned char *outbuffer) const
00084     {
00085       int offset = 0;
00086       uint32_t length_md5 = strlen(this->md5);
00087       memcpy(outbuffer + offset, &length_md5, sizeof(uint32_t));
00088       offset += 4;
00089       memcpy(outbuffer + offset, this->md5, length_md5);
00090       offset += length_md5;
00091       uint32_t length_definition = strlen(this->definition);
00092       memcpy(outbuffer + offset, &length_definition, sizeof(uint32_t));
00093       offset += 4;
00094       memcpy(outbuffer + offset, this->definition, length_definition);
00095       offset += length_definition;
00096       return offset;
00097     }
00098 
00099     virtual int deserialize(unsigned char *inbuffer)
00100     {
00101       int offset = 0;
00102       uint32_t length_md5;
00103       memcpy(&length_md5, (inbuffer + offset), sizeof(uint32_t));
00104       offset += 4;
00105       for(unsigned int k= offset; k< offset+length_md5; ++k){
00106           inbuffer[k-1]=inbuffer[k];
00107       }
00108       inbuffer[offset+length_md5-1]=0;
00109       this->md5 = (char *)(inbuffer + offset-1);
00110       offset += length_md5;
00111       uint32_t length_definition;
00112       memcpy(&length_definition, (inbuffer + offset), sizeof(uint32_t));
00113       offset += 4;
00114       for(unsigned int k= offset; k< offset+length_definition; ++k){
00115           inbuffer[k-1]=inbuffer[k];
00116       }
00117       inbuffer[offset+length_definition-1]=0;
00118       this->definition = (char *)(inbuffer + offset-1);
00119       offset += length_definition;
00120      return offset;
00121     }
00122 
00123     const char * getType(){ return REQUESTMESSAGEINFO; };
00124     const char * getMD5(){ return "fe452186a069bed40f09b8628fe5eac8"; };
00125 
00126   };
00127 
00128   class RequestMessageInfo {
00129     public:
00130     typedef RequestMessageInfoRequest Request;
00131     typedef RequestMessageInfoResponse Response;
00132   };
00133 
00134 }
00135 #endif


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Thu Jun 6 2019 20:43:57