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


vision_srvs
Author(s): Ulrich F Klank
autogenerated on Mon Oct 6 2014 00:48:11