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 controller_manager_msgs
00009 {
00010
00011 static const char LISTCONTROLLERTYPES[] = "controller_manager_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 uint8_t base_classes_length;
00041 char* st_base_classes;
00042 char* * base_classes;
00043
00044 virtual int serialize(unsigned char *outbuffer) const
00045 {
00046 int offset = 0;
00047 *(outbuffer + offset++) = types_length;
00048 *(outbuffer + offset++) = 0;
00049 *(outbuffer + offset++) = 0;
00050 *(outbuffer + offset++) = 0;
00051 for( uint8_t i = 0; i < types_length; i++){
00052 uint32_t length_typesi = strlen(this->types[i]);
00053 memcpy(outbuffer + offset, &length_typesi, sizeof(uint32_t));
00054 offset += 4;
00055 memcpy(outbuffer + offset, this->types[i], length_typesi);
00056 offset += length_typesi;
00057 }
00058 *(outbuffer + offset++) = base_classes_length;
00059 *(outbuffer + offset++) = 0;
00060 *(outbuffer + offset++) = 0;
00061 *(outbuffer + offset++) = 0;
00062 for( uint8_t i = 0; i < base_classes_length; i++){
00063 uint32_t length_base_classesi = strlen(this->base_classes[i]);
00064 memcpy(outbuffer + offset, &length_base_classesi, sizeof(uint32_t));
00065 offset += 4;
00066 memcpy(outbuffer + offset, this->base_classes[i], length_base_classesi);
00067 offset += length_base_classesi;
00068 }
00069 return offset;
00070 }
00071
00072 virtual int deserialize(unsigned char *inbuffer)
00073 {
00074 int offset = 0;
00075 uint8_t types_lengthT = *(inbuffer + offset++);
00076 if(types_lengthT > types_length)
00077 this->types = (char**)realloc(this->types, types_lengthT * sizeof(char*));
00078 offset += 3;
00079 types_length = types_lengthT;
00080 for( uint8_t i = 0; i < types_length; i++){
00081 uint32_t length_st_types;
00082 memcpy(&length_st_types, (inbuffer + offset), sizeof(uint32_t));
00083 offset += 4;
00084 for(unsigned int k= offset; k< offset+length_st_types; ++k){
00085 inbuffer[k-1]=inbuffer[k];
00086 }
00087 inbuffer[offset+length_st_types-1]=0;
00088 this->st_types = (char *)(inbuffer + offset-1);
00089 offset += length_st_types;
00090 memcpy( &(this->types[i]), &(this->st_types), sizeof(char*));
00091 }
00092 uint8_t base_classes_lengthT = *(inbuffer + offset++);
00093 if(base_classes_lengthT > base_classes_length)
00094 this->base_classes = (char**)realloc(this->base_classes, base_classes_lengthT * sizeof(char*));
00095 offset += 3;
00096 base_classes_length = base_classes_lengthT;
00097 for( uint8_t i = 0; i < base_classes_length; i++){
00098 uint32_t length_st_base_classes;
00099 memcpy(&length_st_base_classes, (inbuffer + offset), sizeof(uint32_t));
00100 offset += 4;
00101 for(unsigned int k= offset; k< offset+length_st_base_classes; ++k){
00102 inbuffer[k-1]=inbuffer[k];
00103 }
00104 inbuffer[offset+length_st_base_classes-1]=0;
00105 this->st_base_classes = (char *)(inbuffer + offset-1);
00106 offset += length_st_base_classes;
00107 memcpy( &(this->base_classes[i]), &(this->st_base_classes), sizeof(char*));
00108 }
00109 return offset;
00110 }
00111
00112 const char * getType(){ return LISTCONTROLLERTYPES; };
00113 const char * getMD5(){ return "c1d4cd11aefa9f97ba4aeb5b33987f4e"; };
00114
00115 };
00116
00117 class ListControllerTypes {
00118 public:
00119 typedef ListControllerTypesRequest Request;
00120 typedef ListControllerTypesResponse Response;
00121 };
00122
00123 }
00124 #endif