Go to the documentation of this file.00001 #ifndef _ROS_std_msgs_Int64MultiArray_h
00002 #define _ROS_std_msgs_Int64MultiArray_h
00003
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "std_msgs/MultiArrayLayout.h"
00009
00010 namespace std_msgs
00011 {
00012
00013 class Int64MultiArray : public ros::Msg
00014 {
00015 public:
00016 std_msgs::MultiArrayLayout layout;
00017 uint8_t data_length;
00018 int64_t st_data;
00019 int64_t * data;
00020
00021 virtual int serialize(unsigned char *outbuffer) const
00022 {
00023 int offset = 0;
00024 offset += this->layout.serialize(outbuffer + offset);
00025 *(outbuffer + offset++) = data_length;
00026 *(outbuffer + offset++) = 0;
00027 *(outbuffer + offset++) = 0;
00028 *(outbuffer + offset++) = 0;
00029 for( uint8_t i = 0; i < data_length; i++){
00030 union {
00031 int64_t real;
00032 uint64_t base;
00033 } u_datai;
00034 u_datai.real = this->data[i];
00035 *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF;
00036 *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF;
00037 *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF;
00038 *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF;
00039 *(outbuffer + offset + 4) = (u_datai.base >> (8 * 4)) & 0xFF;
00040 *(outbuffer + offset + 5) = (u_datai.base >> (8 * 5)) & 0xFF;
00041 *(outbuffer + offset + 6) = (u_datai.base >> (8 * 6)) & 0xFF;
00042 *(outbuffer + offset + 7) = (u_datai.base >> (8 * 7)) & 0xFF;
00043 offset += sizeof(this->data[i]);
00044 }
00045 return offset;
00046 }
00047
00048 virtual int deserialize(unsigned char *inbuffer)
00049 {
00050 int offset = 0;
00051 offset += this->layout.deserialize(inbuffer + offset);
00052 uint8_t data_lengthT = *(inbuffer + offset++);
00053 if(data_lengthT > data_length)
00054 this->data = (int64_t*)realloc(this->data, data_lengthT * sizeof(int64_t));
00055 offset += 3;
00056 data_length = data_lengthT;
00057 for( uint8_t i = 0; i < data_length; i++){
00058 union {
00059 int64_t real;
00060 uint64_t base;
00061 } u_st_data;
00062 u_st_data.base = 0;
00063 u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00064 u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00065 u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00066 u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00067 u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00068 u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00069 u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00070 u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00071 this->st_data = u_st_data.real;
00072 offset += sizeof(this->st_data);
00073 memcpy( &(this->data[i]), &(this->st_data), sizeof(int64_t));
00074 }
00075 return offset;
00076 }
00077
00078 const char * getType(){ return "std_msgs/Int64MultiArray"; };
00079 const char * getMD5(){ return "54865aa6c65be0448113a2afc6a49270"; };
00080
00081 };
00082
00083 }
00084 #endif