00001 """autogenerated by genmsg_py from AppStatus.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class AppStatus(roslib.message.Message):
00007 _md5sum = "4f59466d6810d5e9557e6b8ff75c9437"
00008 _type = "app_manager/AppStatus"
00009 _has_header = False
00010 _full_text = """int32 INFO=0
00011 int32 WARN=1
00012 int32 ERROR=2
00013 # Status type. One of INFO, WARN, ERROR.
00014 int32 type
00015 # Status message.
00016 string status
00017
00018 """
00019
00020 INFO = 0
00021 WARN = 1
00022 ERROR = 2
00023
00024 __slots__ = ['type','status']
00025 _slot_types = ['int32','string']
00026
00027 def __init__(self, *args, **kwds):
00028 """
00029 Constructor. Any message fields that are implicitly/explicitly
00030 set to None will be assigned a default value. The recommend
00031 use is keyword arguments as this is more robust to future message
00032 changes. You cannot mix in-order arguments and keyword arguments.
00033
00034 The available fields are:
00035 type,status
00036
00037 @param args: complete set of field values, in .msg order
00038 @param kwds: use keyword arguments corresponding to message field names
00039 to set specific fields.
00040 """
00041 if args or kwds:
00042 super(AppStatus, self).__init__(*args, **kwds)
00043
00044 if self.type is None:
00045 self.type = 0
00046 if self.status is None:
00047 self.status = ''
00048 else:
00049 self.type = 0
00050 self.status = ''
00051
00052 def _get_types(self):
00053 """
00054 internal API method
00055 """
00056 return self._slot_types
00057
00058 def serialize(self, buff):
00059 """
00060 serialize message into buffer
00061 @param buff: buffer
00062 @type buff: StringIO
00063 """
00064 try:
00065 buff.write(_struct_i.pack(self.type))
00066 _x = self.status
00067 length = len(_x)
00068 buff.write(struct.pack('<I%ss'%length, length, _x))
00069 except struct.error, se: self._check_types(se)
00070 except TypeError, te: self._check_types(te)
00071
00072 def deserialize(self, str):
00073 """
00074 unpack serialized message in str into this message instance
00075 @param str: byte array of serialized message
00076 @type str: str
00077 """
00078 try:
00079 end = 0
00080 start = end
00081 end += 4
00082 (self.type,) = _struct_i.unpack(str[start:end])
00083 start = end
00084 end += 4
00085 (length,) = _struct_I.unpack(str[start:end])
00086 start = end
00087 end += length
00088 self.status = str[start:end]
00089 return self
00090 except struct.error, e:
00091 raise roslib.message.DeserializationError(e)
00092
00093
00094 def serialize_numpy(self, buff, numpy):
00095 """
00096 serialize message with numpy array types into buffer
00097 @param buff: buffer
00098 @type buff: StringIO
00099 @param numpy: numpy python module
00100 @type numpy module
00101 """
00102 try:
00103 buff.write(_struct_i.pack(self.type))
00104 _x = self.status
00105 length = len(_x)
00106 buff.write(struct.pack('<I%ss'%length, length, _x))
00107 except struct.error, se: self._check_types(se)
00108 except TypeError, 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
00114 @type str: str
00115 @param numpy: numpy python module
00116 @type numpy: module
00117 """
00118 try:
00119 end = 0
00120 start = end
00121 end += 4
00122 (self.type,) = _struct_i.unpack(str[start:end])
00123 start = end
00124 end += 4
00125 (length,) = _struct_I.unpack(str[start:end])
00126 start = end
00127 end += length
00128 self.status = str[start:end]
00129 return self
00130 except struct.error, e:
00131 raise roslib.message.DeserializationError(e)
00132
00133 _struct_I = roslib.message.struct_I
00134 _struct_i = struct.Struct("<i")