00001 #ifndef _ROS_smach_msgs_SmachContainerStructure_h 00002 #define _ROS_smach_msgs_SmachContainerStructure_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 #include "std_msgs/Header.h" 00009 00010 namespace smach_msgs 00011 { 00012 00013 class SmachContainerStructure : public ros::Msg 00014 { 00015 public: 00016 std_msgs::Header header; 00017 const char* path; 00018 uint8_t children_length; 00019 char* st_children; 00020 char* * children; 00021 uint8_t internal_outcomes_length; 00022 char* st_internal_outcomes; 00023 char* * internal_outcomes; 00024 uint8_t outcomes_from_length; 00025 char* st_outcomes_from; 00026 char* * outcomes_from; 00027 uint8_t outcomes_to_length; 00028 char* st_outcomes_to; 00029 char* * outcomes_to; 00030 uint8_t container_outcomes_length; 00031 char* st_container_outcomes; 00032 char* * container_outcomes; 00033 00034 virtual int serialize(unsigned char *outbuffer) const 00035 { 00036 int offset = 0; 00037 offset += this->header.serialize(outbuffer + offset); 00038 uint32_t length_path = strlen(this->path); 00039 memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); 00040 offset += 4; 00041 memcpy(outbuffer + offset, this->path, length_path); 00042 offset += length_path; 00043 *(outbuffer + offset++) = children_length; 00044 *(outbuffer + offset++) = 0; 00045 *(outbuffer + offset++) = 0; 00046 *(outbuffer + offset++) = 0; 00047 for( uint8_t i = 0; i < children_length; i++){ 00048 uint32_t length_childreni = strlen(this->children[i]); 00049 memcpy(outbuffer + offset, &length_childreni, sizeof(uint32_t)); 00050 offset += 4; 00051 memcpy(outbuffer + offset, this->children[i], length_childreni); 00052 offset += length_childreni; 00053 } 00054 *(outbuffer + offset++) = internal_outcomes_length; 00055 *(outbuffer + offset++) = 0; 00056 *(outbuffer + offset++) = 0; 00057 *(outbuffer + offset++) = 0; 00058 for( uint8_t i = 0; i < internal_outcomes_length; i++){ 00059 uint32_t length_internal_outcomesi = strlen(this->internal_outcomes[i]); 00060 memcpy(outbuffer + offset, &length_internal_outcomesi, sizeof(uint32_t)); 00061 offset += 4; 00062 memcpy(outbuffer + offset, this->internal_outcomes[i], length_internal_outcomesi); 00063 offset += length_internal_outcomesi; 00064 } 00065 *(outbuffer + offset++) = outcomes_from_length; 00066 *(outbuffer + offset++) = 0; 00067 *(outbuffer + offset++) = 0; 00068 *(outbuffer + offset++) = 0; 00069 for( uint8_t i = 0; i < outcomes_from_length; i++){ 00070 uint32_t length_outcomes_fromi = strlen(this->outcomes_from[i]); 00071 memcpy(outbuffer + offset, &length_outcomes_fromi, sizeof(uint32_t)); 00072 offset += 4; 00073 memcpy(outbuffer + offset, this->outcomes_from[i], length_outcomes_fromi); 00074 offset += length_outcomes_fromi; 00075 } 00076 *(outbuffer + offset++) = outcomes_to_length; 00077 *(outbuffer + offset++) = 0; 00078 *(outbuffer + offset++) = 0; 00079 *(outbuffer + offset++) = 0; 00080 for( uint8_t i = 0; i < outcomes_to_length; i++){ 00081 uint32_t length_outcomes_toi = strlen(this->outcomes_to[i]); 00082 memcpy(outbuffer + offset, &length_outcomes_toi, sizeof(uint32_t)); 00083 offset += 4; 00084 memcpy(outbuffer + offset, this->outcomes_to[i], length_outcomes_toi); 00085 offset += length_outcomes_toi; 00086 } 00087 *(outbuffer + offset++) = container_outcomes_length; 00088 *(outbuffer + offset++) = 0; 00089 *(outbuffer + offset++) = 0; 00090 *(outbuffer + offset++) = 0; 00091 for( uint8_t i = 0; i < container_outcomes_length; i++){ 00092 uint32_t length_container_outcomesi = strlen(this->container_outcomes[i]); 00093 memcpy(outbuffer + offset, &length_container_outcomesi, sizeof(uint32_t)); 00094 offset += 4; 00095 memcpy(outbuffer + offset, this->container_outcomes[i], length_container_outcomesi); 00096 offset += length_container_outcomesi; 00097 } 00098 return offset; 00099 } 00100 00101 virtual int deserialize(unsigned char *inbuffer) 00102 { 00103 int offset = 0; 00104 offset += this->header.deserialize(inbuffer + offset); 00105 uint32_t length_path; 00106 memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); 00107 offset += 4; 00108 for(unsigned int k= offset; k< offset+length_path; ++k){ 00109 inbuffer[k-1]=inbuffer[k]; 00110 } 00111 inbuffer[offset+length_path-1]=0; 00112 this->path = (char *)(inbuffer + offset-1); 00113 offset += length_path; 00114 uint8_t children_lengthT = *(inbuffer + offset++); 00115 if(children_lengthT > children_length) 00116 this->children = (char**)realloc(this->children, children_lengthT * sizeof(char*)); 00117 offset += 3; 00118 children_length = children_lengthT; 00119 for( uint8_t i = 0; i < children_length; i++){ 00120 uint32_t length_st_children; 00121 memcpy(&length_st_children, (inbuffer + offset), sizeof(uint32_t)); 00122 offset += 4; 00123 for(unsigned int k= offset; k< offset+length_st_children; ++k){ 00124 inbuffer[k-1]=inbuffer[k]; 00125 } 00126 inbuffer[offset+length_st_children-1]=0; 00127 this->st_children = (char *)(inbuffer + offset-1); 00128 offset += length_st_children; 00129 memcpy( &(this->children[i]), &(this->st_children), sizeof(char*)); 00130 } 00131 uint8_t internal_outcomes_lengthT = *(inbuffer + offset++); 00132 if(internal_outcomes_lengthT > internal_outcomes_length) 00133 this->internal_outcomes = (char**)realloc(this->internal_outcomes, internal_outcomes_lengthT * sizeof(char*)); 00134 offset += 3; 00135 internal_outcomes_length = internal_outcomes_lengthT; 00136 for( uint8_t i = 0; i < internal_outcomes_length; i++){ 00137 uint32_t length_st_internal_outcomes; 00138 memcpy(&length_st_internal_outcomes, (inbuffer + offset), sizeof(uint32_t)); 00139 offset += 4; 00140 for(unsigned int k= offset; k< offset+length_st_internal_outcomes; ++k){ 00141 inbuffer[k-1]=inbuffer[k]; 00142 } 00143 inbuffer[offset+length_st_internal_outcomes-1]=0; 00144 this->st_internal_outcomes = (char *)(inbuffer + offset-1); 00145 offset += length_st_internal_outcomes; 00146 memcpy( &(this->internal_outcomes[i]), &(this->st_internal_outcomes), sizeof(char*)); 00147 } 00148 uint8_t outcomes_from_lengthT = *(inbuffer + offset++); 00149 if(outcomes_from_lengthT > outcomes_from_length) 00150 this->outcomes_from = (char**)realloc(this->outcomes_from, outcomes_from_lengthT * sizeof(char*)); 00151 offset += 3; 00152 outcomes_from_length = outcomes_from_lengthT; 00153 for( uint8_t i = 0; i < outcomes_from_length; i++){ 00154 uint32_t length_st_outcomes_from; 00155 memcpy(&length_st_outcomes_from, (inbuffer + offset), sizeof(uint32_t)); 00156 offset += 4; 00157 for(unsigned int k= offset; k< offset+length_st_outcomes_from; ++k){ 00158 inbuffer[k-1]=inbuffer[k]; 00159 } 00160 inbuffer[offset+length_st_outcomes_from-1]=0; 00161 this->st_outcomes_from = (char *)(inbuffer + offset-1); 00162 offset += length_st_outcomes_from; 00163 memcpy( &(this->outcomes_from[i]), &(this->st_outcomes_from), sizeof(char*)); 00164 } 00165 uint8_t outcomes_to_lengthT = *(inbuffer + offset++); 00166 if(outcomes_to_lengthT > outcomes_to_length) 00167 this->outcomes_to = (char**)realloc(this->outcomes_to, outcomes_to_lengthT * sizeof(char*)); 00168 offset += 3; 00169 outcomes_to_length = outcomes_to_lengthT; 00170 for( uint8_t i = 0; i < outcomes_to_length; i++){ 00171 uint32_t length_st_outcomes_to; 00172 memcpy(&length_st_outcomes_to, (inbuffer + offset), sizeof(uint32_t)); 00173 offset += 4; 00174 for(unsigned int k= offset; k< offset+length_st_outcomes_to; ++k){ 00175 inbuffer[k-1]=inbuffer[k]; 00176 } 00177 inbuffer[offset+length_st_outcomes_to-1]=0; 00178 this->st_outcomes_to = (char *)(inbuffer + offset-1); 00179 offset += length_st_outcomes_to; 00180 memcpy( &(this->outcomes_to[i]), &(this->st_outcomes_to), sizeof(char*)); 00181 } 00182 uint8_t container_outcomes_lengthT = *(inbuffer + offset++); 00183 if(container_outcomes_lengthT > container_outcomes_length) 00184 this->container_outcomes = (char**)realloc(this->container_outcomes, container_outcomes_lengthT * sizeof(char*)); 00185 offset += 3; 00186 container_outcomes_length = container_outcomes_lengthT; 00187 for( uint8_t i = 0; i < container_outcomes_length; i++){ 00188 uint32_t length_st_container_outcomes; 00189 memcpy(&length_st_container_outcomes, (inbuffer + offset), sizeof(uint32_t)); 00190 offset += 4; 00191 for(unsigned int k= offset; k< offset+length_st_container_outcomes; ++k){ 00192 inbuffer[k-1]=inbuffer[k]; 00193 } 00194 inbuffer[offset+length_st_container_outcomes-1]=0; 00195 this->st_container_outcomes = (char *)(inbuffer + offset-1); 00196 offset += length_st_container_outcomes; 00197 memcpy( &(this->container_outcomes[i]), &(this->st_container_outcomes), sizeof(char*)); 00198 } 00199 return offset; 00200 } 00201 00202 const char * getType(){ return "smach_msgs/SmachContainerStructure"; }; 00203 const char * getMD5(){ return "3d3d1e0d0f99779ee9e58101a5dcf7ea"; }; 00204 00205 }; 00206 00207 } 00208 #endif