_AppStatus.py
Go to the documentation of this file.
00001 """autogenerated by genpy from turtlebot_app_manager/AppStatus.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 AppStatus(genpy.Message):
00009   _md5sum = "4f59466d6810d5e9557e6b8ff75c9437"
00010   _type = "turtlebot_app_manager/AppStatus"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """int32 INFO=0
00013 int32 WARN=1
00014 int32 ERROR=2
00015 # Status type.  One of INFO, WARN, ERROR.
00016 int32 type
00017 # Status message.
00018 string status
00019 
00020 """
00021   # Pseudo-constants
00022   INFO = 0
00023   WARN = 1
00024   ERROR = 2
00025 
00026   __slots__ = ['type','status']
00027   _slot_types = ['int32','string']
00028 
00029   def __init__(self, *args, **kwds):
00030     """
00031     Constructor. Any message fields that are implicitly/explicitly
00032     set to None will be assigned a default value. The recommend
00033     use is keyword arguments as this is more robust to future message
00034     changes.  You cannot mix in-order arguments and keyword arguments.
00035 
00036     The available fields are:
00037        type,status
00038 
00039     :param args: complete set of field values, in .msg order
00040     :param kwds: use keyword arguments corresponding to message field names
00041     to set specific fields.
00042     """
00043     if args or kwds:
00044       super(AppStatus, self).__init__(*args, **kwds)
00045       #message fields cannot be None, assign default values for those that are
00046       if self.type is None:
00047         self.type = 0
00048       if self.status is None:
00049         self.status = ''
00050     else:
00051       self.type = 0
00052       self.status = ''
00053 
00054   def _get_types(self):
00055     """
00056     internal API method
00057     """
00058     return self._slot_types
00059 
00060   def serialize(self, buff):
00061     """
00062     serialize message into buffer
00063     :param buff: buffer, ``StringIO``
00064     """
00065     try:
00066       buff.write(_struct_i.pack(self.type))
00067       _x = self.status
00068       length = len(_x)
00069       if python3 or type(_x) == unicode:
00070         _x = _x.encode('utf-8')
00071         length = len(_x)
00072       buff.write(struct.pack('<I%ss'%length, length, _x))
00073     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00074     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00075 
00076   def deserialize(self, str):
00077     """
00078     unpack serialized message in str into this message instance
00079     :param str: byte array of serialized message, ``str``
00080     """
00081     try:
00082       end = 0
00083       start = end
00084       end += 4
00085       (self.type,) = _struct_i.unpack(str[start:end])
00086       start = end
00087       end += 4
00088       (length,) = _struct_I.unpack(str[start:end])
00089       start = end
00090       end += length
00091       if python3:
00092         self.status = str[start:end].decode('utf-8')
00093       else:
00094         self.status = str[start:end]
00095       return self
00096     except struct.error as e:
00097       raise genpy.DeserializationError(e) #most likely buffer underfill
00098 
00099 
00100   def serialize_numpy(self, buff, numpy):
00101     """
00102     serialize message with numpy array types into buffer
00103     :param buff: buffer, ``StringIO``
00104     :param numpy: numpy python module
00105     """
00106     try:
00107       buff.write(_struct_i.pack(self.type))
00108       _x = self.status
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00115     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00116 
00117   def deserialize_numpy(self, str, numpy):
00118     """
00119     unpack serialized message in str into this message instance using numpy for array types
00120     :param str: byte array of serialized message, ``str``
00121     :param numpy: numpy python module
00122     """
00123     try:
00124       end = 0
00125       start = end
00126       end += 4
00127       (self.type,) = _struct_i.unpack(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.status = str[start:end].decode('utf-8')
00135       else:
00136         self.status = str[start:end]
00137       return self
00138     except struct.error as e:
00139       raise genpy.DeserializationError(e) #most likely buffer underfill
00140 
00141 _struct_I = genpy.struct_I
00142 _struct_i = struct.Struct("<i")


turtlebot_app_manager
Author(s): Jeremy Leibs, Ken Conley
autogenerated on Mon Oct 6 2014 08:00:31