00001 """autogenerated by genmsg_py from DatabaseReturnCode.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class DatabaseReturnCode(roslib.message.Message):
00007 _md5sum = "b649fd6fa3a4e3bf8e3f4b4e648fa0f1"
00008 _type = "household_objects_database_msgs/DatabaseReturnCode"
00009 _has_header = False
00010 _full_text = """# return codes for database-related services
00011
00012 int32 UNKNOWN_ERROR = 1
00013 int32 DATABASE_NOT_CONNECTED = 2
00014 int32 DATABASE_QUERY_ERROR = 3
00015 int32 SUCCESS = -1
00016
00017 int32 code
00018 """
00019
00020 UNKNOWN_ERROR = 1
00021 DATABASE_NOT_CONNECTED = 2
00022 DATABASE_QUERY_ERROR = 3
00023 SUCCESS = -1
00024
00025 __slots__ = ['code']
00026 _slot_types = ['int32']
00027
00028 def __init__(self, *args, **kwds):
00029 """
00030 Constructor. Any message fields that are implicitly/explicitly
00031 set to None will be assigned a default value. The recommend
00032 use is keyword arguments as this is more robust to future message
00033 changes. You cannot mix in-order arguments and keyword arguments.
00034
00035 The available fields are:
00036 code
00037
00038 @param args: complete set of field values, in .msg order
00039 @param kwds: use keyword arguments corresponding to message field names
00040 to set specific fields.
00041 """
00042 if args or kwds:
00043 super(DatabaseReturnCode, self).__init__(*args, **kwds)
00044
00045 if self.code is None:
00046 self.code = 0
00047 else:
00048 self.code = 0
00049
00050 def _get_types(self):
00051 """
00052 internal API method
00053 """
00054 return self._slot_types
00055
00056 def serialize(self, buff):
00057 """
00058 serialize message into buffer
00059 @param buff: buffer
00060 @type buff: StringIO
00061 """
00062 try:
00063 buff.write(_struct_i.pack(self.code))
00064 except struct.error, se: self._check_types(se)
00065 except TypeError, te: self._check_types(te)
00066
00067 def deserialize(self, str):
00068 """
00069 unpack serialized message in str into this message instance
00070 @param str: byte array of serialized message
00071 @type str: str
00072 """
00073 try:
00074 end = 0
00075 start = end
00076 end += 4
00077 (self.code,) = _struct_i.unpack(str[start:end])
00078 return self
00079 except struct.error, e:
00080 raise roslib.message.DeserializationError(e)
00081
00082
00083 def serialize_numpy(self, buff, numpy):
00084 """
00085 serialize message with numpy array types into buffer
00086 @param buff: buffer
00087 @type buff: StringIO
00088 @param numpy: numpy python module
00089 @type numpy module
00090 """
00091 try:
00092 buff.write(_struct_i.pack(self.code))
00093 except struct.error, se: self._check_types(se)
00094 except TypeError, te: self._check_types(te)
00095
00096 def deserialize_numpy(self, str, numpy):
00097 """
00098 unpack serialized message in str into this message instance using numpy for array types
00099 @param str: byte array of serialized message
00100 @type str: str
00101 @param numpy: numpy python module
00102 @type numpy: module
00103 """
00104 try:
00105 end = 0
00106 start = end
00107 end += 4
00108 (self.code,) = _struct_i.unpack(str[start:end])
00109 return self
00110 except struct.error, e:
00111 raise roslib.message.DeserializationError(e)
00112
00113 _struct_I = roslib.message.struct_I
00114 _struct_i = struct.Struct("<i")