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