_sequenceResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tibi_dabo_msgs/sequenceResult.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 sequenceResult(genpy.Message):
00009   _md5sum = "5166c3db2c743179afd29dd6caf59d72"
00010   _type = "tibi_dabo_msgs/sequenceResult"
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 bool[]    successful
00015 string[]  observations
00016 
00017 """
00018   __slots__ = ['successful','observations']
00019   _slot_types = ['bool[]','string[]']
00020 
00021   def __init__(self, *args, **kwds):
00022     """
00023     Constructor. Any message fields that are implicitly/explicitly
00024     set to None will be assigned a default value. The recommend
00025     use is keyword arguments as this is more robust to future message
00026     changes.  You cannot mix in-order arguments and keyword arguments.
00027 
00028     The available fields are:
00029        successful,observations
00030 
00031     :param args: complete set of field values, in .msg order
00032     :param kwds: use keyword arguments corresponding to message field names
00033     to set specific fields.
00034     """
00035     if args or kwds:
00036       super(sequenceResult, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.successful is None:
00039         self.successful = []
00040       if self.observations is None:
00041         self.observations = []
00042     else:
00043       self.successful = []
00044       self.observations = []
00045 
00046   def _get_types(self):
00047     """
00048     internal API method
00049     """
00050     return self._slot_types
00051 
00052   def serialize(self, buff):
00053     """
00054     serialize message into buffer
00055     :param buff: buffer, ``StringIO``
00056     """
00057     try:
00058       length = len(self.successful)
00059       buff.write(_struct_I.pack(length))
00060       pattern = '<%sB'%length
00061       buff.write(struct.pack(pattern, *self.successful))
00062       length = len(self.observations)
00063       buff.write(_struct_I.pack(length))
00064       for val1 in self.observations:
00065         length = len(val1)
00066         if python3 or type(val1) == unicode:
00067           val1 = val1.encode('utf-8')
00068           length = len(val1)
00069         buff.write(struct.pack('<I%ss'%length, length, val1))
00070     except struct.error as se: self._check_types(se)
00071     except TypeError as te: self._check_types(te)
00072 
00073   def deserialize(self, str):
00074     """
00075     unpack serialized message in str into this message instance
00076     :param str: byte array of serialized message, ``str``
00077     """
00078     try:
00079       end = 0
00080       start = end
00081       end += 4
00082       (length,) = _struct_I.unpack(str[start:end])
00083       pattern = '<%sB'%length
00084       start = end
00085       end += struct.calcsize(pattern)
00086       self.successful = struct.unpack(pattern, str[start:end])
00087       self.successful = map(bool, self.successful)
00088       start = end
00089       end += 4
00090       (length,) = _struct_I.unpack(str[start:end])
00091       self.observations = []
00092       for i in range(0, length):
00093         start = end
00094         end += 4
00095         (length,) = _struct_I.unpack(str[start:end])
00096         start = end
00097         end += length
00098         if python3:
00099           val1 = str[start:end].decode('utf-8')
00100         else:
00101           val1 = str[start:end]
00102         self.observations.append(val1)
00103       return self
00104     except struct.error as e:
00105       raise genpy.DeserializationError(e) #most likely buffer underfill
00106 
00107 
00108   def serialize_numpy(self, buff, numpy):
00109     """
00110     serialize message with numpy array types into buffer
00111     :param buff: buffer, ``StringIO``
00112     :param numpy: numpy python module
00113     """
00114     try:
00115       length = len(self.successful)
00116       buff.write(_struct_I.pack(length))
00117       pattern = '<%sB'%length
00118       buff.write(self.successful.tostring())
00119       length = len(self.observations)
00120       buff.write(_struct_I.pack(length))
00121       for val1 in self.observations:
00122         length = len(val1)
00123         if python3 or type(val1) == unicode:
00124           val1 = val1.encode('utf-8')
00125           length = len(val1)
00126         buff.write(struct.pack('<I%ss'%length, length, val1))
00127     except struct.error as se: self._check_types(se)
00128     except TypeError as te: self._check_types(te)
00129 
00130   def deserialize_numpy(self, str, numpy):
00131     """
00132     unpack serialized message in str into this message instance using numpy for array types
00133     :param str: byte array of serialized message, ``str``
00134     :param numpy: numpy python module
00135     """
00136     try:
00137       end = 0
00138       start = end
00139       end += 4
00140       (length,) = _struct_I.unpack(str[start:end])
00141       pattern = '<%sB'%length
00142       start = end
00143       end += struct.calcsize(pattern)
00144       self.successful = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length)
00145       self.successful = map(bool, self.successful)
00146       start = end
00147       end += 4
00148       (length,) = _struct_I.unpack(str[start:end])
00149       self.observations = []
00150       for i in range(0, length):
00151         start = end
00152         end += 4
00153         (length,) = _struct_I.unpack(str[start:end])
00154         start = end
00155         end += length
00156         if python3:
00157           val1 = str[start:end].decode('utf-8')
00158         else:
00159           val1 = str[start:end]
00160         self.observations.append(val1)
00161       return self
00162     except struct.error as e:
00163       raise genpy.DeserializationError(e) #most likely buffer underfill
00164 
00165 _struct_I = genpy.struct_I


tibi_dabo_msgs
Author(s): Sergi Hernandez Juan
autogenerated on Fri Dec 6 2013 20:03:32