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.
SmachContainerInitialStatusCmd.h
00001 #ifndef _ROS_smach_msgs_SmachContainerInitialStatusCmd_h 00002 #define _ROS_smach_msgs_SmachContainerInitialStatusCmd_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace smach_msgs 00010 { 00011 00012 class SmachContainerInitialStatusCmd : public ros::Msg 00013 { 00014 public: 00015 typedef const char* _path_type; 00016 _path_type path; 00017 uint32_t initial_states_length; 00018 typedef char* _initial_states_type; 00019 _initial_states_type st_initial_states; 00020 _initial_states_type * initial_states; 00021 typedef const char* _local_data_type; 00022 _local_data_type local_data; 00023 00024 SmachContainerInitialStatusCmd(): 00025 path(""), 00026 initial_states_length(0), initial_states(NULL), 00027 local_data("") 00028 { 00029 } 00030 00031 virtual int serialize(unsigned char *outbuffer) const 00032 { 00033 int offset = 0; 00034 uint32_t length_path = strlen(this->path); 00035 varToArr(outbuffer + offset, length_path); 00036 offset += 4; 00037 memcpy(outbuffer + offset, this->path, length_path); 00038 offset += length_path; 00039 *(outbuffer + offset + 0) = (this->initial_states_length >> (8 * 0)) & 0xFF; 00040 *(outbuffer + offset + 1) = (this->initial_states_length >> (8 * 1)) & 0xFF; 00041 *(outbuffer + offset + 2) = (this->initial_states_length >> (8 * 2)) & 0xFF; 00042 *(outbuffer + offset + 3) = (this->initial_states_length >> (8 * 3)) & 0xFF; 00043 offset += sizeof(this->initial_states_length); 00044 for( uint32_t i = 0; i < initial_states_length; i++){ 00045 uint32_t length_initial_statesi = strlen(this->initial_states[i]); 00046 varToArr(outbuffer + offset, length_initial_statesi); 00047 offset += 4; 00048 memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); 00049 offset += length_initial_statesi; 00050 } 00051 uint32_t length_local_data = strlen(this->local_data); 00052 varToArr(outbuffer + offset, length_local_data); 00053 offset += 4; 00054 memcpy(outbuffer + offset, this->local_data, length_local_data); 00055 offset += length_local_data; 00056 return offset; 00057 } 00058 00059 virtual int deserialize(unsigned char *inbuffer) 00060 { 00061 int offset = 0; 00062 uint32_t length_path; 00063 arrToVar(length_path, (inbuffer + offset)); 00064 offset += 4; 00065 for(unsigned int k= offset; k< offset+length_path; ++k){ 00066 inbuffer[k-1]=inbuffer[k]; 00067 } 00068 inbuffer[offset+length_path-1]=0; 00069 this->path = (char *)(inbuffer + offset-1); 00070 offset += length_path; 00071 uint32_t initial_states_lengthT = ((uint32_t) (*(inbuffer + offset))); 00072 initial_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00073 initial_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00074 initial_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00075 offset += sizeof(this->initial_states_length); 00076 if(initial_states_lengthT > initial_states_length) 00077 this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); 00078 initial_states_length = initial_states_lengthT; 00079 for( uint32_t i = 0; i < initial_states_length; i++){ 00080 uint32_t length_st_initial_states; 00081 arrToVar(length_st_initial_states, (inbuffer + offset)); 00082 offset += 4; 00083 for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ 00084 inbuffer[k-1]=inbuffer[k]; 00085 } 00086 inbuffer[offset+length_st_initial_states-1]=0; 00087 this->st_initial_states = (char *)(inbuffer + offset-1); 00088 offset += length_st_initial_states; 00089 memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); 00090 } 00091 uint32_t length_local_data; 00092 arrToVar(length_local_data, (inbuffer + offset)); 00093 offset += 4; 00094 for(unsigned int k= offset; k< offset+length_local_data; ++k){ 00095 inbuffer[k-1]=inbuffer[k]; 00096 } 00097 inbuffer[offset+length_local_data-1]=0; 00098 this->local_data = (char *)(inbuffer + offset-1); 00099 offset += length_local_data; 00100 return offset; 00101 } 00102 00103 const char * getType(){ return "smach_msgs/SmachContainerInitialStatusCmd"; }; 00104 const char * getMD5(){ return "45f8cf31fc29b829db77f23001f788d6"; }; 00105 00106 }; 00107 00108 } 00109 #endif
Generated on Wed Jul 13 2022 23:30:18 by
