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


rve_msgs
Author(s): Josh Faust
autogenerated on Wed Dec 11 2013 14:30:38