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


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