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