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