Package master_discovery_fkie :: Package msg :: Module _SyncTopicInfo
[frames] | no frames]

Source Code for Module master_discovery_fkie.msg._SyncTopicInfo

  1  """autogenerated by genpy from master_discovery_fkie/SyncTopicInfo.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 SyncTopicInfo(genpy.Message):
9 _md5sum = "1b296160d6f5a9d7f6550f6130da2ba4" 10 _type = "master_discovery_fkie/SyncTopicInfo" 11 _has_header = False #flag to mark the presence of a Header object 12 _full_text = """string topic 13 string node 14 string nodeuri 15 """ 16 __slots__ = ['topic','node','nodeuri'] 17 _slot_types = ['string','string','string'] 18
19 - def __init__(self, *args, **kwds):
20 """ 21 Constructor. Any message fields that are implicitly/explicitly 22 set to None will be assigned a default value. The recommend 23 use is keyword arguments as this is more robust to future message 24 changes. You cannot mix in-order arguments and keyword arguments. 25 26 The available fields are: 27 topic,node,nodeuri 28 29 :param args: complete set of field values, in .msg order 30 :param kwds: use keyword arguments corresponding to message field names 31 to set specific fields. 32 """ 33 if args or kwds: 34 super(SyncTopicInfo, self).__init__(*args, **kwds) 35 #message fields cannot be None, assign default values for those that are 36 if self.topic is None: 37 self.topic = '' 38 if self.node is None: 39 self.node = '' 40 if self.nodeuri is None: 41 self.nodeuri = '' 42 else: 43 self.topic = '' 44 self.node = '' 45 self.nodeuri = ''
46
47 - def _get_types(self):
48 """ 49 internal API method 50 """ 51 return self._slot_types
52
53 - def serialize(self, buff):
54 """ 55 serialize message into buffer 56 :param buff: buffer, ``StringIO`` 57 """ 58 try: 59 _x = self.topic 60 length = len(_x) 61 if python3 or type(_x) == unicode: 62 _x = _x.encode('utf-8') 63 length = len(_x) 64 buff.write(struct.pack('<I%ss'%length, length, _x)) 65 _x = self.node 66 length = len(_x) 67 if python3 or type(_x) == unicode: 68 _x = _x.encode('utf-8') 69 length = len(_x) 70 buff.write(struct.pack('<I%ss'%length, length, _x)) 71 _x = self.nodeuri 72 length = len(_x) 73 if python3 or type(_x) == unicode: 74 _x = _x.encode('utf-8') 75 length = len(_x) 76 buff.write(struct.pack('<I%ss'%length, length, _x)) 77 except struct.error as se: self._check_types(se) 78 except TypeError as te: self._check_types(te)
79
80 - def deserialize(self, str):
81 """ 82 unpack serialized message in str into this message instance 83 :param str: byte array of serialized message, ``str`` 84 """ 85 try: 86 end = 0 87 start = end 88 end += 4 89 (length,) = _struct_I.unpack(str[start:end]) 90 start = end 91 end += length 92 if python3: 93 self.topic = str[start:end].decode('utf-8') 94 else: 95 self.topic = str[start:end] 96 start = end 97 end += 4 98 (length,) = _struct_I.unpack(str[start:end]) 99 start = end 100 end += length 101 if python3: 102 self.node = str[start:end].decode('utf-8') 103 else: 104 self.node = str[start:end] 105 start = end 106 end += 4 107 (length,) = _struct_I.unpack(str[start:end]) 108 start = end 109 end += length 110 if python3: 111 self.nodeuri = str[start:end].decode('utf-8') 112 else: 113 self.nodeuri = str[start:end] 114 return self 115 except struct.error as e: 116 raise genpy.DeserializationError(e) #most likely buffer underfill
117 118
119 - def serialize_numpy(self, buff, numpy):
120 """ 121 serialize message with numpy array types into buffer 122 :param buff: buffer, ``StringIO`` 123 :param numpy: numpy python module 124 """ 125 try: 126 _x = self.topic 127 length = len(_x) 128 if python3 or type(_x) == unicode: 129 _x = _x.encode('utf-8') 130 length = len(_x) 131 buff.write(struct.pack('<I%ss'%length, length, _x)) 132 _x = self.node 133 length = len(_x) 134 if python3 or type(_x) == unicode: 135 _x = _x.encode('utf-8') 136 length = len(_x) 137 buff.write(struct.pack('<I%ss'%length, length, _x)) 138 _x = self.nodeuri 139 length = len(_x) 140 if python3 or type(_x) == unicode: 141 _x = _x.encode('utf-8') 142 length = len(_x) 143 buff.write(struct.pack('<I%ss'%length, length, _x)) 144 except struct.error as se: self._check_types(se) 145 except TypeError as te: self._check_types(te)
146
147 - def deserialize_numpy(self, str, numpy):
148 """ 149 unpack serialized message in str into this message instance using numpy for array types 150 :param str: byte array of serialized message, ``str`` 151 :param numpy: numpy python module 152 """ 153 try: 154 end = 0 155 start = end 156 end += 4 157 (length,) = _struct_I.unpack(str[start:end]) 158 start = end 159 end += length 160 if python3: 161 self.topic = str[start:end].decode('utf-8') 162 else: 163 self.topic = str[start:end] 164 start = end 165 end += 4 166 (length,) = _struct_I.unpack(str[start:end]) 167 start = end 168 end += length 169 if python3: 170 self.node = str[start:end].decode('utf-8') 171 else: 172 self.node = str[start:end] 173 start = end 174 end += 4 175 (length,) = _struct_I.unpack(str[start:end]) 176 start = end 177 end += length 178 if python3: 179 self.nodeuri = str[start:end].decode('utf-8') 180 else: 181 self.nodeuri = str[start:end] 182 return self 183 except struct.error as e: 184 raise genpy.DeserializationError(e) #most likely buffer underfill
185 186 _struct_I = genpy.struct_I 187