00001 """autogenerated by genpy from roboframenet_msgs/FilledSemanticFrameListList.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import roboframenet_msgs.msg
00008
00009 class FilledSemanticFrameListList(genpy.Message):
00010 _md5sum = "737111e9f6697d31eca2c3093b6a96ef"
00011 _type = "roboframenet_msgs/FilledSemanticFrameListList"
00012 _has_header = False
00013 _full_text = """FilledSemanticFrameList[] frame_lists
00014
00015 ================================================================================
00016 MSG: roboframenet_msgs/FilledSemanticFrameList
00017 FilledSemanticFrame[] frames
00018
00019 ================================================================================
00020 MSG: roboframenet_msgs/FilledSemanticFrame
00021 string name
00022 FilledFrameElement[] frame_elements
00023 string[] action_server_topics
00024
00025 ================================================================================
00026 MSG: roboframenet_msgs/FilledFrameElement
00027 string name # eg object, recipient
00028 string argument # eg apple, bob
00029
00030 """
00031 __slots__ = ['frame_lists']
00032 _slot_types = ['roboframenet_msgs/FilledSemanticFrameList[]']
00033
00034 def __init__(self, *args, **kwds):
00035 """
00036 Constructor. Any message fields that are implicitly/explicitly
00037 set to None will be assigned a default value. The recommend
00038 use is keyword arguments as this is more robust to future message
00039 changes. You cannot mix in-order arguments and keyword arguments.
00040
00041 The available fields are:
00042 frame_lists
00043
00044 :param args: complete set of field values, in .msg order
00045 :param kwds: use keyword arguments corresponding to message field names
00046 to set specific fields.
00047 """
00048 if args or kwds:
00049 super(FilledSemanticFrameListList, self).__init__(*args, **kwds)
00050
00051 if self.frame_lists is None:
00052 self.frame_lists = []
00053 else:
00054 self.frame_lists = []
00055
00056 def _get_types(self):
00057 """
00058 internal API method
00059 """
00060 return self._slot_types
00061
00062 def serialize(self, buff):
00063 """
00064 serialize message into buffer
00065 :param buff: buffer, ``StringIO``
00066 """
00067 try:
00068 length = len(self.frame_lists)
00069 buff.write(_struct_I.pack(length))
00070 for val1 in self.frame_lists:
00071 length = len(val1.frames)
00072 buff.write(_struct_I.pack(length))
00073 for val2 in val1.frames:
00074 _x = val2.name
00075 length = len(_x)
00076 if python3 or type(_x) == unicode:
00077 _x = _x.encode('utf-8')
00078 length = len(_x)
00079 buff.write(struct.pack('<I%ss'%length, length, _x))
00080 length = len(val2.frame_elements)
00081 buff.write(_struct_I.pack(length))
00082 for val3 in val2.frame_elements:
00083 _x = val3.name
00084 length = len(_x)
00085 if python3 or type(_x) == unicode:
00086 _x = _x.encode('utf-8')
00087 length = len(_x)
00088 buff.write(struct.pack('<I%ss'%length, length, _x))
00089 _x = val3.argument
00090 length = len(_x)
00091 if python3 or type(_x) == unicode:
00092 _x = _x.encode('utf-8')
00093 length = len(_x)
00094 buff.write(struct.pack('<I%ss'%length, length, _x))
00095 length = len(val2.action_server_topics)
00096 buff.write(_struct_I.pack(length))
00097 for val3 in val2.action_server_topics:
00098 length = len(val3)
00099 if python3 or type(val3) == unicode:
00100 val3 = val3.encode('utf-8')
00101 length = len(val3)
00102 buff.write(struct.pack('<I%ss'%length, length, val3))
00103 except struct.error as se: self._check_types(se)
00104 except TypeError as te: self._check_types(te)
00105
00106 def deserialize(self, str):
00107 """
00108 unpack serialized message in str into this message instance
00109 :param str: byte array of serialized message, ``str``
00110 """
00111 try:
00112 if self.frame_lists is None:
00113 self.frame_lists = None
00114 end = 0
00115 start = end
00116 end += 4
00117 (length,) = _struct_I.unpack(str[start:end])
00118 self.frame_lists = []
00119 for i in range(0, length):
00120 val1 = roboframenet_msgs.msg.FilledSemanticFrameList()
00121 start = end
00122 end += 4
00123 (length,) = _struct_I.unpack(str[start:end])
00124 val1.frames = []
00125 for i in range(0, length):
00126 val2 = roboframenet_msgs.msg.FilledSemanticFrame()
00127 start = end
00128 end += 4
00129 (length,) = _struct_I.unpack(str[start:end])
00130 start = end
00131 end += length
00132 if python3:
00133 val2.name = str[start:end].decode('utf-8')
00134 else:
00135 val2.name = str[start:end]
00136 start = end
00137 end += 4
00138 (length,) = _struct_I.unpack(str[start:end])
00139 val2.frame_elements = []
00140 for i in range(0, length):
00141 val3 = roboframenet_msgs.msg.FilledFrameElement()
00142 start = end
00143 end += 4
00144 (length,) = _struct_I.unpack(str[start:end])
00145 start = end
00146 end += length
00147 if python3:
00148 val3.name = str[start:end].decode('utf-8')
00149 else:
00150 val3.name = str[start:end]
00151 start = end
00152 end += 4
00153 (length,) = _struct_I.unpack(str[start:end])
00154 start = end
00155 end += length
00156 if python3:
00157 val3.argument = str[start:end].decode('utf-8')
00158 else:
00159 val3.argument = str[start:end]
00160 val2.frame_elements.append(val3)
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 val2.action_server_topics = []
00165 for i in range(0, length):
00166 start = end
00167 end += 4
00168 (length,) = _struct_I.unpack(str[start:end])
00169 start = end
00170 end += length
00171 if python3:
00172 val3 = str[start:end].decode('utf-8')
00173 else:
00174 val3 = str[start:end]
00175 val2.action_server_topics.append(val3)
00176 val1.frames.append(val2)
00177 self.frame_lists.append(val1)
00178 return self
00179 except struct.error as e:
00180 raise genpy.DeserializationError(e)
00181
00182
00183 def serialize_numpy(self, buff, numpy):
00184 """
00185 serialize message with numpy array types into buffer
00186 :param buff: buffer, ``StringIO``
00187 :param numpy: numpy python module
00188 """
00189 try:
00190 length = len(self.frame_lists)
00191 buff.write(_struct_I.pack(length))
00192 for val1 in self.frame_lists:
00193 length = len(val1.frames)
00194 buff.write(_struct_I.pack(length))
00195 for val2 in val1.frames:
00196 _x = val2.name
00197 length = len(_x)
00198 if python3 or type(_x) == unicode:
00199 _x = _x.encode('utf-8')
00200 length = len(_x)
00201 buff.write(struct.pack('<I%ss'%length, length, _x))
00202 length = len(val2.frame_elements)
00203 buff.write(_struct_I.pack(length))
00204 for val3 in val2.frame_elements:
00205 _x = val3.name
00206 length = len(_x)
00207 if python3 or type(_x) == unicode:
00208 _x = _x.encode('utf-8')
00209 length = len(_x)
00210 buff.write(struct.pack('<I%ss'%length, length, _x))
00211 _x = val3.argument
00212 length = len(_x)
00213 if python3 or type(_x) == unicode:
00214 _x = _x.encode('utf-8')
00215 length = len(_x)
00216 buff.write(struct.pack('<I%ss'%length, length, _x))
00217 length = len(val2.action_server_topics)
00218 buff.write(_struct_I.pack(length))
00219 for val3 in val2.action_server_topics:
00220 length = len(val3)
00221 if python3 or type(val3) == unicode:
00222 val3 = val3.encode('utf-8')
00223 length = len(val3)
00224 buff.write(struct.pack('<I%ss'%length, length, val3))
00225 except struct.error as se: self._check_types(se)
00226 except TypeError as te: self._check_types(te)
00227
00228 def deserialize_numpy(self, str, numpy):
00229 """
00230 unpack serialized message in str into this message instance using numpy for array types
00231 :param str: byte array of serialized message, ``str``
00232 :param numpy: numpy python module
00233 """
00234 try:
00235 if self.frame_lists is None:
00236 self.frame_lists = None
00237 end = 0
00238 start = end
00239 end += 4
00240 (length,) = _struct_I.unpack(str[start:end])
00241 self.frame_lists = []
00242 for i in range(0, length):
00243 val1 = roboframenet_msgs.msg.FilledSemanticFrameList()
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 val1.frames = []
00248 for i in range(0, length):
00249 val2 = roboframenet_msgs.msg.FilledSemanticFrame()
00250 start = end
00251 end += 4
00252 (length,) = _struct_I.unpack(str[start:end])
00253 start = end
00254 end += length
00255 if python3:
00256 val2.name = str[start:end].decode('utf-8')
00257 else:
00258 val2.name = str[start:end]
00259 start = end
00260 end += 4
00261 (length,) = _struct_I.unpack(str[start:end])
00262 val2.frame_elements = []
00263 for i in range(0, length):
00264 val3 = roboframenet_msgs.msg.FilledFrameElement()
00265 start = end
00266 end += 4
00267 (length,) = _struct_I.unpack(str[start:end])
00268 start = end
00269 end += length
00270 if python3:
00271 val3.name = str[start:end].decode('utf-8')
00272 else:
00273 val3.name = str[start:end]
00274 start = end
00275 end += 4
00276 (length,) = _struct_I.unpack(str[start:end])
00277 start = end
00278 end += length
00279 if python3:
00280 val3.argument = str[start:end].decode('utf-8')
00281 else:
00282 val3.argument = str[start:end]
00283 val2.frame_elements.append(val3)
00284 start = end
00285 end += 4
00286 (length,) = _struct_I.unpack(str[start:end])
00287 val2.action_server_topics = []
00288 for i in range(0, length):
00289 start = end
00290 end += 4
00291 (length,) = _struct_I.unpack(str[start:end])
00292 start = end
00293 end += length
00294 if python3:
00295 val3 = str[start:end].decode('utf-8')
00296 else:
00297 val3 = str[start:end]
00298 val2.action_server_topics.append(val3)
00299 val1.frames.append(val2)
00300 self.frame_lists.append(val1)
00301 return self
00302 except struct.error as e:
00303 raise genpy.DeserializationError(e)
00304
00305 _struct_I = genpy.struct_I