00001 """autogenerated by genmsg_py from EmbeddedFixedLength.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import test_roscpp_serialization.msg
00006
00007 class EmbeddedFixedLength(roslib.message.Message):
00008 _md5sum = "770e15962592d1fbea70b6b820ba16d9"
00009 _type = "test_roscpp_serialization/EmbeddedFixedLength"
00010 _has_header = False
00011 _full_text = """FixedLength a
00012
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']
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(EmbeddedFixedLength, self).__init__(*args, **kwds)
00038
00039 if self.a is None:
00040 self.a = test_roscpp_serialization.msg.FixedLength()
00041 else:
00042 self.a = 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 _x = self
00058 buff.write(_struct_If.pack(_x.a.a, _x.a.b))
00059 except struct.error, se: self._check_types(se)
00060 except TypeError, te: self._check_types(te)
00061
00062 def deserialize(self, str):
00063 """
00064 unpack serialized message in str into this message instance
00065 @param str: byte array of serialized message
00066 @type str: str
00067 """
00068 try:
00069 if self.a is None:
00070 self.a = test_roscpp_serialization.msg.FixedLength()
00071 end = 0
00072 _x = self
00073 start = end
00074 end += 8
00075 (_x.a.a, _x.a.b,) = _struct_If.unpack(str[start:end])
00076 return self
00077 except struct.error, e:
00078 raise roslib.message.DeserializationError(e)
00079
00080
00081 def serialize_numpy(self, buff, numpy):
00082 """
00083 serialize message with numpy array types into buffer
00084 @param buff: buffer
00085 @type buff: StringIO
00086 @param numpy: numpy python module
00087 @type numpy module
00088 """
00089 try:
00090 _x = self
00091 buff.write(_struct_If.pack(_x.a.a, _x.a.b))
00092 except struct.error, se: self._check_types(se)
00093 except TypeError, te: self._check_types(te)
00094
00095 def deserialize_numpy(self, str, numpy):
00096 """
00097 unpack serialized message in str into this message instance using numpy for array types
00098 @param str: byte array of serialized message
00099 @type str: str
00100 @param numpy: numpy python module
00101 @type numpy: module
00102 """
00103 try:
00104 if self.a is None:
00105 self.a = test_roscpp_serialization.msg.FixedLength()
00106 end = 0
00107 _x = self
00108 start = end
00109 end += 8
00110 (_x.a.a, _x.a.b,) = _struct_If.unpack(str[start:end])
00111 return self
00112 except struct.error, e:
00113 raise roslib.message.DeserializationError(e)
00114
00115 _struct_I = roslib.message.struct_I
00116 _struct_If = struct.Struct("<If")