GoalID.h
Go to the documentation of this file.
00001 #ifndef _ROS_actionlib_msgs_GoalID_h
00002 #define _ROS_actionlib_msgs_GoalID_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "ros/time.h"
00009 
00010 namespace actionlib_msgs
00011 {
00012 
00013   class GoalID : public ros::Msg
00014   {
00015     public:
00016       ros::Time stamp;
00017       const char* id;
00018 
00019     virtual int serialize(unsigned char *outbuffer) const
00020     {
00021       int offset = 0;
00022       *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF;
00023       *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF;
00024       *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF;
00025       *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF;
00026       offset += sizeof(this->stamp.sec);
00027       *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF;
00028       *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF;
00029       *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF;
00030       *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF;
00031       offset += sizeof(this->stamp.nsec);
00032       uint32_t length_id = strlen(this->id);
00033       memcpy(outbuffer + offset, &length_id, sizeof(uint32_t));
00034       offset += 4;
00035       memcpy(outbuffer + offset, this->id, length_id);
00036       offset += length_id;
00037       return offset;
00038     }
00039 
00040     virtual int deserialize(unsigned char *inbuffer)
00041     {
00042       int offset = 0;
00043       this->stamp.sec =  ((uint32_t) (*(inbuffer + offset)));
00044       this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00045       this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00046       this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00047       offset += sizeof(this->stamp.sec);
00048       this->stamp.nsec =  ((uint32_t) (*(inbuffer + offset)));
00049       this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00050       this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00051       this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00052       offset += sizeof(this->stamp.nsec);
00053       uint32_t length_id;
00054       memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t));
00055       offset += 4;
00056       for(unsigned int k= offset; k< offset+length_id; ++k){
00057           inbuffer[k-1]=inbuffer[k];
00058       }
00059       inbuffer[offset+length_id-1]=0;
00060       this->id = (char *)(inbuffer + offset-1);
00061       offset += length_id;
00062      return offset;
00063     }
00064 
00065     const char * getType(){ return "actionlib_msgs/GoalID"; };
00066     const char * getMD5(){ return "302881f31927c1df708a2dbab0e80ee8"; };
00067 
00068   };
00069 
00070 }
00071 #endif


ric_mc
Author(s): RoboTiCan
autogenerated on Fri May 20 2016 03:48:55