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


ml_classifiers
Author(s): Scott Niekum
autogenerated on Fri Jan 3 2014 11:30:23