GroupState.h
Go to the documentation of this file.
00001 #ifndef _ROS_dynamic_reconfigure_GroupState_h
00002 #define _ROS_dynamic_reconfigure_GroupState_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace dynamic_reconfigure
00010 {
00011 
00012   class GroupState : public ros::Msg
00013   {
00014     public:
00015       const char* name;
00016       bool state;
00017       int32_t id;
00018       int32_t parent;
00019 
00020     virtual int serialize(unsigned char *outbuffer) const
00021     {
00022       int offset = 0;
00023       uint32_t length_name = strlen(this->name);
00024       memcpy(outbuffer + offset, &length_name, sizeof(uint32_t));
00025       offset += 4;
00026       memcpy(outbuffer + offset, this->name, length_name);
00027       offset += length_name;
00028       union {
00029         bool real;
00030         uint8_t base;
00031       } u_state;
00032       u_state.real = this->state;
00033       *(outbuffer + offset + 0) = (u_state.base >> (8 * 0)) & 0xFF;
00034       offset += sizeof(this->state);
00035       union {
00036         int32_t real;
00037         uint32_t base;
00038       } u_id;
00039       u_id.real = this->id;
00040       *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF;
00041       *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF;
00042       *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF;
00043       *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF;
00044       offset += sizeof(this->id);
00045       union {
00046         int32_t real;
00047         uint32_t base;
00048       } u_parent;
00049       u_parent.real = this->parent;
00050       *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF;
00051       *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF;
00052       *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF;
00053       *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF;
00054       offset += sizeof(this->parent);
00055       return offset;
00056     }
00057 
00058     virtual int deserialize(unsigned char *inbuffer)
00059     {
00060       int offset = 0;
00061       uint32_t length_name;
00062       memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t));
00063       offset += 4;
00064       for(unsigned int k= offset; k< offset+length_name; ++k){
00065           inbuffer[k-1]=inbuffer[k];
00066       }
00067       inbuffer[offset+length_name-1]=0;
00068       this->name = (char *)(inbuffer + offset-1);
00069       offset += length_name;
00070       union {
00071         bool real;
00072         uint8_t base;
00073       } u_state;
00074       u_state.base = 0;
00075       u_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00076       this->state = u_state.real;
00077       offset += sizeof(this->state);
00078       union {
00079         int32_t real;
00080         uint32_t base;
00081       } u_id;
00082       u_id.base = 0;
00083       u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00084       u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00085       u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00086       u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00087       this->id = u_id.real;
00088       offset += sizeof(this->id);
00089       union {
00090         int32_t real;
00091         uint32_t base;
00092       } u_parent;
00093       u_parent.base = 0;
00094       u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00095       u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00096       u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00097       u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00098       this->parent = u_parent.real;
00099       offset += sizeof(this->parent);
00100      return offset;
00101     }
00102 
00103     const char * getType(){ return "dynamic_reconfigure/GroupState"; };
00104     const char * getMD5(){ return "a2d87f51dc22930325041a2f8b1571f8"; };
00105 
00106   };
00107 
00108 }
00109 #endif


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