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


iri_publish_params
Author(s): Arnau Ramisa
autogenerated on Fri Dec 6 2013 21:13:34