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


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