Package master_discovery_fkie :: Package srv :: Module _GetSyncInfo
[frames] | no frames]

Source Code for Module master_discovery_fkie.srv._GetSyncInfo

  1  """autogenerated by genpy from master_discovery_fkie/GetSyncInfoRequest.msg. Do not edit.""" 
  2  import sys 
  3  python3 = True if sys.hexversion > 0x03000000 else False 
  4  import genpy 
  5  import struct 
  6   
  7   
8 -class GetSyncInfoRequest(genpy.Message):
9 _md5sum = "d41d8cd98f00b204e9800998ecf8427e" 10 _type = "master_discovery_fkie/GetSyncInfoRequest" 11 _has_header = False #flag to mark the presence of a Header object 12 _full_text = """ 13 """ 14 __slots__ = [] 15 _slot_types = [] 16
17 - def __init__(self, *args, **kwds):
18 """ 19 Constructor. Any message fields that are implicitly/explicitly 20 set to None will be assigned a default value. The recommend 21 use is keyword arguments as this is more robust to future message 22 changes. You cannot mix in-order arguments and keyword arguments. 23 24 The available fields are: 25 26 27 :param args: complete set of field values, in .msg order 28 :param kwds: use keyword arguments corresponding to message field names 29 to set specific fields. 30 """ 31 if args or kwds: 32 super(GetSyncInfoRequest, self).__init__(*args, **kwds)
33
34 - def _get_types(self):
35 """ 36 internal API method 37 """ 38 return self._slot_types
39
40 - def serialize(self, buff):
41 """ 42 serialize message into buffer 43 :param buff: buffer, ``StringIO`` 44 """ 45 try: 46 pass 47 except struct.error as se: self._check_types(se) 48 except TypeError as te: self._check_types(te)
49
50 - def deserialize(self, str):
51 """ 52 unpack serialized message in str into this message instance 53 :param str: byte array of serialized message, ``str`` 54 """ 55 try: 56 end = 0 57 return self 58 except struct.error as e: 59 raise genpy.DeserializationError(e) #most likely buffer underfill
60 61
62 - def serialize_numpy(self, buff, numpy):
63 """ 64 serialize message with numpy array types into buffer 65 :param buff: buffer, ``StringIO`` 66 :param numpy: numpy python module 67 """ 68 try: 69 pass 70 except struct.error as se: self._check_types(se) 71 except TypeError as te: self._check_types(te)
72
73 - def deserialize_numpy(self, str, numpy):
74 """ 75 unpack serialized message in str into this message instance using numpy for array types 76 :param str: byte array of serialized message, ``str`` 77 :param numpy: numpy python module 78 """ 79 try: 80 end = 0 81 return self 82 except struct.error as e: 83 raise genpy.DeserializationError(e) #most likely buffer underfill
84 85 _struct_I = genpy.struct_I 86 """autogenerated by genpy from master_discovery_fkie/GetSyncInfoResponse.msg. Do not edit.""" 87 import sys 88 python3 = True if sys.hexversion > 0x03000000 else False 89 import genpy 90 import struct 91 92 import master_discovery_fkie.msg 93
94 -class GetSyncInfoResponse(genpy.Message):
95 _md5sum = "6116194ee5605e36f52a9f8c706812d9" 96 _type = "master_discovery_fkie/GetSyncInfoResponse" 97 _has_header = False #flag to mark the presence of a Header object 98 _full_text = """master_discovery_fkie/SyncMasterInfo[] hosts 99 100 ================================================================================ 101 MSG: master_discovery_fkie/SyncMasterInfo 102 string masteruri 103 string[] nodes 104 master_discovery_fkie/SyncTopicInfo[] publisher 105 master_discovery_fkie/SyncTopicInfo[] subscriber 106 string[] services 107 ================================================================================ 108 MSG: master_discovery_fkie/SyncTopicInfo 109 string topic 110 string node 111 string nodeuri 112 """ 113 __slots__ = ['hosts'] 114 _slot_types = ['master_discovery_fkie/SyncMasterInfo[]'] 115
116 - def __init__(self, *args, **kwds):
117 """ 118 Constructor. Any message fields that are implicitly/explicitly 119 set to None will be assigned a default value. The recommend 120 use is keyword arguments as this is more robust to future message 121 changes. You cannot mix in-order arguments and keyword arguments. 122 123 The available fields are: 124 hosts 125 126 :param args: complete set of field values, in .msg order 127 :param kwds: use keyword arguments corresponding to message field names 128 to set specific fields. 129 """ 130 if args or kwds: 131 super(GetSyncInfoResponse, self).__init__(*args, **kwds) 132 #message fields cannot be None, assign default values for those that are 133 if self.hosts is None: 134 self.hosts = [] 135 else: 136 self.hosts = []
137
138 - def _get_types(self):
139 """ 140 internal API method 141 """ 142 return self._slot_types
143
144 - def serialize(self, buff):
145 """ 146 serialize message into buffer 147 :param buff: buffer, ``StringIO`` 148 """ 149 try: 150 length = len(self.hosts) 151 buff.write(_struct_I.pack(length)) 152 for val1 in self.hosts: 153 _x = val1.masteruri 154 length = len(_x) 155 if python3 or type(_x) == unicode: 156 _x = _x.encode('utf-8') 157 length = len(_x) 158 buff.write(struct.pack('<I%ss'%length, length, _x)) 159 length = len(val1.nodes) 160 buff.write(_struct_I.pack(length)) 161 for val2 in val1.nodes: 162 length = len(val2) 163 if python3 or type(val2) == unicode: 164 val2 = val2.encode('utf-8') 165 length = len(val2) 166 buff.write(struct.pack('<I%ss'%length, length, val2)) 167 length = len(val1.publisher) 168 buff.write(_struct_I.pack(length)) 169 for val2 in val1.publisher: 170 _x = val2.topic 171 length = len(_x) 172 if python3 or type(_x) == unicode: 173 _x = _x.encode('utf-8') 174 length = len(_x) 175 buff.write(struct.pack('<I%ss'%length, length, _x)) 176 _x = val2.node 177 length = len(_x) 178 if python3 or type(_x) == unicode: 179 _x = _x.encode('utf-8') 180 length = len(_x) 181 buff.write(struct.pack('<I%ss'%length, length, _x)) 182 _x = val2.nodeuri 183 length = len(_x) 184 if python3 or type(_x) == unicode: 185 _x = _x.encode('utf-8') 186 length = len(_x) 187 buff.write(struct.pack('<I%ss'%length, length, _x)) 188 length = len(val1.subscriber) 189 buff.write(_struct_I.pack(length)) 190 for val2 in val1.subscriber: 191 _x = val2.topic 192 length = len(_x) 193 if python3 or type(_x) == unicode: 194 _x = _x.encode('utf-8') 195 length = len(_x) 196 buff.write(struct.pack('<I%ss'%length, length, _x)) 197 _x = val2.node 198 length = len(_x) 199 if python3 or type(_x) == unicode: 200 _x = _x.encode('utf-8') 201 length = len(_x) 202 buff.write(struct.pack('<I%ss'%length, length, _x)) 203 _x = val2.nodeuri 204 length = len(_x) 205 if python3 or type(_x) == unicode: 206 _x = _x.encode('utf-8') 207 length = len(_x) 208 buff.write(struct.pack('<I%ss'%length, length, _x)) 209 length = len(val1.services) 210 buff.write(_struct_I.pack(length)) 211 for val2 in val1.services: 212 length = len(val2) 213 if python3 or type(val2) == unicode: 214 val2 = val2.encode('utf-8') 215 length = len(val2) 216 buff.write(struct.pack('<I%ss'%length, length, val2)) 217 except struct.error as se: self._check_types(se) 218 except TypeError as te: self._check_types(te)
219
220 - def deserialize(self, str):
221 """ 222 unpack serialized message in str into this message instance 223 :param str: byte array of serialized message, ``str`` 224 """ 225 try: 226 if self.hosts is None: 227 self.hosts = None 228 end = 0 229 start = end 230 end += 4 231 (length,) = _struct_I.unpack(str[start:end]) 232 self.hosts = [] 233 for i in range(0, length): 234 val1 = master_discovery_fkie.msg.SyncMasterInfo() 235 start = end 236 end += 4 237 (length,) = _struct_I.unpack(str[start:end]) 238 start = end 239 end += length 240 if python3: 241 val1.masteruri = str[start:end].decode('utf-8') 242 else: 243 val1.masteruri = str[start:end] 244 start = end 245 end += 4 246 (length,) = _struct_I.unpack(str[start:end]) 247 val1.nodes = [] 248 for i in range(0, length): 249 start = end 250 end += 4 251 (length,) = _struct_I.unpack(str[start:end]) 252 start = end 253 end += length 254 if python3: 255 val2 = str[start:end].decode('utf-8') 256 else: 257 val2 = str[start:end] 258 val1.nodes.append(val2) 259 start = end 260 end += 4 261 (length,) = _struct_I.unpack(str[start:end]) 262 val1.publisher = [] 263 for i in range(0, length): 264 val2 = master_discovery_fkie.msg.SyncTopicInfo() 265 start = end 266 end += 4 267 (length,) = _struct_I.unpack(str[start:end]) 268 start = end 269 end += length 270 if python3: 271 val2.topic = str[start:end].decode('utf-8') 272 else: 273 val2.topic = str[start:end] 274 start = end 275 end += 4 276 (length,) = _struct_I.unpack(str[start:end]) 277 start = end 278 end += length 279 if python3: 280 val2.node = str[start:end].decode('utf-8') 281 else: 282 val2.node = str[start:end] 283 start = end 284 end += 4 285 (length,) = _struct_I.unpack(str[start:end]) 286 start = end 287 end += length 288 if python3: 289 val2.nodeuri = str[start:end].decode('utf-8') 290 else: 291 val2.nodeuri = str[start:end] 292 val1.publisher.append(val2) 293 start = end 294 end += 4 295 (length,) = _struct_I.unpack(str[start:end]) 296 val1.subscriber = [] 297 for i in range(0, length): 298 val2 = master_discovery_fkie.msg.SyncTopicInfo() 299 start = end 300 end += 4 301 (length,) = _struct_I.unpack(str[start:end]) 302 start = end 303 end += length 304 if python3: 305 val2.topic = str[start:end].decode('utf-8') 306 else: 307 val2.topic = str[start:end] 308 start = end 309 end += 4 310 (length,) = _struct_I.unpack(str[start:end]) 311 start = end 312 end += length 313 if python3: 314 val2.node = str[start:end].decode('utf-8') 315 else: 316 val2.node = str[start:end] 317 start = end 318 end += 4 319 (length,) = _struct_I.unpack(str[start:end]) 320 start = end 321 end += length 322 if python3: 323 val2.nodeuri = str[start:end].decode('utf-8') 324 else: 325 val2.nodeuri = str[start:end] 326 val1.subscriber.append(val2) 327 start = end 328 end += 4 329 (length,) = _struct_I.unpack(str[start:end]) 330 val1.services = [] 331 for i in range(0, length): 332 start = end 333 end += 4 334 (length,) = _struct_I.unpack(str[start:end]) 335 start = end 336 end += length 337 if python3: 338 val2 = str[start:end].decode('utf-8') 339 else: 340 val2 = str[start:end] 341 val1.services.append(val2) 342 self.hosts.append(val1) 343 return self 344 except struct.error as e: 345 raise genpy.DeserializationError(e) #most likely buffer underfill
346 347
348 - def serialize_numpy(self, buff, numpy):
349 """ 350 serialize message with numpy array types into buffer 351 :param buff: buffer, ``StringIO`` 352 :param numpy: numpy python module 353 """ 354 try: 355 length = len(self.hosts) 356 buff.write(_struct_I.pack(length)) 357 for val1 in self.hosts: 358 _x = val1.masteruri 359 length = len(_x) 360 if python3 or type(_x) == unicode: 361 _x = _x.encode('utf-8') 362 length = len(_x) 363 buff.write(struct.pack('<I%ss'%length, length, _x)) 364 length = len(val1.nodes) 365 buff.write(_struct_I.pack(length)) 366 for val2 in val1.nodes: 367 length = len(val2) 368 if python3 or type(val2) == unicode: 369 val2 = val2.encode('utf-8') 370 length = len(val2) 371 buff.write(struct.pack('<I%ss'%length, length, val2)) 372 length = len(val1.publisher) 373 buff.write(_struct_I.pack(length)) 374 for val2 in val1.publisher: 375 _x = val2.topic 376 length = len(_x) 377 if python3 or type(_x) == unicode: 378 _x = _x.encode('utf-8') 379 length = len(_x) 380 buff.write(struct.pack('<I%ss'%length, length, _x)) 381 _x = val2.node 382 length = len(_x) 383 if python3 or type(_x) == unicode: 384 _x = _x.encode('utf-8') 385 length = len(_x) 386 buff.write(struct.pack('<I%ss'%length, length, _x)) 387 _x = val2.nodeuri 388 length = len(_x) 389 if python3 or type(_x) == unicode: 390 _x = _x.encode('utf-8') 391 length = len(_x) 392 buff.write(struct.pack('<I%ss'%length, length, _x)) 393 length = len(val1.subscriber) 394 buff.write(_struct_I.pack(length)) 395 for val2 in val1.subscriber: 396 _x = val2.topic 397 length = len(_x) 398 if python3 or type(_x) == unicode: 399 _x = _x.encode('utf-8') 400 length = len(_x) 401 buff.write(struct.pack('<I%ss'%length, length, _x)) 402 _x = val2.node 403 length = len(_x) 404 if python3 or type(_x) == unicode: 405 _x = _x.encode('utf-8') 406 length = len(_x) 407 buff.write(struct.pack('<I%ss'%length, length, _x)) 408 _x = val2.nodeuri 409 length = len(_x) 410 if python3 or type(_x) == unicode: 411 _x = _x.encode('utf-8') 412 length = len(_x) 413 buff.write(struct.pack('<I%ss'%length, length, _x)) 414 length = len(val1.services) 415 buff.write(_struct_I.pack(length)) 416 for val2 in val1.services: 417 length = len(val2) 418 if python3 or type(val2) == unicode: 419 val2 = val2.encode('utf-8') 420 length = len(val2) 421 buff.write(struct.pack('<I%ss'%length, length, val2)) 422 except struct.error as se: self._check_types(se) 423 except TypeError as te: self._check_types(te)
424
425 - def deserialize_numpy(self, str, numpy):
426 """ 427 unpack serialized message in str into this message instance using numpy for array types 428 :param str: byte array of serialized message, ``str`` 429 :param numpy: numpy python module 430 """ 431 try: 432 if self.hosts is None: 433 self.hosts = None 434 end = 0 435 start = end 436 end += 4 437 (length,) = _struct_I.unpack(str[start:end]) 438 self.hosts = [] 439 for i in range(0, length): 440 val1 = master_discovery_fkie.msg.SyncMasterInfo() 441 start = end 442 end += 4 443 (length,) = _struct_I.unpack(str[start:end]) 444 start = end 445 end += length 446 if python3: 447 val1.masteruri = str[start:end].decode('utf-8') 448 else: 449 val1.masteruri = str[start:end] 450 start = end 451 end += 4 452 (length,) = _struct_I.unpack(str[start:end]) 453 val1.nodes = [] 454 for i in range(0, length): 455 start = end 456 end += 4 457 (length,) = _struct_I.unpack(str[start:end]) 458 start = end 459 end += length 460 if python3: 461 val2 = str[start:end].decode('utf-8') 462 else: 463 val2 = str[start:end] 464 val1.nodes.append(val2) 465 start = end 466 end += 4 467 (length,) = _struct_I.unpack(str[start:end]) 468 val1.publisher = [] 469 for i in range(0, length): 470 val2 = master_discovery_fkie.msg.SyncTopicInfo() 471 start = end 472 end += 4 473 (length,) = _struct_I.unpack(str[start:end]) 474 start = end 475 end += length 476 if python3: 477 val2.topic = str[start:end].decode('utf-8') 478 else: 479 val2.topic = str[start:end] 480 start = end 481 end += 4 482 (length,) = _struct_I.unpack(str[start:end]) 483 start = end 484 end += length 485 if python3: 486 val2.node = str[start:end].decode('utf-8') 487 else: 488 val2.node = str[start:end] 489 start = end 490 end += 4 491 (length,) = _struct_I.unpack(str[start:end]) 492 start = end 493 end += length 494 if python3: 495 val2.nodeuri = str[start:end].decode('utf-8') 496 else: 497 val2.nodeuri = str[start:end] 498 val1.publisher.append(val2) 499 start = end 500 end += 4 501 (length,) = _struct_I.unpack(str[start:end]) 502 val1.subscriber = [] 503 for i in range(0, length): 504 val2 = master_discovery_fkie.msg.SyncTopicInfo() 505 start = end 506 end += 4 507 (length,) = _struct_I.unpack(str[start:end]) 508 start = end 509 end += length 510 if python3: 511 val2.topic = str[start:end].decode('utf-8') 512 else: 513 val2.topic = str[start:end] 514 start = end 515 end += 4 516 (length,) = _struct_I.unpack(str[start:end]) 517 start = end 518 end += length 519 if python3: 520 val2.node = str[start:end].decode('utf-8') 521 else: 522 val2.node = str[start:end] 523 start = end 524 end += 4 525 (length,) = _struct_I.unpack(str[start:end]) 526 start = end 527 end += length 528 if python3: 529 val2.nodeuri = str[start:end].decode('utf-8') 530 else: 531 val2.nodeuri = str[start:end] 532 val1.subscriber.append(val2) 533 start = end 534 end += 4 535 (length,) = _struct_I.unpack(str[start:end]) 536 val1.services = [] 537 for i in range(0, length): 538 start = end 539 end += 4 540 (length,) = _struct_I.unpack(str[start:end]) 541 start = end 542 end += length 543 if python3: 544 val2 = str[start:end].decode('utf-8') 545 else: 546 val2 = str[start:end] 547 val1.services.append(val2) 548 self.hosts.append(val1) 549 return self 550 except struct.error as e: 551 raise genpy.DeserializationError(e) #most likely buffer underfill
552 553 _struct_I = genpy.struct_I
554 -class GetSyncInfo(object):
555 _type = 'master_discovery_fkie/GetSyncInfo' 556 _md5sum = '6116194ee5605e36f52a9f8c706812d9' 557 _request_class = GetSyncInfoRequest 558 _response_class = GetSyncInfoResponse
559