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


tug_ist_diagnosis_msgs
Author(s): Safdar Zaman, Gerald Steinbauer
autogenerated on Mon Jan 6 2014 11:51:02