_DatabaseReturnCode.py
Go to the documentation of this file.
00001 """autogenerated by genpy from household_objects_database_msgs/DatabaseReturnCode.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 DatabaseReturnCode(genpy.Message):
00009   _md5sum = "b649fd6fa3a4e3bf8e3f4b4e648fa0f1"
00010   _type = "household_objects_database_msgs/DatabaseReturnCode"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# return codes for database-related services
00013 
00014 int32 UNKNOWN_ERROR = 1
00015 int32 DATABASE_NOT_CONNECTED = 2
00016 int32 DATABASE_QUERY_ERROR = 3
00017 int32 SUCCESS = -1
00018 
00019 int32 code
00020 """
00021   # Pseudo-constants
00022   UNKNOWN_ERROR = 1
00023   DATABASE_NOT_CONNECTED = 2
00024   DATABASE_QUERY_ERROR = 3
00025   SUCCESS = -1
00026 
00027   __slots__ = ['code']
00028   _slot_types = ['int32']
00029 
00030   def __init__(self, *args, **kwds):
00031     """
00032     Constructor. Any message fields that are implicitly/explicitly
00033     set to None will be assigned a default value. The recommend
00034     use is keyword arguments as this is more robust to future message
00035     changes.  You cannot mix in-order arguments and keyword arguments.
00036 
00037     The available fields are:
00038        code
00039 
00040     :param args: complete set of field values, in .msg order
00041     :param kwds: use keyword arguments corresponding to message field names
00042     to set specific fields.
00043     """
00044     if args or kwds:
00045       super(DatabaseReturnCode, self).__init__(*args, **kwds)
00046       #message fields cannot be None, assign default values for those that are
00047       if self.code is None:
00048         self.code = 0
00049     else:
00050       self.code = 0
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, ``StringIO``
00062     """
00063     try:
00064       buff.write(_struct_i.pack(self.code))
00065     except struct.error as se: self._check_types(se)
00066     except TypeError as te: self._check_types(te)
00067 
00068   def deserialize(self, str):
00069     """
00070     unpack serialized message in str into this message instance
00071     :param str: byte array of serialized message, ``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 as e:
00080       raise genpy.DeserializationError(e) #most likely buffer underfill
00081 
00082 
00083   def serialize_numpy(self, buff, numpy):
00084     """
00085     serialize message with numpy array types into buffer
00086     :param buff: buffer, ``StringIO``
00087     :param numpy: numpy python module
00088     """
00089     try:
00090       buff.write(_struct_i.pack(self.code))
00091     except struct.error as se: self._check_types(se)
00092     except TypeError as te: self._check_types(te)
00093 
00094   def deserialize_numpy(self, str, numpy):
00095     """
00096     unpack serialized message in str into this message instance using numpy for array types
00097     :param str: byte array of serialized message, ``str``
00098     :param numpy: numpy python module
00099     """
00100     try:
00101       end = 0
00102       start = end
00103       end += 4
00104       (self.code,) = _struct_i.unpack(str[start:end])
00105       return self
00106     except struct.error as e:
00107       raise genpy.DeserializationError(e) #most likely buffer underfill
00108 
00109 _struct_I = genpy.struct_I
00110 _struct_i = struct.Struct("<i")


household_objects_database_msgs
Author(s): Matei Ciocarlie
autogenerated on Thu Jan 2 2014 11:37:20