_DiagnosisResults.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tug_ist_diagnosis_msgs/DiagnosisResults.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 DiagnosisResults(genpy.Message):
00009   _md5sum = "c2339e27ed3da1224754f35abdc3a7fb"
00010   _type = "tug_ist_diagnosis_msgs/DiagnosisResults"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string[] good
00013 string[] bad
00014 
00015 """
00016   __slots__ = ['good','bad']
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        good,bad
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(DiagnosisResults, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.good is None:
00037         self.good = []
00038       if self.bad is None:
00039         self.bad = []
00040     else:
00041       self.good = []
00042       self.bad = []
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       length = len(self.good)
00057       buff.write(_struct_I.pack(length))
00058       for val1 in self.good:
00059         length = len(val1)
00060         if python3 or type(val1) == unicode:
00061           val1 = val1.encode('utf-8')
00062           length = len(val1)
00063         buff.write(struct.pack('<I%ss'%length, length, val1))
00064       length = len(self.bad)
00065       buff.write(_struct_I.pack(length))
00066       for val1 in self.bad:
00067         length = len(val1)
00068         if python3 or type(val1) == unicode:
00069           val1 = val1.encode('utf-8')
00070           length = len(val1)
00071         buff.write(struct.pack('<I%ss'%length, length, val1))
00072     except struct.error as se: self._check_types(se)
00073     except TypeError as te: self._check_types(te)
00074 
00075   def deserialize(self, str):
00076     """
00077     unpack serialized message in str into this message instance
00078     :param str: byte array of serialized message, ``str``
00079     """
00080     try:
00081       end = 0
00082       start = end
00083       end += 4
00084       (length,) = _struct_I.unpack(str[start:end])
00085       self.good = []
00086       for i in range(0, length):
00087         start = end
00088         end += 4
00089         (length,) = _struct_I.unpack(str[start:end])
00090         start = end
00091         end += length
00092         if python3:
00093           val1 = str[start:end].decode('utf-8')
00094         else:
00095           val1 = str[start:end]
00096         self.good.append(val1)
00097       start = end
00098       end += 4
00099       (length,) = _struct_I.unpack(str[start:end])
00100       self.bad = []
00101       for i in range(0, length):
00102         start = end
00103         end += 4
00104         (length,) = _struct_I.unpack(str[start:end])
00105         start = end
00106         end += length
00107         if python3:
00108           val1 = str[start:end].decode('utf-8')
00109         else:
00110           val1 = str[start:end]
00111         self.bad.append(val1)
00112       return self
00113     except struct.error as e:
00114       raise genpy.DeserializationError(e) #most likely buffer underfill
00115 
00116 
00117   def serialize_numpy(self, buff, numpy):
00118     """
00119     serialize message with numpy array types into buffer
00120     :param buff: buffer, ``StringIO``
00121     :param numpy: numpy python module
00122     """
00123     try:
00124       length = len(self.good)
00125       buff.write(_struct_I.pack(length))
00126       for val1 in self.good:
00127         length = len(val1)
00128         if python3 or type(val1) == unicode:
00129           val1 = val1.encode('utf-8')
00130           length = len(val1)
00131         buff.write(struct.pack('<I%ss'%length, length, val1))
00132       length = len(self.bad)
00133       buff.write(_struct_I.pack(length))
00134       for val1 in self.bad:
00135         length = len(val1)
00136         if python3 or type(val1) == unicode:
00137           val1 = val1.encode('utf-8')
00138           length = len(val1)
00139         buff.write(struct.pack('<I%ss'%length, length, val1))
00140     except struct.error as se: self._check_types(se)
00141     except TypeError as te: self._check_types(te)
00142 
00143   def deserialize_numpy(self, str, numpy):
00144     """
00145     unpack serialized message in str into this message instance using numpy for array types
00146     :param str: byte array of serialized message, ``str``
00147     :param numpy: numpy python module
00148     """
00149     try:
00150       end = 0
00151       start = end
00152       end += 4
00153       (length,) = _struct_I.unpack(str[start:end])
00154       self.good = []
00155       for i in range(0, length):
00156         start = end
00157         end += 4
00158         (length,) = _struct_I.unpack(str[start:end])
00159         start = end
00160         end += length
00161         if python3:
00162           val1 = str[start:end].decode('utf-8')
00163         else:
00164           val1 = str[start:end]
00165         self.good.append(val1)
00166       start = end
00167       end += 4
00168       (length,) = _struct_I.unpack(str[start:end])
00169       self.bad = []
00170       for i in range(0, length):
00171         start = end
00172         end += 4
00173         (length,) = _struct_I.unpack(str[start:end])
00174         start = end
00175         end += length
00176         if python3:
00177           val1 = str[start:end].decode('utf-8')
00178         else:
00179           val1 = str[start:end]
00180         self.bad.append(val1)
00181       return self
00182     except struct.error as e:
00183       raise genpy.DeserializationError(e) #most likely buffer underfill
00184 
00185 _struct_I = genpy.struct_I


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