hairo
Dependencies: mbed BufferedSerial
smach_msgs/SmachContainerStructure.h@0:9e9b7db60fd5, 2016-12-31 (annotated)
- Committer:
- garyservin
- Date:
- Sat Dec 31 00:48:34 2016 +0000
- Revision:
- 0:9e9b7db60fd5
Initial commit, generated based on a clean kinetic-desktop-full
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
garyservin | 0:9e9b7db60fd5 | 1 | #ifndef _ROS_smach_msgs_SmachContainerStructure_h |
garyservin | 0:9e9b7db60fd5 | 2 | #define _ROS_smach_msgs_SmachContainerStructure_h |
garyservin | 0:9e9b7db60fd5 | 3 | |
garyservin | 0:9e9b7db60fd5 | 4 | #include <stdint.h> |
garyservin | 0:9e9b7db60fd5 | 5 | #include <string.h> |
garyservin | 0:9e9b7db60fd5 | 6 | #include <stdlib.h> |
garyservin | 0:9e9b7db60fd5 | 7 | #include "ros/msg.h" |
garyservin | 0:9e9b7db60fd5 | 8 | #include "std_msgs/Header.h" |
garyservin | 0:9e9b7db60fd5 | 9 | |
garyservin | 0:9e9b7db60fd5 | 10 | namespace smach_msgs |
garyservin | 0:9e9b7db60fd5 | 11 | { |
garyservin | 0:9e9b7db60fd5 | 12 | |
garyservin | 0:9e9b7db60fd5 | 13 | class SmachContainerStructure : public ros::Msg |
garyservin | 0:9e9b7db60fd5 | 14 | { |
garyservin | 0:9e9b7db60fd5 | 15 | public: |
garyservin | 0:9e9b7db60fd5 | 16 | typedef std_msgs::Header _header_type; |
garyservin | 0:9e9b7db60fd5 | 17 | _header_type header; |
garyservin | 0:9e9b7db60fd5 | 18 | typedef const char* _path_type; |
garyservin | 0:9e9b7db60fd5 | 19 | _path_type path; |
garyservin | 0:9e9b7db60fd5 | 20 | uint32_t children_length; |
garyservin | 0:9e9b7db60fd5 | 21 | typedef char* _children_type; |
garyservin | 0:9e9b7db60fd5 | 22 | _children_type st_children; |
garyservin | 0:9e9b7db60fd5 | 23 | _children_type * children; |
garyservin | 0:9e9b7db60fd5 | 24 | uint32_t internal_outcomes_length; |
garyservin | 0:9e9b7db60fd5 | 25 | typedef char* _internal_outcomes_type; |
garyservin | 0:9e9b7db60fd5 | 26 | _internal_outcomes_type st_internal_outcomes; |
garyservin | 0:9e9b7db60fd5 | 27 | _internal_outcomes_type * internal_outcomes; |
garyservin | 0:9e9b7db60fd5 | 28 | uint32_t outcomes_from_length; |
garyservin | 0:9e9b7db60fd5 | 29 | typedef char* _outcomes_from_type; |
garyservin | 0:9e9b7db60fd5 | 30 | _outcomes_from_type st_outcomes_from; |
garyservin | 0:9e9b7db60fd5 | 31 | _outcomes_from_type * outcomes_from; |
garyservin | 0:9e9b7db60fd5 | 32 | uint32_t outcomes_to_length; |
garyservin | 0:9e9b7db60fd5 | 33 | typedef char* _outcomes_to_type; |
garyservin | 0:9e9b7db60fd5 | 34 | _outcomes_to_type st_outcomes_to; |
garyservin | 0:9e9b7db60fd5 | 35 | _outcomes_to_type * outcomes_to; |
garyservin | 0:9e9b7db60fd5 | 36 | uint32_t container_outcomes_length; |
garyservin | 0:9e9b7db60fd5 | 37 | typedef char* _container_outcomes_type; |
garyservin | 0:9e9b7db60fd5 | 38 | _container_outcomes_type st_container_outcomes; |
garyservin | 0:9e9b7db60fd5 | 39 | _container_outcomes_type * container_outcomes; |
garyservin | 0:9e9b7db60fd5 | 40 | |
garyservin | 0:9e9b7db60fd5 | 41 | SmachContainerStructure(): |
garyservin | 0:9e9b7db60fd5 | 42 | header(), |
garyservin | 0:9e9b7db60fd5 | 43 | path(""), |
garyservin | 0:9e9b7db60fd5 | 44 | children_length(0), children(NULL), |
garyservin | 0:9e9b7db60fd5 | 45 | internal_outcomes_length(0), internal_outcomes(NULL), |
garyservin | 0:9e9b7db60fd5 | 46 | outcomes_from_length(0), outcomes_from(NULL), |
garyservin | 0:9e9b7db60fd5 | 47 | outcomes_to_length(0), outcomes_to(NULL), |
garyservin | 0:9e9b7db60fd5 | 48 | container_outcomes_length(0), container_outcomes(NULL) |
garyservin | 0:9e9b7db60fd5 | 49 | { |
garyservin | 0:9e9b7db60fd5 | 50 | } |
garyservin | 0:9e9b7db60fd5 | 51 | |
garyservin | 0:9e9b7db60fd5 | 52 | virtual int serialize(unsigned char *outbuffer) const |
garyservin | 0:9e9b7db60fd5 | 53 | { |
garyservin | 0:9e9b7db60fd5 | 54 | int offset = 0; |
garyservin | 0:9e9b7db60fd5 | 55 | offset += this->header.serialize(outbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 56 | uint32_t length_path = strlen(this->path); |
garyservin | 0:9e9b7db60fd5 | 57 | varToArr(outbuffer + offset, length_path); |
garyservin | 0:9e9b7db60fd5 | 58 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 59 | memcpy(outbuffer + offset, this->path, length_path); |
garyservin | 0:9e9b7db60fd5 | 60 | offset += length_path; |
garyservin | 0:9e9b7db60fd5 | 61 | *(outbuffer + offset + 0) = (this->children_length >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 62 | *(outbuffer + offset + 1) = (this->children_length >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 63 | *(outbuffer + offset + 2) = (this->children_length >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 64 | *(outbuffer + offset + 3) = (this->children_length >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 65 | offset += sizeof(this->children_length); |
garyservin | 0:9e9b7db60fd5 | 66 | for( uint32_t i = 0; i < children_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 67 | uint32_t length_childreni = strlen(this->children[i]); |
garyservin | 0:9e9b7db60fd5 | 68 | varToArr(outbuffer + offset, length_childreni); |
garyservin | 0:9e9b7db60fd5 | 69 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 70 | memcpy(outbuffer + offset, this->children[i], length_childreni); |
garyservin | 0:9e9b7db60fd5 | 71 | offset += length_childreni; |
garyservin | 0:9e9b7db60fd5 | 72 | } |
garyservin | 0:9e9b7db60fd5 | 73 | *(outbuffer + offset + 0) = (this->internal_outcomes_length >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 74 | *(outbuffer + offset + 1) = (this->internal_outcomes_length >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 75 | *(outbuffer + offset + 2) = (this->internal_outcomes_length >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 76 | *(outbuffer + offset + 3) = (this->internal_outcomes_length >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 77 | offset += sizeof(this->internal_outcomes_length); |
garyservin | 0:9e9b7db60fd5 | 78 | for( uint32_t i = 0; i < internal_outcomes_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 79 | uint32_t length_internal_outcomesi = strlen(this->internal_outcomes[i]); |
garyservin | 0:9e9b7db60fd5 | 80 | varToArr(outbuffer + offset, length_internal_outcomesi); |
garyservin | 0:9e9b7db60fd5 | 81 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 82 | memcpy(outbuffer + offset, this->internal_outcomes[i], length_internal_outcomesi); |
garyservin | 0:9e9b7db60fd5 | 83 | offset += length_internal_outcomesi; |
garyservin | 0:9e9b7db60fd5 | 84 | } |
garyservin | 0:9e9b7db60fd5 | 85 | *(outbuffer + offset + 0) = (this->outcomes_from_length >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 86 | *(outbuffer + offset + 1) = (this->outcomes_from_length >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 87 | *(outbuffer + offset + 2) = (this->outcomes_from_length >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 88 | *(outbuffer + offset + 3) = (this->outcomes_from_length >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 89 | offset += sizeof(this->outcomes_from_length); |
garyservin | 0:9e9b7db60fd5 | 90 | for( uint32_t i = 0; i < outcomes_from_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 91 | uint32_t length_outcomes_fromi = strlen(this->outcomes_from[i]); |
garyservin | 0:9e9b7db60fd5 | 92 | varToArr(outbuffer + offset, length_outcomes_fromi); |
garyservin | 0:9e9b7db60fd5 | 93 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 94 | memcpy(outbuffer + offset, this->outcomes_from[i], length_outcomes_fromi); |
garyservin | 0:9e9b7db60fd5 | 95 | offset += length_outcomes_fromi; |
garyservin | 0:9e9b7db60fd5 | 96 | } |
garyservin | 0:9e9b7db60fd5 | 97 | *(outbuffer + offset + 0) = (this->outcomes_to_length >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 98 | *(outbuffer + offset + 1) = (this->outcomes_to_length >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 99 | *(outbuffer + offset + 2) = (this->outcomes_to_length >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 100 | *(outbuffer + offset + 3) = (this->outcomes_to_length >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 101 | offset += sizeof(this->outcomes_to_length); |
garyservin | 0:9e9b7db60fd5 | 102 | for( uint32_t i = 0; i < outcomes_to_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 103 | uint32_t length_outcomes_toi = strlen(this->outcomes_to[i]); |
garyservin | 0:9e9b7db60fd5 | 104 | varToArr(outbuffer + offset, length_outcomes_toi); |
garyservin | 0:9e9b7db60fd5 | 105 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 106 | memcpy(outbuffer + offset, this->outcomes_to[i], length_outcomes_toi); |
garyservin | 0:9e9b7db60fd5 | 107 | offset += length_outcomes_toi; |
garyservin | 0:9e9b7db60fd5 | 108 | } |
garyservin | 0:9e9b7db60fd5 | 109 | *(outbuffer + offset + 0) = (this->container_outcomes_length >> (8 * 0)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 110 | *(outbuffer + offset + 1) = (this->container_outcomes_length >> (8 * 1)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 111 | *(outbuffer + offset + 2) = (this->container_outcomes_length >> (8 * 2)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 112 | *(outbuffer + offset + 3) = (this->container_outcomes_length >> (8 * 3)) & 0xFF; |
garyservin | 0:9e9b7db60fd5 | 113 | offset += sizeof(this->container_outcomes_length); |
garyservin | 0:9e9b7db60fd5 | 114 | for( uint32_t i = 0; i < container_outcomes_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 115 | uint32_t length_container_outcomesi = strlen(this->container_outcomes[i]); |
garyservin | 0:9e9b7db60fd5 | 116 | varToArr(outbuffer + offset, length_container_outcomesi); |
garyservin | 0:9e9b7db60fd5 | 117 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 118 | memcpy(outbuffer + offset, this->container_outcomes[i], length_container_outcomesi); |
garyservin | 0:9e9b7db60fd5 | 119 | offset += length_container_outcomesi; |
garyservin | 0:9e9b7db60fd5 | 120 | } |
garyservin | 0:9e9b7db60fd5 | 121 | return offset; |
garyservin | 0:9e9b7db60fd5 | 122 | } |
garyservin | 0:9e9b7db60fd5 | 123 | |
garyservin | 0:9e9b7db60fd5 | 124 | virtual int deserialize(unsigned char *inbuffer) |
garyservin | 0:9e9b7db60fd5 | 125 | { |
garyservin | 0:9e9b7db60fd5 | 126 | int offset = 0; |
garyservin | 0:9e9b7db60fd5 | 127 | offset += this->header.deserialize(inbuffer + offset); |
garyservin | 0:9e9b7db60fd5 | 128 | uint32_t length_path; |
garyservin | 0:9e9b7db60fd5 | 129 | arrToVar(length_path, (inbuffer + offset)); |
garyservin | 0:9e9b7db60fd5 | 130 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 131 | for(unsigned int k= offset; k< offset+length_path; ++k){ |
garyservin | 0:9e9b7db60fd5 | 132 | inbuffer[k-1]=inbuffer[k]; |
garyservin | 0:9e9b7db60fd5 | 133 | } |
garyservin | 0:9e9b7db60fd5 | 134 | inbuffer[offset+length_path-1]=0; |
garyservin | 0:9e9b7db60fd5 | 135 | this->path = (char *)(inbuffer + offset-1); |
garyservin | 0:9e9b7db60fd5 | 136 | offset += length_path; |
garyservin | 0:9e9b7db60fd5 | 137 | uint32_t children_lengthT = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 138 | children_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 139 | children_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 140 | children_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 141 | offset += sizeof(this->children_length); |
garyservin | 0:9e9b7db60fd5 | 142 | if(children_lengthT > children_length) |
garyservin | 0:9e9b7db60fd5 | 143 | this->children = (char**)realloc(this->children, children_lengthT * sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 144 | children_length = children_lengthT; |
garyservin | 0:9e9b7db60fd5 | 145 | for( uint32_t i = 0; i < children_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 146 | uint32_t length_st_children; |
garyservin | 0:9e9b7db60fd5 | 147 | arrToVar(length_st_children, (inbuffer + offset)); |
garyservin | 0:9e9b7db60fd5 | 148 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 149 | for(unsigned int k= offset; k< offset+length_st_children; ++k){ |
garyservin | 0:9e9b7db60fd5 | 150 | inbuffer[k-1]=inbuffer[k]; |
garyservin | 0:9e9b7db60fd5 | 151 | } |
garyservin | 0:9e9b7db60fd5 | 152 | inbuffer[offset+length_st_children-1]=0; |
garyservin | 0:9e9b7db60fd5 | 153 | this->st_children = (char *)(inbuffer + offset-1); |
garyservin | 0:9e9b7db60fd5 | 154 | offset += length_st_children; |
garyservin | 0:9e9b7db60fd5 | 155 | memcpy( &(this->children[i]), &(this->st_children), sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 156 | } |
garyservin | 0:9e9b7db60fd5 | 157 | uint32_t internal_outcomes_lengthT = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 158 | internal_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 159 | internal_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 160 | internal_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 161 | offset += sizeof(this->internal_outcomes_length); |
garyservin | 0:9e9b7db60fd5 | 162 | if(internal_outcomes_lengthT > internal_outcomes_length) |
garyservin | 0:9e9b7db60fd5 | 163 | this->internal_outcomes = (char**)realloc(this->internal_outcomes, internal_outcomes_lengthT * sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 164 | internal_outcomes_length = internal_outcomes_lengthT; |
garyservin | 0:9e9b7db60fd5 | 165 | for( uint32_t i = 0; i < internal_outcomes_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 166 | uint32_t length_st_internal_outcomes; |
garyservin | 0:9e9b7db60fd5 | 167 | arrToVar(length_st_internal_outcomes, (inbuffer + offset)); |
garyservin | 0:9e9b7db60fd5 | 168 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 169 | for(unsigned int k= offset; k< offset+length_st_internal_outcomes; ++k){ |
garyservin | 0:9e9b7db60fd5 | 170 | inbuffer[k-1]=inbuffer[k]; |
garyservin | 0:9e9b7db60fd5 | 171 | } |
garyservin | 0:9e9b7db60fd5 | 172 | inbuffer[offset+length_st_internal_outcomes-1]=0; |
garyservin | 0:9e9b7db60fd5 | 173 | this->st_internal_outcomes = (char *)(inbuffer + offset-1); |
garyservin | 0:9e9b7db60fd5 | 174 | offset += length_st_internal_outcomes; |
garyservin | 0:9e9b7db60fd5 | 175 | memcpy( &(this->internal_outcomes[i]), &(this->st_internal_outcomes), sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 176 | } |
garyservin | 0:9e9b7db60fd5 | 177 | uint32_t outcomes_from_lengthT = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 178 | outcomes_from_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 179 | outcomes_from_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 180 | outcomes_from_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 181 | offset += sizeof(this->outcomes_from_length); |
garyservin | 0:9e9b7db60fd5 | 182 | if(outcomes_from_lengthT > outcomes_from_length) |
garyservin | 0:9e9b7db60fd5 | 183 | this->outcomes_from = (char**)realloc(this->outcomes_from, outcomes_from_lengthT * sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 184 | outcomes_from_length = outcomes_from_lengthT; |
garyservin | 0:9e9b7db60fd5 | 185 | for( uint32_t i = 0; i < outcomes_from_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 186 | uint32_t length_st_outcomes_from; |
garyservin | 0:9e9b7db60fd5 | 187 | arrToVar(length_st_outcomes_from, (inbuffer + offset)); |
garyservin | 0:9e9b7db60fd5 | 188 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 189 | for(unsigned int k= offset; k< offset+length_st_outcomes_from; ++k){ |
garyservin | 0:9e9b7db60fd5 | 190 | inbuffer[k-1]=inbuffer[k]; |
garyservin | 0:9e9b7db60fd5 | 191 | } |
garyservin | 0:9e9b7db60fd5 | 192 | inbuffer[offset+length_st_outcomes_from-1]=0; |
garyservin | 0:9e9b7db60fd5 | 193 | this->st_outcomes_from = (char *)(inbuffer + offset-1); |
garyservin | 0:9e9b7db60fd5 | 194 | offset += length_st_outcomes_from; |
garyservin | 0:9e9b7db60fd5 | 195 | memcpy( &(this->outcomes_from[i]), &(this->st_outcomes_from), sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 196 | } |
garyservin | 0:9e9b7db60fd5 | 197 | uint32_t outcomes_to_lengthT = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 198 | outcomes_to_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 199 | outcomes_to_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 200 | outcomes_to_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 201 | offset += sizeof(this->outcomes_to_length); |
garyservin | 0:9e9b7db60fd5 | 202 | if(outcomes_to_lengthT > outcomes_to_length) |
garyservin | 0:9e9b7db60fd5 | 203 | this->outcomes_to = (char**)realloc(this->outcomes_to, outcomes_to_lengthT * sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 204 | outcomes_to_length = outcomes_to_lengthT; |
garyservin | 0:9e9b7db60fd5 | 205 | for( uint32_t i = 0; i < outcomes_to_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 206 | uint32_t length_st_outcomes_to; |
garyservin | 0:9e9b7db60fd5 | 207 | arrToVar(length_st_outcomes_to, (inbuffer + offset)); |
garyservin | 0:9e9b7db60fd5 | 208 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 209 | for(unsigned int k= offset; k< offset+length_st_outcomes_to; ++k){ |
garyservin | 0:9e9b7db60fd5 | 210 | inbuffer[k-1]=inbuffer[k]; |
garyservin | 0:9e9b7db60fd5 | 211 | } |
garyservin | 0:9e9b7db60fd5 | 212 | inbuffer[offset+length_st_outcomes_to-1]=0; |
garyservin | 0:9e9b7db60fd5 | 213 | this->st_outcomes_to = (char *)(inbuffer + offset-1); |
garyservin | 0:9e9b7db60fd5 | 214 | offset += length_st_outcomes_to; |
garyservin | 0:9e9b7db60fd5 | 215 | memcpy( &(this->outcomes_to[i]), &(this->st_outcomes_to), sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 216 | } |
garyservin | 0:9e9b7db60fd5 | 217 | uint32_t container_outcomes_lengthT = ((uint32_t) (*(inbuffer + offset))); |
garyservin | 0:9e9b7db60fd5 | 218 | container_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
garyservin | 0:9e9b7db60fd5 | 219 | container_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
garyservin | 0:9e9b7db60fd5 | 220 | container_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
garyservin | 0:9e9b7db60fd5 | 221 | offset += sizeof(this->container_outcomes_length); |
garyservin | 0:9e9b7db60fd5 | 222 | if(container_outcomes_lengthT > container_outcomes_length) |
garyservin | 0:9e9b7db60fd5 | 223 | this->container_outcomes = (char**)realloc(this->container_outcomes, container_outcomes_lengthT * sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 224 | container_outcomes_length = container_outcomes_lengthT; |
garyservin | 0:9e9b7db60fd5 | 225 | for( uint32_t i = 0; i < container_outcomes_length; i++){ |
garyservin | 0:9e9b7db60fd5 | 226 | uint32_t length_st_container_outcomes; |
garyservin | 0:9e9b7db60fd5 | 227 | arrToVar(length_st_container_outcomes, (inbuffer + offset)); |
garyservin | 0:9e9b7db60fd5 | 228 | offset += 4; |
garyservin | 0:9e9b7db60fd5 | 229 | for(unsigned int k= offset; k< offset+length_st_container_outcomes; ++k){ |
garyservin | 0:9e9b7db60fd5 | 230 | inbuffer[k-1]=inbuffer[k]; |
garyservin | 0:9e9b7db60fd5 | 231 | } |
garyservin | 0:9e9b7db60fd5 | 232 | inbuffer[offset+length_st_container_outcomes-1]=0; |
garyservin | 0:9e9b7db60fd5 | 233 | this->st_container_outcomes = (char *)(inbuffer + offset-1); |
garyservin | 0:9e9b7db60fd5 | 234 | offset += length_st_container_outcomes; |
garyservin | 0:9e9b7db60fd5 | 235 | memcpy( &(this->container_outcomes[i]), &(this->st_container_outcomes), sizeof(char*)); |
garyservin | 0:9e9b7db60fd5 | 236 | } |
garyservin | 0:9e9b7db60fd5 | 237 | return offset; |
garyservin | 0:9e9b7db60fd5 | 238 | } |
garyservin | 0:9e9b7db60fd5 | 239 | |
garyservin | 0:9e9b7db60fd5 | 240 | const char * getType(){ return "smach_msgs/SmachContainerStructure"; }; |
garyservin | 0:9e9b7db60fd5 | 241 | const char * getMD5(){ return "3d3d1e0d0f99779ee9e58101a5dcf7ea"; }; |
garyservin | 0:9e9b7db60fd5 | 242 | |
garyservin | 0:9e9b7db60fd5 | 243 | }; |
garyservin | 0:9e9b7db60fd5 | 244 | |
garyservin | 0:9e9b7db60fd5 | 245 | } |
garyservin | 0:9e9b7db60fd5 | 246 | #endif |