ParamDescription.h
Go to the documentation of this file.
00001 #ifndef _ROS_dynamic_reconfigure_ParamDescription_h
00002 #define _ROS_dynamic_reconfigure_ParamDescription_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace dynamic_reconfigure
00010 {
00011 
00012   class ParamDescription : public ros::Msg
00013   {
00014     public:
00015       const char* name;
00016       const char* type;
00017       uint32_t level;
00018       const char* description;
00019       const char* edit_method;
00020 
00021     virtual int serialize(unsigned char *outbuffer) const
00022     {
00023       int offset = 0;
00024       uint32_t length_name = strlen(this->name);
00025       memcpy(outbuffer + offset, &length_name, sizeof(uint32_t));
00026       offset += 4;
00027       memcpy(outbuffer + offset, this->name, length_name);
00028       offset += length_name;
00029       uint32_t length_type = strlen(this->type);
00030       memcpy(outbuffer + offset, &length_type, sizeof(uint32_t));
00031       offset += 4;
00032       memcpy(outbuffer + offset, this->type, length_type);
00033       offset += length_type;
00034       *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF;
00035       *(outbuffer + offset + 1) = (this->level >> (8 * 1)) & 0xFF;
00036       *(outbuffer + offset + 2) = (this->level >> (8 * 2)) & 0xFF;
00037       *(outbuffer + offset + 3) = (this->level >> (8 * 3)) & 0xFF;
00038       offset += sizeof(this->level);
00039       uint32_t length_description = strlen(this->description);
00040       memcpy(outbuffer + offset, &length_description, sizeof(uint32_t));
00041       offset += 4;
00042       memcpy(outbuffer + offset, this->description, length_description);
00043       offset += length_description;
00044       uint32_t length_edit_method = strlen(this->edit_method);
00045       memcpy(outbuffer + offset, &length_edit_method, sizeof(uint32_t));
00046       offset += 4;
00047       memcpy(outbuffer + offset, this->edit_method, length_edit_method);
00048       offset += length_edit_method;
00049       return offset;
00050     }
00051 
00052     virtual int deserialize(unsigned char *inbuffer)
00053     {
00054       int offset = 0;
00055       uint32_t length_name;
00056       memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t));
00057       offset += 4;
00058       for(unsigned int k= offset; k< offset+length_name; ++k){
00059           inbuffer[k-1]=inbuffer[k];
00060       }
00061       inbuffer[offset+length_name-1]=0;
00062       this->name = (char *)(inbuffer + offset-1);
00063       offset += length_name;
00064       uint32_t length_type;
00065       memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t));
00066       offset += 4;
00067       for(unsigned int k= offset; k< offset+length_type; ++k){
00068           inbuffer[k-1]=inbuffer[k];
00069       }
00070       inbuffer[offset+length_type-1]=0;
00071       this->type = (char *)(inbuffer + offset-1);
00072       offset += length_type;
00073       this->level =  ((uint32_t) (*(inbuffer + offset)));
00074       this->level |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00075       this->level |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00076       this->level |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00077       offset += sizeof(this->level);
00078       uint32_t length_description;
00079       memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t));
00080       offset += 4;
00081       for(unsigned int k= offset; k< offset+length_description; ++k){
00082           inbuffer[k-1]=inbuffer[k];
00083       }
00084       inbuffer[offset+length_description-1]=0;
00085       this->description = (char *)(inbuffer + offset-1);
00086       offset += length_description;
00087       uint32_t length_edit_method;
00088       memcpy(&length_edit_method, (inbuffer + offset), sizeof(uint32_t));
00089       offset += 4;
00090       for(unsigned int k= offset; k< offset+length_edit_method; ++k){
00091           inbuffer[k-1]=inbuffer[k];
00092       }
00093       inbuffer[offset+length_edit_method-1]=0;
00094       this->edit_method = (char *)(inbuffer + offset-1);
00095       offset += length_edit_method;
00096      return offset;
00097     }
00098 
00099     const char * getType(){ return "dynamic_reconfigure/ParamDescription"; };
00100     const char * getMD5(){ return "7434fcb9348c13054e0c3b267c8cb34d"; };
00101 
00102   };
00103 
00104 }
00105 #endif


ric_mc
Author(s): RoboTiCan
autogenerated on Thu Aug 27 2015 14:39:50