Config.h
Go to the documentation of this file.
00001 #ifndef _ROS_dynamic_reconfigure_Config_h
00002 #define _ROS_dynamic_reconfigure_Config_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "dynamic_reconfigure/BoolParameter.h"
00009 #include "dynamic_reconfigure/IntParameter.h"
00010 #include "dynamic_reconfigure/StrParameter.h"
00011 #include "dynamic_reconfigure/DoubleParameter.h"
00012 #include "dynamic_reconfigure/GroupState.h"
00013 
00014 namespace dynamic_reconfigure
00015 {
00016 
00017   class Config : public ros::Msg
00018   {
00019     public:
00020       uint8_t bools_length;
00021       dynamic_reconfigure::BoolParameter st_bools;
00022       dynamic_reconfigure::BoolParameter * bools;
00023       uint8_t ints_length;
00024       dynamic_reconfigure::IntParameter st_ints;
00025       dynamic_reconfigure::IntParameter * ints;
00026       uint8_t strs_length;
00027       dynamic_reconfigure::StrParameter st_strs;
00028       dynamic_reconfigure::StrParameter * strs;
00029       uint8_t doubles_length;
00030       dynamic_reconfigure::DoubleParameter st_doubles;
00031       dynamic_reconfigure::DoubleParameter * doubles;
00032       uint8_t groups_length;
00033       dynamic_reconfigure::GroupState st_groups;
00034       dynamic_reconfigure::GroupState * groups;
00035 
00036     virtual int serialize(unsigned char *outbuffer) const
00037     {
00038       int offset = 0;
00039       *(outbuffer + offset++) = bools_length;
00040       *(outbuffer + offset++) = 0;
00041       *(outbuffer + offset++) = 0;
00042       *(outbuffer + offset++) = 0;
00043       for( uint8_t i = 0; i < bools_length; i++){
00044       offset += this->bools[i].serialize(outbuffer + offset);
00045       }
00046       *(outbuffer + offset++) = ints_length;
00047       *(outbuffer + offset++) = 0;
00048       *(outbuffer + offset++) = 0;
00049       *(outbuffer + offset++) = 0;
00050       for( uint8_t i = 0; i < ints_length; i++){
00051       offset += this->ints[i].serialize(outbuffer + offset);
00052       }
00053       *(outbuffer + offset++) = strs_length;
00054       *(outbuffer + offset++) = 0;
00055       *(outbuffer + offset++) = 0;
00056       *(outbuffer + offset++) = 0;
00057       for( uint8_t i = 0; i < strs_length; i++){
00058       offset += this->strs[i].serialize(outbuffer + offset);
00059       }
00060       *(outbuffer + offset++) = doubles_length;
00061       *(outbuffer + offset++) = 0;
00062       *(outbuffer + offset++) = 0;
00063       *(outbuffer + offset++) = 0;
00064       for( uint8_t i = 0; i < doubles_length; i++){
00065       offset += this->doubles[i].serialize(outbuffer + offset);
00066       }
00067       *(outbuffer + offset++) = groups_length;
00068       *(outbuffer + offset++) = 0;
00069       *(outbuffer + offset++) = 0;
00070       *(outbuffer + offset++) = 0;
00071       for( uint8_t i = 0; i < groups_length; i++){
00072       offset += this->groups[i].serialize(outbuffer + offset);
00073       }
00074       return offset;
00075     }
00076 
00077     virtual int deserialize(unsigned char *inbuffer)
00078     {
00079       int offset = 0;
00080       uint8_t bools_lengthT = *(inbuffer + offset++);
00081       if(bools_lengthT > bools_length)
00082         this->bools = (dynamic_reconfigure::BoolParameter*)realloc(this->bools, bools_lengthT * sizeof(dynamic_reconfigure::BoolParameter));
00083       offset += 3;
00084       bools_length = bools_lengthT;
00085       for( uint8_t i = 0; i < bools_length; i++){
00086       offset += this->st_bools.deserialize(inbuffer + offset);
00087         memcpy( &(this->bools[i]), &(this->st_bools), sizeof(dynamic_reconfigure::BoolParameter));
00088       }
00089       uint8_t ints_lengthT = *(inbuffer + offset++);
00090       if(ints_lengthT > ints_length)
00091         this->ints = (dynamic_reconfigure::IntParameter*)realloc(this->ints, ints_lengthT * sizeof(dynamic_reconfigure::IntParameter));
00092       offset += 3;
00093       ints_length = ints_lengthT;
00094       for( uint8_t i = 0; i < ints_length; i++){
00095       offset += this->st_ints.deserialize(inbuffer + offset);
00096         memcpy( &(this->ints[i]), &(this->st_ints), sizeof(dynamic_reconfigure::IntParameter));
00097       }
00098       uint8_t strs_lengthT = *(inbuffer + offset++);
00099       if(strs_lengthT > strs_length)
00100         this->strs = (dynamic_reconfigure::StrParameter*)realloc(this->strs, strs_lengthT * sizeof(dynamic_reconfigure::StrParameter));
00101       offset += 3;
00102       strs_length = strs_lengthT;
00103       for( uint8_t i = 0; i < strs_length; i++){
00104       offset += this->st_strs.deserialize(inbuffer + offset);
00105         memcpy( &(this->strs[i]), &(this->st_strs), sizeof(dynamic_reconfigure::StrParameter));
00106       }
00107       uint8_t doubles_lengthT = *(inbuffer + offset++);
00108       if(doubles_lengthT > doubles_length)
00109         this->doubles = (dynamic_reconfigure::DoubleParameter*)realloc(this->doubles, doubles_lengthT * sizeof(dynamic_reconfigure::DoubleParameter));
00110       offset += 3;
00111       doubles_length = doubles_lengthT;
00112       for( uint8_t i = 0; i < doubles_length; i++){
00113       offset += this->st_doubles.deserialize(inbuffer + offset);
00114         memcpy( &(this->doubles[i]), &(this->st_doubles), sizeof(dynamic_reconfigure::DoubleParameter));
00115       }
00116       uint8_t groups_lengthT = *(inbuffer + offset++);
00117       if(groups_lengthT > groups_length)
00118         this->groups = (dynamic_reconfigure::GroupState*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::GroupState));
00119       offset += 3;
00120       groups_length = groups_lengthT;
00121       for( uint8_t i = 0; i < groups_length; i++){
00122       offset += this->st_groups.deserialize(inbuffer + offset);
00123         memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::GroupState));
00124       }
00125      return offset;
00126     }
00127 
00128     const char * getType(){ return "dynamic_reconfigure/Config"; };
00129     const char * getMD5(){ return "958f16a05573709014982821e6822580"; };
00130 
00131   };
00132 
00133 }
00134 #endif


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