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.
Dependencies: mbed
TouchEvent.h
00001 #ifndef _ROS_jsk_gui_msgs_TouchEvent_h 00002 #define _ROS_jsk_gui_msgs_TouchEvent_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace jsk_gui_msgs 00010 { 00011 00012 class TouchEvent : public ros::Msg 00013 { 00014 public: 00015 typedef int8_t _state_type; 00016 _state_type state; 00017 typedef float _x_type; 00018 _x_type x; 00019 typedef float _y_type; 00020 _y_type y; 00021 typedef float _w_type; 00022 _w_type w; 00023 typedef float _h_type; 00024 _h_type h; 00025 enum { DOWN = 0 }; 00026 enum { UP = 1 }; 00027 enum { MOVE = 2 }; 00028 00029 TouchEvent(): 00030 state(0), 00031 x(0), 00032 y(0), 00033 w(0), 00034 h(0) 00035 { 00036 } 00037 00038 virtual int serialize(unsigned char *outbuffer) const 00039 { 00040 int offset = 0; 00041 union { 00042 int8_t real; 00043 uint8_t base; 00044 } u_state; 00045 u_state.real = this->state; 00046 *(outbuffer + offset + 0) = (u_state.base >> (8 * 0)) & 0xFF; 00047 offset += sizeof(this->state); 00048 union { 00049 float real; 00050 uint32_t base; 00051 } u_x; 00052 u_x.real = this->x; 00053 *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; 00054 *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; 00055 *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; 00056 *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; 00057 offset += sizeof(this->x); 00058 union { 00059 float real; 00060 uint32_t base; 00061 } u_y; 00062 u_y.real = this->y; 00063 *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; 00064 *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; 00065 *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; 00066 *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; 00067 offset += sizeof(this->y); 00068 union { 00069 float real; 00070 uint32_t base; 00071 } u_w; 00072 u_w.real = this->w; 00073 *(outbuffer + offset + 0) = (u_w.base >> (8 * 0)) & 0xFF; 00074 *(outbuffer + offset + 1) = (u_w.base >> (8 * 1)) & 0xFF; 00075 *(outbuffer + offset + 2) = (u_w.base >> (8 * 2)) & 0xFF; 00076 *(outbuffer + offset + 3) = (u_w.base >> (8 * 3)) & 0xFF; 00077 offset += sizeof(this->w); 00078 union { 00079 float real; 00080 uint32_t base; 00081 } u_h; 00082 u_h.real = this->h; 00083 *(outbuffer + offset + 0) = (u_h.base >> (8 * 0)) & 0xFF; 00084 *(outbuffer + offset + 1) = (u_h.base >> (8 * 1)) & 0xFF; 00085 *(outbuffer + offset + 2) = (u_h.base >> (8 * 2)) & 0xFF; 00086 *(outbuffer + offset + 3) = (u_h.base >> (8 * 3)) & 0xFF; 00087 offset += sizeof(this->h); 00088 return offset; 00089 } 00090 00091 virtual int deserialize(unsigned char *inbuffer) 00092 { 00093 int offset = 0; 00094 union { 00095 int8_t real; 00096 uint8_t base; 00097 } u_state; 00098 u_state.base = 0; 00099 u_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00100 this->state = u_state.real; 00101 offset += sizeof(this->state); 00102 union { 00103 float real; 00104 uint32_t base; 00105 } u_x; 00106 u_x.base = 0; 00107 u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00108 u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00109 u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00110 u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00111 this->x = u_x.real; 00112 offset += sizeof(this->x); 00113 union { 00114 float real; 00115 uint32_t base; 00116 } u_y; 00117 u_y.base = 0; 00118 u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00119 u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00120 u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00121 u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00122 this->y = u_y.real; 00123 offset += sizeof(this->y); 00124 union { 00125 float real; 00126 uint32_t base; 00127 } u_w; 00128 u_w.base = 0; 00129 u_w.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00130 u_w.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00131 u_w.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00132 u_w.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00133 this->w = u_w.real; 00134 offset += sizeof(this->w); 00135 union { 00136 float real; 00137 uint32_t base; 00138 } u_h; 00139 u_h.base = 0; 00140 u_h.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); 00141 u_h.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00142 u_h.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00143 u_h.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00144 this->h = u_h.real; 00145 offset += sizeof(this->h); 00146 return offset; 00147 } 00148 00149 virtual const char * getType(){ return "jsk_gui_msgs/TouchEvent"; }; 00150 virtual const char * getMD5(){ return "f074642ed1ad51ea5afc186cab8aaca1"; }; 00151 00152 }; 00153 00154 } 00155 #endif
Generated on Mon Sep 26 2022 13:47:04 by
