00001 """autogenerated by genpy from concert_msgs/LinkGraph.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 concert_msgs.msg
00008
00009 class LinkGraph(genpy.Message):
00010 _md5sum = "f8caacb00340f906505dd4be305725a4"
00011 _type = "concert_msgs/LinkGraph"
00012 _has_header = False
00013 _full_text = """# A list of 'named' nodes, e.g. linux.ros.robosem.rocon_teleop
00014
00015 LinkNode[] nodes
00016 LinkConnection[] topics
00017 LinkConnection[] actions
00018 LinkEdge[] edges
00019
00020 ================================================================================
00021 MSG: concert_msgs/LinkNode
00022 # Representation of a concert client node in the
00023 # implementation graph
00024
00025 # unique identifier
00026 string id
00027 # tuple representing the client node - platform.system.robot.app, e.g. linux.ros.turtlebot.turtle_stroll
00028 string tuple
00029
00030 ================================================================================
00031 MSG: concert_msgs/LinkConnection
00032 # Representation of a topic/action node in the
00033 # implementation graph
00034
00035 # unique identifier
00036 string id
00037 # type of the topic, e.g. std_msgs/String
00038 string type
00039
00040 ================================================================================
00041 MSG: concert_msgs/LinkEdge
00042 # Edge of the implementation graph. Client-Topic, or
00043 # Topic-Client or Client-Action or Action-Client
00044
00045 string start
00046 string finish
00047 string remap_from
00048 string remap_to
00049 """
00050 __slots__ = ['nodes','topics','actions','edges']
00051 _slot_types = ['concert_msgs/LinkNode[]','concert_msgs/LinkConnection[]','concert_msgs/LinkConnection[]','concert_msgs/LinkEdge[]']
00052
00053 def __init__(self, *args, **kwds):
00054 """
00055 Constructor. Any message fields that are implicitly/explicitly
00056 set to None will be assigned a default value. The recommend
00057 use is keyword arguments as this is more robust to future message
00058 changes. You cannot mix in-order arguments and keyword arguments.
00059
00060 The available fields are:
00061 nodes,topics,actions,edges
00062
00063 :param args: complete set of field values, in .msg order
00064 :param kwds: use keyword arguments corresponding to message field names
00065 to set specific fields.
00066 """
00067 if args or kwds:
00068 super(LinkGraph, self).__init__(*args, **kwds)
00069
00070 if self.nodes is None:
00071 self.nodes = []
00072 if self.topics is None:
00073 self.topics = []
00074 if self.actions is None:
00075 self.actions = []
00076 if self.edges is None:
00077 self.edges = []
00078 else:
00079 self.nodes = []
00080 self.topics = []
00081 self.actions = []
00082 self.edges = []
00083
00084 def _get_types(self):
00085 """
00086 internal API method
00087 """
00088 return self._slot_types
00089
00090 def serialize(self, buff):
00091 """
00092 serialize message into buffer
00093 :param buff: buffer, ``StringIO``
00094 """
00095 try:
00096 length = len(self.nodes)
00097 buff.write(_struct_I.pack(length))
00098 for val1 in self.nodes:
00099 _x = val1.id
00100 length = len(_x)
00101 if python3 or type(_x) == unicode:
00102 _x = _x.encode('utf-8')
00103 length = len(_x)
00104 buff.write(struct.pack('<I%ss'%length, length, _x))
00105 _x = val1.tuple
00106 length = len(_x)
00107 if python3 or type(_x) == unicode:
00108 _x = _x.encode('utf-8')
00109 length = len(_x)
00110 buff.write(struct.pack('<I%ss'%length, length, _x))
00111 length = len(self.topics)
00112 buff.write(_struct_I.pack(length))
00113 for val1 in self.topics:
00114 _x = val1.id
00115 length = len(_x)
00116 if python3 or type(_x) == unicode:
00117 _x = _x.encode('utf-8')
00118 length = len(_x)
00119 buff.write(struct.pack('<I%ss'%length, length, _x))
00120 _x = val1.type
00121 length = len(_x)
00122 if python3 or type(_x) == unicode:
00123 _x = _x.encode('utf-8')
00124 length = len(_x)
00125 buff.write(struct.pack('<I%ss'%length, length, _x))
00126 length = len(self.actions)
00127 buff.write(_struct_I.pack(length))
00128 for val1 in self.actions:
00129 _x = val1.id
00130 length = len(_x)
00131 if python3 or type(_x) == unicode:
00132 _x = _x.encode('utf-8')
00133 length = len(_x)
00134 buff.write(struct.pack('<I%ss'%length, length, _x))
00135 _x = val1.type
00136 length = len(_x)
00137 if python3 or type(_x) == unicode:
00138 _x = _x.encode('utf-8')
00139 length = len(_x)
00140 buff.write(struct.pack('<I%ss'%length, length, _x))
00141 length = len(self.edges)
00142 buff.write(_struct_I.pack(length))
00143 for val1 in self.edges:
00144 _x = val1.start
00145 length = len(_x)
00146 if python3 or type(_x) == unicode:
00147 _x = _x.encode('utf-8')
00148 length = len(_x)
00149 buff.write(struct.pack('<I%ss'%length, length, _x))
00150 _x = val1.finish
00151 length = len(_x)
00152 if python3 or type(_x) == unicode:
00153 _x = _x.encode('utf-8')
00154 length = len(_x)
00155 buff.write(struct.pack('<I%ss'%length, length, _x))
00156 _x = val1.remap_from
00157 length = len(_x)
00158 if python3 or type(_x) == unicode:
00159 _x = _x.encode('utf-8')
00160 length = len(_x)
00161 buff.write(struct.pack('<I%ss'%length, length, _x))
00162 _x = val1.remap_to
00163 length = len(_x)
00164 if python3 or type(_x) == unicode:
00165 _x = _x.encode('utf-8')
00166 length = len(_x)
00167 buff.write(struct.pack('<I%ss'%length, length, _x))
00168 except struct.error as se: self._check_types(se)
00169 except TypeError as te: self._check_types(te)
00170
00171 def deserialize(self, str):
00172 """
00173 unpack serialized message in str into this message instance
00174 :param str: byte array of serialized message, ``str``
00175 """
00176 try:
00177 if self.nodes is None:
00178 self.nodes = None
00179 if self.topics is None:
00180 self.topics = None
00181 if self.actions is None:
00182 self.actions = None
00183 if self.edges is None:
00184 self.edges = None
00185 end = 0
00186 start = end
00187 end += 4
00188 (length,) = _struct_I.unpack(str[start:end])
00189 self.nodes = []
00190 for i in range(0, length):
00191 val1 = concert_msgs.msg.LinkNode()
00192 start = end
00193 end += 4
00194 (length,) = _struct_I.unpack(str[start:end])
00195 start = end
00196 end += length
00197 if python3:
00198 val1.id = str[start:end].decode('utf-8')
00199 else:
00200 val1.id = str[start:end]
00201 start = end
00202 end += 4
00203 (length,) = _struct_I.unpack(str[start:end])
00204 start = end
00205 end += length
00206 if python3:
00207 val1.tuple = str[start:end].decode('utf-8')
00208 else:
00209 val1.tuple = str[start:end]
00210 self.nodes.append(val1)
00211 start = end
00212 end += 4
00213 (length,) = _struct_I.unpack(str[start:end])
00214 self.topics = []
00215 for i in range(0, length):
00216 val1 = concert_msgs.msg.LinkConnection()
00217 start = end
00218 end += 4
00219 (length,) = _struct_I.unpack(str[start:end])
00220 start = end
00221 end += length
00222 if python3:
00223 val1.id = str[start:end].decode('utf-8')
00224 else:
00225 val1.id = str[start:end]
00226 start = end
00227 end += 4
00228 (length,) = _struct_I.unpack(str[start:end])
00229 start = end
00230 end += length
00231 if python3:
00232 val1.type = str[start:end].decode('utf-8')
00233 else:
00234 val1.type = str[start:end]
00235 self.topics.append(val1)
00236 start = end
00237 end += 4
00238 (length,) = _struct_I.unpack(str[start:end])
00239 self.actions = []
00240 for i in range(0, length):
00241 val1 = concert_msgs.msg.LinkConnection()
00242 start = end
00243 end += 4
00244 (length,) = _struct_I.unpack(str[start:end])
00245 start = end
00246 end += length
00247 if python3:
00248 val1.id = str[start:end].decode('utf-8')
00249 else:
00250 val1.id = str[start:end]
00251 start = end
00252 end += 4
00253 (length,) = _struct_I.unpack(str[start:end])
00254 start = end
00255 end += length
00256 if python3:
00257 val1.type = str[start:end].decode('utf-8')
00258 else:
00259 val1.type = str[start:end]
00260 self.actions.append(val1)
00261 start = end
00262 end += 4
00263 (length,) = _struct_I.unpack(str[start:end])
00264 self.edges = []
00265 for i in range(0, length):
00266 val1 = concert_msgs.msg.LinkEdge()
00267 start = end
00268 end += 4
00269 (length,) = _struct_I.unpack(str[start:end])
00270 start = end
00271 end += length
00272 if python3:
00273 val1.start = str[start:end].decode('utf-8')
00274 else:
00275 val1.start = str[start:end]
00276 start = end
00277 end += 4
00278 (length,) = _struct_I.unpack(str[start:end])
00279 start = end
00280 end += length
00281 if python3:
00282 val1.finish = str[start:end].decode('utf-8')
00283 else:
00284 val1.finish = str[start:end]
00285 start = end
00286 end += 4
00287 (length,) = _struct_I.unpack(str[start:end])
00288 start = end
00289 end += length
00290 if python3:
00291 val1.remap_from = str[start:end].decode('utf-8')
00292 else:
00293 val1.remap_from = str[start:end]
00294 start = end
00295 end += 4
00296 (length,) = _struct_I.unpack(str[start:end])
00297 start = end
00298 end += length
00299 if python3:
00300 val1.remap_to = str[start:end].decode('utf-8')
00301 else:
00302 val1.remap_to = str[start:end]
00303 self.edges.append(val1)
00304 return self
00305 except struct.error as e:
00306 raise genpy.DeserializationError(e)
00307
00308
00309 def serialize_numpy(self, buff, numpy):
00310 """
00311 serialize message with numpy array types into buffer
00312 :param buff: buffer, ``StringIO``
00313 :param numpy: numpy python module
00314 """
00315 try:
00316 length = len(self.nodes)
00317 buff.write(_struct_I.pack(length))
00318 for val1 in self.nodes:
00319 _x = val1.id
00320 length = len(_x)
00321 if python3 or type(_x) == unicode:
00322 _x = _x.encode('utf-8')
00323 length = len(_x)
00324 buff.write(struct.pack('<I%ss'%length, length, _x))
00325 _x = val1.tuple
00326 length = len(_x)
00327 if python3 or type(_x) == unicode:
00328 _x = _x.encode('utf-8')
00329 length = len(_x)
00330 buff.write(struct.pack('<I%ss'%length, length, _x))
00331 length = len(self.topics)
00332 buff.write(_struct_I.pack(length))
00333 for val1 in self.topics:
00334 _x = val1.id
00335 length = len(_x)
00336 if python3 or type(_x) == unicode:
00337 _x = _x.encode('utf-8')
00338 length = len(_x)
00339 buff.write(struct.pack('<I%ss'%length, length, _x))
00340 _x = val1.type
00341 length = len(_x)
00342 if python3 or type(_x) == unicode:
00343 _x = _x.encode('utf-8')
00344 length = len(_x)
00345 buff.write(struct.pack('<I%ss'%length, length, _x))
00346 length = len(self.actions)
00347 buff.write(_struct_I.pack(length))
00348 for val1 in self.actions:
00349 _x = val1.id
00350 length = len(_x)
00351 if python3 or type(_x) == unicode:
00352 _x = _x.encode('utf-8')
00353 length = len(_x)
00354 buff.write(struct.pack('<I%ss'%length, length, _x))
00355 _x = val1.type
00356 length = len(_x)
00357 if python3 or type(_x) == unicode:
00358 _x = _x.encode('utf-8')
00359 length = len(_x)
00360 buff.write(struct.pack('<I%ss'%length, length, _x))
00361 length = len(self.edges)
00362 buff.write(_struct_I.pack(length))
00363 for val1 in self.edges:
00364 _x = val1.start
00365 length = len(_x)
00366 if python3 or type(_x) == unicode:
00367 _x = _x.encode('utf-8')
00368 length = len(_x)
00369 buff.write(struct.pack('<I%ss'%length, length, _x))
00370 _x = val1.finish
00371 length = len(_x)
00372 if python3 or type(_x) == unicode:
00373 _x = _x.encode('utf-8')
00374 length = len(_x)
00375 buff.write(struct.pack('<I%ss'%length, length, _x))
00376 _x = val1.remap_from
00377 length = len(_x)
00378 if python3 or type(_x) == unicode:
00379 _x = _x.encode('utf-8')
00380 length = len(_x)
00381 buff.write(struct.pack('<I%ss'%length, length, _x))
00382 _x = val1.remap_to
00383 length = len(_x)
00384 if python3 or type(_x) == unicode:
00385 _x = _x.encode('utf-8')
00386 length = len(_x)
00387 buff.write(struct.pack('<I%ss'%length, length, _x))
00388 except struct.error as se: self._check_types(se)
00389 except TypeError as te: self._check_types(te)
00390
00391 def deserialize_numpy(self, str, numpy):
00392 """
00393 unpack serialized message in str into this message instance using numpy for array types
00394 :param str: byte array of serialized message, ``str``
00395 :param numpy: numpy python module
00396 """
00397 try:
00398 if self.nodes is None:
00399 self.nodes = None
00400 if self.topics is None:
00401 self.topics = None
00402 if self.actions is None:
00403 self.actions = None
00404 if self.edges is None:
00405 self.edges = None
00406 end = 0
00407 start = end
00408 end += 4
00409 (length,) = _struct_I.unpack(str[start:end])
00410 self.nodes = []
00411 for i in range(0, length):
00412 val1 = concert_msgs.msg.LinkNode()
00413 start = end
00414 end += 4
00415 (length,) = _struct_I.unpack(str[start:end])
00416 start = end
00417 end += length
00418 if python3:
00419 val1.id = str[start:end].decode('utf-8')
00420 else:
00421 val1.id = str[start:end]
00422 start = end
00423 end += 4
00424 (length,) = _struct_I.unpack(str[start:end])
00425 start = end
00426 end += length
00427 if python3:
00428 val1.tuple = str[start:end].decode('utf-8')
00429 else:
00430 val1.tuple = str[start:end]
00431 self.nodes.append(val1)
00432 start = end
00433 end += 4
00434 (length,) = _struct_I.unpack(str[start:end])
00435 self.topics = []
00436 for i in range(0, length):
00437 val1 = concert_msgs.msg.LinkConnection()
00438 start = end
00439 end += 4
00440 (length,) = _struct_I.unpack(str[start:end])
00441 start = end
00442 end += length
00443 if python3:
00444 val1.id = str[start:end].decode('utf-8')
00445 else:
00446 val1.id = str[start:end]
00447 start = end
00448 end += 4
00449 (length,) = _struct_I.unpack(str[start:end])
00450 start = end
00451 end += length
00452 if python3:
00453 val1.type = str[start:end].decode('utf-8')
00454 else:
00455 val1.type = str[start:end]
00456 self.topics.append(val1)
00457 start = end
00458 end += 4
00459 (length,) = _struct_I.unpack(str[start:end])
00460 self.actions = []
00461 for i in range(0, length):
00462 val1 = concert_msgs.msg.LinkConnection()
00463 start = end
00464 end += 4
00465 (length,) = _struct_I.unpack(str[start:end])
00466 start = end
00467 end += length
00468 if python3:
00469 val1.id = str[start:end].decode('utf-8')
00470 else:
00471 val1.id = str[start:end]
00472 start = end
00473 end += 4
00474 (length,) = _struct_I.unpack(str[start:end])
00475 start = end
00476 end += length
00477 if python3:
00478 val1.type = str[start:end].decode('utf-8')
00479 else:
00480 val1.type = str[start:end]
00481 self.actions.append(val1)
00482 start = end
00483 end += 4
00484 (length,) = _struct_I.unpack(str[start:end])
00485 self.edges = []
00486 for i in range(0, length):
00487 val1 = concert_msgs.msg.LinkEdge()
00488 start = end
00489 end += 4
00490 (length,) = _struct_I.unpack(str[start:end])
00491 start = end
00492 end += length
00493 if python3:
00494 val1.start = str[start:end].decode('utf-8')
00495 else:
00496 val1.start = str[start:end]
00497 start = end
00498 end += 4
00499 (length,) = _struct_I.unpack(str[start:end])
00500 start = end
00501 end += length
00502 if python3:
00503 val1.finish = str[start:end].decode('utf-8')
00504 else:
00505 val1.finish = str[start:end]
00506 start = end
00507 end += 4
00508 (length,) = _struct_I.unpack(str[start:end])
00509 start = end
00510 end += length
00511 if python3:
00512 val1.remap_from = str[start:end].decode('utf-8')
00513 else:
00514 val1.remap_from = str[start:end]
00515 start = end
00516 end += 4
00517 (length,) = _struct_I.unpack(str[start:end])
00518 start = end
00519 end += length
00520 if python3:
00521 val1.remap_to = str[start:end].decode('utf-8')
00522 else:
00523 val1.remap_to = str[start:end]
00524 self.edges.append(val1)
00525 return self
00526 except struct.error as e:
00527 raise genpy.DeserializationError(e)
00528
00529 _struct_I = genpy.struct_I