ListControllerTypes.h
Go to the documentation of this file.
00001 #ifndef _ROS_SERVICE_ListControllerTypes_h
00002 #define _ROS_SERVICE_ListControllerTypes_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007 
00008 namespace pr2_mechanism_msgs
00009 {
00010 
00011 static const char LISTCONTROLLERTYPES[] = "pr2_mechanism_msgs/ListControllerTypes";
00012 
00013   class ListControllerTypesRequest : public ros::Msg
00014   {
00015     public:
00016 
00017     virtual int serialize(unsigned char *outbuffer) const
00018     {
00019       int offset = 0;
00020       return offset;
00021     }
00022 
00023     virtual int deserialize(unsigned char *inbuffer)
00024     {
00025       int offset = 0;
00026      return offset;
00027     }
00028 
00029     const char * getType(){ return LISTCONTROLLERTYPES; };
00030     const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
00031 
00032   };
00033 
00034   class ListControllerTypesResponse : public ros::Msg
00035   {
00036     public:
00037       uint8_t types_length;
00038       char* st_types;
00039       char* * types;
00040 
00041     virtual int serialize(unsigned char *outbuffer) const
00042     {
00043       int offset = 0;
00044       *(outbuffer + offset++) = types_length;
00045       *(outbuffer + offset++) = 0;
00046       *(outbuffer + offset++) = 0;
00047       *(outbuffer + offset++) = 0;
00048       for( uint8_t i = 0; i < types_length; i++){
00049       uint32_t length_typesi = strlen(this->types[i]);
00050       memcpy(outbuffer + offset, &length_typesi, sizeof(uint32_t));
00051       offset += 4;
00052       memcpy(outbuffer + offset, this->types[i], length_typesi);
00053       offset += length_typesi;
00054       }
00055       return offset;
00056     }
00057 
00058     virtual int deserialize(unsigned char *inbuffer)
00059     {
00060       int offset = 0;
00061       uint8_t types_lengthT = *(inbuffer + offset++);
00062       if(types_lengthT > types_length)
00063         this->types = (char**)realloc(this->types, types_lengthT * sizeof(char*));
00064       offset += 3;
00065       types_length = types_lengthT;
00066       for( uint8_t i = 0; i < types_length; i++){
00067       uint32_t length_st_types;
00068       memcpy(&length_st_types, (inbuffer + offset), sizeof(uint32_t));
00069       offset += 4;
00070       for(unsigned int k= offset; k< offset+length_st_types; ++k){
00071           inbuffer[k-1]=inbuffer[k];
00072       }
00073       inbuffer[offset+length_st_types-1]=0;
00074       this->st_types = (char *)(inbuffer + offset-1);
00075       offset += length_st_types;
00076         memcpy( &(this->types[i]), &(this->st_types), sizeof(char*));
00077       }
00078      return offset;
00079     }
00080 
00081     const char * getType(){ return LISTCONTROLLERTYPES; };
00082     const char * getMD5(){ return "80aee506387f88339842e9a93044c959"; };
00083 
00084   };
00085 
00086   class ListControllerTypes {
00087     public:
00088     typedef ListControllerTypesRequest Request;
00089     typedef ListControllerTypesResponse Response;
00090   };
00091 
00092 }
00093 #endif


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