JoyFeedbackArray.h
Go to the documentation of this file.
00001 #ifndef ros_sensor_msgs_JoyFeedbackArray_h
00002 #define ros_sensor_msgs_JoyFeedbackArray_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "../ros/msg.h"
00008 #include "sensor_msgs/JoyFeedback.h"
00009 
00010 namespace sensor_msgs
00011 {
00012 
00013   class JoyFeedbackArray : public ros::Msg
00014   {
00015     public:
00016       unsigned char array_length;
00017       sensor_msgs::JoyFeedback st_array;
00018       sensor_msgs::JoyFeedback * array;
00019 
00020     virtual int serialize(unsigned char *outbuffer)
00021     {
00022       int offset = 0;
00023       *(outbuffer + offset++) = array_length;
00024       *(outbuffer + offset++) = 0;
00025       *(outbuffer + offset++) = 0;
00026       *(outbuffer + offset++) = 0;
00027       for( unsigned char i = 0; i < array_length; i++){
00028       offset += this->array[i].serialize(outbuffer + offset);
00029       }
00030       return offset;
00031     }
00032 
00033     virtual int deserialize(unsigned char *inbuffer)
00034     {
00035       int offset = 0;
00036       unsigned char array_lengthT = *(inbuffer + offset++);
00037       if(array_lengthT > array_length)
00038         this->array = (sensor_msgs::JoyFeedback*)realloc(this->array, array_lengthT * sizeof(sensor_msgs::JoyFeedback));
00039       offset += 3;
00040       array_length = array_lengthT;
00041       for( unsigned char i = 0; i < array_length; i++){
00042       offset += this->st_array.deserialize(inbuffer + offset);
00043         memcpy( &(this->array[i]), &(this->st_array), sizeof(sensor_msgs::JoyFeedback));
00044       }
00045      return offset;
00046     }
00047 
00048     const char * getType(){ return "sensor_msgs/JoyFeedbackArray"; };
00049 
00050   };
00051 
00052 }
00053 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


traxbot_robot
Author(s): André Gonçalves Araújo
autogenerated on Fri Feb 1 2013 13:21:12