Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MultiArrayLayout.h
00001 #ifndef _ROS_std_msgs_MultiArrayLayout_h 00002 #define _ROS_std_msgs_MultiArrayLayout_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 #include "std_msgs/MultiArrayDimension.h" 00009 00010 namespace std_msgs 00011 { 00012 00013 class MultiArrayLayout : public ros::Msg 00014 { 00015 public: 00016 uint32_t dim_length; 00017 typedef std_msgs::MultiArrayDimension _dim_type; 00018 _dim_type st_dim; 00019 _dim_type * dim; 00020 typedef uint32_t _data_offset_type; 00021 _data_offset_type data_offset; 00022 00023 MultiArrayLayout(): 00024 dim_length(0), dim(NULL), 00025 data_offset(0) 00026 { 00027 } 00028 00029 virtual int serialize(unsigned char *outbuffer) const 00030 { 00031 int offset = 0; 00032 *(outbuffer + offset + 0) = (this->dim_length >> (8 * 0)) & 0xFF; 00033 *(outbuffer + offset + 1) = (this->dim_length >> (8 * 1)) & 0xFF; 00034 *(outbuffer + offset + 2) = (this->dim_length >> (8 * 2)) & 0xFF; 00035 *(outbuffer + offset + 3) = (this->dim_length >> (8 * 3)) & 0xFF; 00036 offset += sizeof(this->dim_length); 00037 for( uint32_t i = 0; i < dim_length; i++){ 00038 offset += this->dim[i].serialize(outbuffer + offset); 00039 } 00040 *(outbuffer + offset + 0) = (this->data_offset >> (8 * 0)) & 0xFF; 00041 *(outbuffer + offset + 1) = (this->data_offset >> (8 * 1)) & 0xFF; 00042 *(outbuffer + offset + 2) = (this->data_offset >> (8 * 2)) & 0xFF; 00043 *(outbuffer + offset + 3) = (this->data_offset >> (8 * 3)) & 0xFF; 00044 offset += sizeof(this->data_offset); 00045 return offset; 00046 } 00047 00048 virtual int deserialize(unsigned char *inbuffer) 00049 { 00050 int offset = 0; 00051 uint32_t dim_lengthT = ((uint32_t) (*(inbuffer + offset))); 00052 dim_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00053 dim_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00054 dim_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00055 offset += sizeof(this->dim_length); 00056 if(dim_lengthT > dim_length) 00057 this->dim = (std_msgs::MultiArrayDimension*)realloc(this->dim, dim_lengthT * sizeof(std_msgs::MultiArrayDimension)); 00058 dim_length = dim_lengthT; 00059 for( uint32_t i = 0; i < dim_length; i++){ 00060 offset += this->st_dim.deserialize(inbuffer + offset); 00061 memcpy( &(this->dim[i]), &(this->st_dim), sizeof(std_msgs::MultiArrayDimension)); 00062 } 00063 this->data_offset = ((uint32_t) (*(inbuffer + offset))); 00064 this->data_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00065 this->data_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00066 this->data_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00067 offset += sizeof(this->data_offset); 00068 return offset; 00069 } 00070 00071 const char * getType(){ return "std_msgs/MultiArrayLayout"; }; 00072 const char * getMD5(){ return "0fed2a11c13e11c5571b4e2a995a91a3"; }; 00073 00074 }; 00075 00076 } 00077 #endif
Generated on Wed Jul 13 2022 23:30:18 by
