_SetObject.py
Go to the documentation of this file.
00001 """autogenerated by genpy from re_srvs/SetObjectRequest.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 re_msgs.msg
00008 
00009 class SetObjectRequest(genpy.Message):
00010   _md5sum = "e63a6e13df8209b325fae5c13990b9af"
00011   _type = "re_srvs/SetObjectRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """
00014 string cls
00015 string id
00016 string description
00017 string object
00018 re_msgs/File[] files
00019 
00020 string apiKey
00021 
00022 
00023 ================================================================================
00024 MSG: re_msgs/File
00025 # This file representation is used to pass binary data to the RoboEarthDB.
00026 # As the endianess isn't stored, only files with a byte order mark (BOM) or
00027 # an implicitly specified endianess should be transferred.
00028 string name   # file name
00029 int8[] data   # binary data 
00030 
00031 """
00032   __slots__ = ['cls','id','description','object','files','apiKey']
00033   _slot_types = ['string','string','string','string','re_msgs/File[]','string']
00034 
00035   def __init__(self, *args, **kwds):
00036     """
00037     Constructor. Any message fields that are implicitly/explicitly
00038     set to None will be assigned a default value. The recommend
00039     use is keyword arguments as this is more robust to future message
00040     changes.  You cannot mix in-order arguments and keyword arguments.
00041 
00042     The available fields are:
00043        cls,id,description,object,files,apiKey
00044 
00045     :param args: complete set of field values, in .msg order
00046     :param kwds: use keyword arguments corresponding to message field names
00047     to set specific fields.
00048     """
00049     if args or kwds:
00050       super(SetObjectRequest, self).__init__(*args, **kwds)
00051       #message fields cannot be None, assign default values for those that are
00052       if self.cls is None:
00053         self.cls = ''
00054       if self.id is None:
00055         self.id = ''
00056       if self.description is None:
00057         self.description = ''
00058       if self.object is None:
00059         self.object = ''
00060       if self.files is None:
00061         self.files = []
00062       if self.apiKey is None:
00063         self.apiKey = ''
00064     else:
00065       self.cls = ''
00066       self.id = ''
00067       self.description = ''
00068       self.object = ''
00069       self.files = []
00070       self.apiKey = ''
00071 
00072   def _get_types(self):
00073     """
00074     internal API method
00075     """
00076     return self._slot_types
00077 
00078   def serialize(self, buff):
00079     """
00080     serialize message into buffer
00081     :param buff: buffer, ``StringIO``
00082     """
00083     try:
00084       _x = self.cls
00085       length = len(_x)
00086       if python3 or type(_x) == unicode:
00087         _x = _x.encode('utf-8')
00088         length = len(_x)
00089       buff.write(struct.pack('<I%ss'%length, length, _x))
00090       _x = self.id
00091       length = len(_x)
00092       if python3 or type(_x) == unicode:
00093         _x = _x.encode('utf-8')
00094         length = len(_x)
00095       buff.write(struct.pack('<I%ss'%length, length, _x))
00096       _x = self.description
00097       length = len(_x)
00098       if python3 or type(_x) == unicode:
00099         _x = _x.encode('utf-8')
00100         length = len(_x)
00101       buff.write(struct.pack('<I%ss'%length, length, _x))
00102       _x = self.object
00103       length = len(_x)
00104       if python3 or type(_x) == unicode:
00105         _x = _x.encode('utf-8')
00106         length = len(_x)
00107       buff.write(struct.pack('<I%ss'%length, length, _x))
00108       length = len(self.files)
00109       buff.write(_struct_I.pack(length))
00110       for val1 in self.files:
00111         _x = val1.name
00112         length = len(_x)
00113         if python3 or type(_x) == unicode:
00114           _x = _x.encode('utf-8')
00115           length = len(_x)
00116         buff.write(struct.pack('<I%ss'%length, length, _x))
00117         length = len(val1.data)
00118         buff.write(_struct_I.pack(length))
00119         pattern = '<%sb'%length
00120         buff.write(struct.pack(pattern, *val1.data))
00121       _x = self.apiKey
00122       length = len(_x)
00123       if python3 or type(_x) == unicode:
00124         _x = _x.encode('utf-8')
00125         length = len(_x)
00126       buff.write(struct.pack('<I%ss'%length, length, _x))
00127     except struct.error as se: self._check_types(se)
00128     except TypeError as te: self._check_types(te)
00129 
00130   def deserialize(self, str):
00131     """
00132     unpack serialized message in str into this message instance
00133     :param str: byte array of serialized message, ``str``
00134     """
00135     try:
00136       if self.files is None:
00137         self.files = None
00138       end = 0
00139       start = end
00140       end += 4
00141       (length,) = _struct_I.unpack(str[start:end])
00142       start = end
00143       end += length
00144       if python3:
00145         self.cls = str[start:end].decode('utf-8')
00146       else:
00147         self.cls = str[start:end]
00148       start = end
00149       end += 4
00150       (length,) = _struct_I.unpack(str[start:end])
00151       start = end
00152       end += length
00153       if python3:
00154         self.id = str[start:end].decode('utf-8')
00155       else:
00156         self.id = str[start:end]
00157       start = end
00158       end += 4
00159       (length,) = _struct_I.unpack(str[start:end])
00160       start = end
00161       end += length
00162       if python3:
00163         self.description = str[start:end].decode('utf-8')
00164       else:
00165         self.description = str[start:end]
00166       start = end
00167       end += 4
00168       (length,) = _struct_I.unpack(str[start:end])
00169       start = end
00170       end += length
00171       if python3:
00172         self.object = str[start:end].decode('utf-8')
00173       else:
00174         self.object = str[start:end]
00175       start = end
00176       end += 4
00177       (length,) = _struct_I.unpack(str[start:end])
00178       self.files = []
00179       for i in range(0, length):
00180         val1 = re_msgs.msg.File()
00181         start = end
00182         end += 4
00183         (length,) = _struct_I.unpack(str[start:end])
00184         start = end
00185         end += length
00186         if python3:
00187           val1.name = str[start:end].decode('utf-8')
00188         else:
00189           val1.name = str[start:end]
00190         start = end
00191         end += 4
00192         (length,) = _struct_I.unpack(str[start:end])
00193         pattern = '<%sb'%length
00194         start = end
00195         end += struct.calcsize(pattern)
00196         val1.data = struct.unpack(pattern, str[start:end])
00197         self.files.append(val1)
00198       start = end
00199       end += 4
00200       (length,) = _struct_I.unpack(str[start:end])
00201       start = end
00202       end += length
00203       if python3:
00204         self.apiKey = str[start:end].decode('utf-8')
00205       else:
00206         self.apiKey = str[start:end]
00207       return self
00208     except struct.error as e:
00209       raise genpy.DeserializationError(e) #most likely buffer underfill
00210 
00211 
00212   def serialize_numpy(self, buff, numpy):
00213     """
00214     serialize message with numpy array types into buffer
00215     :param buff: buffer, ``StringIO``
00216     :param numpy: numpy python module
00217     """
00218     try:
00219       _x = self.cls
00220       length = len(_x)
00221       if python3 or type(_x) == unicode:
00222         _x = _x.encode('utf-8')
00223         length = len(_x)
00224       buff.write(struct.pack('<I%ss'%length, length, _x))
00225       _x = self.id
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       _x = self.description
00232       length = len(_x)
00233       if python3 or type(_x) == unicode:
00234         _x = _x.encode('utf-8')
00235         length = len(_x)
00236       buff.write(struct.pack('<I%ss'%length, length, _x))
00237       _x = self.object
00238       length = len(_x)
00239       if python3 or type(_x) == unicode:
00240         _x = _x.encode('utf-8')
00241         length = len(_x)
00242       buff.write(struct.pack('<I%ss'%length, length, _x))
00243       length = len(self.files)
00244       buff.write(_struct_I.pack(length))
00245       for val1 in self.files:
00246         _x = val1.name
00247         length = len(_x)
00248         if python3 or type(_x) == unicode:
00249           _x = _x.encode('utf-8')
00250           length = len(_x)
00251         buff.write(struct.pack('<I%ss'%length, length, _x))
00252         length = len(val1.data)
00253         buff.write(_struct_I.pack(length))
00254         pattern = '<%sb'%length
00255         buff.write(val1.data.tostring())
00256       _x = self.apiKey
00257       length = len(_x)
00258       if python3 or type(_x) == unicode:
00259         _x = _x.encode('utf-8')
00260         length = len(_x)
00261       buff.write(struct.pack('<I%ss'%length, length, _x))
00262     except struct.error as se: self._check_types(se)
00263     except TypeError as te: self._check_types(te)
00264 
00265   def deserialize_numpy(self, str, numpy):
00266     """
00267     unpack serialized message in str into this message instance using numpy for array types
00268     :param str: byte array of serialized message, ``str``
00269     :param numpy: numpy python module
00270     """
00271     try:
00272       if self.files is None:
00273         self.files = None
00274       end = 0
00275       start = end
00276       end += 4
00277       (length,) = _struct_I.unpack(str[start:end])
00278       start = end
00279       end += length
00280       if python3:
00281         self.cls = str[start:end].decode('utf-8')
00282       else:
00283         self.cls = str[start:end]
00284       start = end
00285       end += 4
00286       (length,) = _struct_I.unpack(str[start:end])
00287       start = end
00288       end += length
00289       if python3:
00290         self.id = str[start:end].decode('utf-8')
00291       else:
00292         self.id = str[start:end]
00293       start = end
00294       end += 4
00295       (length,) = _struct_I.unpack(str[start:end])
00296       start = end
00297       end += length
00298       if python3:
00299         self.description = str[start:end].decode('utf-8')
00300       else:
00301         self.description = str[start:end]
00302       start = end
00303       end += 4
00304       (length,) = _struct_I.unpack(str[start:end])
00305       start = end
00306       end += length
00307       if python3:
00308         self.object = str[start:end].decode('utf-8')
00309       else:
00310         self.object = str[start:end]
00311       start = end
00312       end += 4
00313       (length,) = _struct_I.unpack(str[start:end])
00314       self.files = []
00315       for i in range(0, length):
00316         val1 = re_msgs.msg.File()
00317         start = end
00318         end += 4
00319         (length,) = _struct_I.unpack(str[start:end])
00320         start = end
00321         end += length
00322         if python3:
00323           val1.name = str[start:end].decode('utf-8')
00324         else:
00325           val1.name = str[start:end]
00326         start = end
00327         end += 4
00328         (length,) = _struct_I.unpack(str[start:end])
00329         pattern = '<%sb'%length
00330         start = end
00331         end += struct.calcsize(pattern)
00332         val1.data = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=length)
00333         self.files.append(val1)
00334       start = end
00335       end += 4
00336       (length,) = _struct_I.unpack(str[start:end])
00337       start = end
00338       end += length
00339       if python3:
00340         self.apiKey = str[start:end].decode('utf-8')
00341       else:
00342         self.apiKey = str[start:end]
00343       return self
00344     except struct.error as e:
00345       raise genpy.DeserializationError(e) #most likely buffer underfill
00346 
00347 _struct_I = genpy.struct_I
00348 """autogenerated by genpy from re_srvs/SetObjectResponse.msg. Do not edit."""
00349 import sys
00350 python3 = True if sys.hexversion > 0x03000000 else False
00351 import genpy
00352 import struct
00353 
00354 
00355 class SetObjectResponse(genpy.Message):
00356   _md5sum = "358e233cde0c8a8bcfea4ce193f8fc15"
00357   _type = "re_srvs/SetObjectResponse"
00358   _has_header = False #flag to mark the presence of a Header object
00359   _full_text = """bool success
00360 
00361 
00362 """
00363   __slots__ = ['success']
00364   _slot_types = ['bool']
00365 
00366   def __init__(self, *args, **kwds):
00367     """
00368     Constructor. Any message fields that are implicitly/explicitly
00369     set to None will be assigned a default value. The recommend
00370     use is keyword arguments as this is more robust to future message
00371     changes.  You cannot mix in-order arguments and keyword arguments.
00372 
00373     The available fields are:
00374        success
00375 
00376     :param args: complete set of field values, in .msg order
00377     :param kwds: use keyword arguments corresponding to message field names
00378     to set specific fields.
00379     """
00380     if args or kwds:
00381       super(SetObjectResponse, self).__init__(*args, **kwds)
00382       #message fields cannot be None, assign default values for those that are
00383       if self.success is None:
00384         self.success = False
00385     else:
00386       self.success = False
00387 
00388   def _get_types(self):
00389     """
00390     internal API method
00391     """
00392     return self._slot_types
00393 
00394   def serialize(self, buff):
00395     """
00396     serialize message into buffer
00397     :param buff: buffer, ``StringIO``
00398     """
00399     try:
00400       buff.write(_struct_B.pack(self.success))
00401     except struct.error as se: self._check_types(se)
00402     except TypeError as te: self._check_types(te)
00403 
00404   def deserialize(self, str):
00405     """
00406     unpack serialized message in str into this message instance
00407     :param str: byte array of serialized message, ``str``
00408     """
00409     try:
00410       end = 0
00411       start = end
00412       end += 1
00413       (self.success,) = _struct_B.unpack(str[start:end])
00414       self.success = bool(self.success)
00415       return self
00416     except struct.error as e:
00417       raise genpy.DeserializationError(e) #most likely buffer underfill
00418 
00419 
00420   def serialize_numpy(self, buff, numpy):
00421     """
00422     serialize message with numpy array types into buffer
00423     :param buff: buffer, ``StringIO``
00424     :param numpy: numpy python module
00425     """
00426     try:
00427       buff.write(_struct_B.pack(self.success))
00428     except struct.error as se: self._check_types(se)
00429     except TypeError as te: self._check_types(te)
00430 
00431   def deserialize_numpy(self, str, numpy):
00432     """
00433     unpack serialized message in str into this message instance using numpy for array types
00434     :param str: byte array of serialized message, ``str``
00435     :param numpy: numpy python module
00436     """
00437     try:
00438       end = 0
00439       start = end
00440       end += 1
00441       (self.success,) = _struct_B.unpack(str[start:end])
00442       self.success = bool(self.success)
00443       return self
00444     except struct.error as e:
00445       raise genpy.DeserializationError(e) #most likely buffer underfill
00446 
00447 _struct_I = genpy.struct_I
00448 _struct_B = struct.Struct("<B")
00449 class SetObject(object):
00450   _type          = 're_srvs/SetObject'
00451   _md5sum = '16f471943cffa7dc443763a038f5cac9'
00452   _request_class  = SetObjectRequest
00453   _response_class = SetObjectResponse


re_srvs
Author(s): Alexander Perzylo
autogenerated on Sun Jan 5 2014 11:28:42