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


udpmulti_transport
Author(s): Cedric Pradalier
autogenerated on Sun Oct 5 2014 23:49:15