_DiagnosisRepairGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tug_ist_diagnosis_msgs/DiagnosisRepairGoal.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 DiagnosisRepairGoal(genpy.Message):
00009   _md5sum = "525aafe154e77a2f72c2b3ff7124572b"
00010   _type = "tug_ist_diagnosis_msgs/DiagnosisRepairGoal"
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 #goal definition
00014 string[] parameter
00015 
00016 """
00017   __slots__ = ['parameter']
00018   _slot_types = ['string[]']
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        parameter
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(DiagnosisRepairGoal, self).__init__(*args, **kwds)
00036       #message fields cannot be None, assign default values for those that are
00037       if self.parameter is None:
00038         self.parameter = []
00039     else:
00040       self.parameter = []
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       length = len(self.parameter)
00055       buff.write(_struct_I.pack(length))
00056       for val1 in self.parameter:
00057         length = len(val1)
00058         if python3 or type(val1) == unicode:
00059           val1 = val1.encode('utf-8')
00060           length = len(val1)
00061         buff.write(struct.pack('<I%ss'%length, length, val1))
00062     except struct.error as se: self._check_types(se)
00063     except TypeError as te: self._check_types(te)
00064 
00065   def deserialize(self, str):
00066     """
00067     unpack serialized message in str into this message instance
00068     :param str: byte array of serialized message, ``str``
00069     """
00070     try:
00071       end = 0
00072       start = end
00073       end += 4
00074       (length,) = _struct_I.unpack(str[start:end])
00075       self.parameter = []
00076       for i in range(0, length):
00077         start = end
00078         end += 4
00079         (length,) = _struct_I.unpack(str[start:end])
00080         start = end
00081         end += length
00082         if python3:
00083           val1 = str[start:end].decode('utf-8')
00084         else:
00085           val1 = str[start:end]
00086         self.parameter.append(val1)
00087       return self
00088     except struct.error as e:
00089       raise genpy.DeserializationError(e) #most likely buffer underfill
00090 
00091 
00092   def serialize_numpy(self, buff, numpy):
00093     """
00094     serialize message with numpy array types into buffer
00095     :param buff: buffer, ``StringIO``
00096     :param numpy: numpy python module
00097     """
00098     try:
00099       length = len(self.parameter)
00100       buff.write(_struct_I.pack(length))
00101       for val1 in self.parameter:
00102         length = len(val1)
00103         if python3 or type(val1) == unicode:
00104           val1 = val1.encode('utf-8')
00105           length = len(val1)
00106         buff.write(struct.pack('<I%ss'%length, length, val1))
00107     except struct.error as se: self._check_types(se)
00108     except TypeError as te: self._check_types(te)
00109 
00110   def deserialize_numpy(self, str, numpy):
00111     """
00112     unpack serialized message in str into this message instance using numpy for array types
00113     :param str: byte array of serialized message, ``str``
00114     :param numpy: numpy python module
00115     """
00116     try:
00117       end = 0
00118       start = end
00119       end += 4
00120       (length,) = _struct_I.unpack(str[start:end])
00121       self.parameter = []
00122       for i in range(0, length):
00123         start = end
00124         end += 4
00125         (length,) = _struct_I.unpack(str[start:end])
00126         start = end
00127         end += length
00128         if python3:
00129           val1 = str[start:end].decode('utf-8')
00130         else:
00131           val1 = str[start:end]
00132         self.parameter.append(val1)
00133       return self
00134     except struct.error as e:
00135       raise genpy.DeserializationError(e) #most likely buffer underfill
00136 
00137 _struct_I = genpy.struct_I


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