00001 """autogenerated by genmsg_py from HeaderNotFirstMember.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class HeaderNotFirstMember(roslib.message.Message):
00008 _md5sum = "c7ed781820d7a36c5947d0f441f50964"
00009 _type = "test_roscpp_serialization/HeaderNotFirstMember"
00010 _has_header = False
00011 _full_text = """int8 foo
00012 Header header
00013
00014 ================================================================================
00015 MSG: std_msgs/Header
00016 # Standard metadata for higher-level stamped data types.
00017 # This is generally used to communicate timestamped data
00018 # in a particular coordinate frame.
00019 #
00020 # sequence ID: consecutively increasing ID
00021 uint32 seq
00022 #Two-integer timestamp that is expressed as:
00023 # * stamp.secs: seconds (stamp_secs) since epoch
00024 # * stamp.nsecs: nanoseconds since stamp_secs
00025 # time-handling sugar is provided by the client library
00026 time stamp
00027 #Frame this data is associated with
00028 # 0: no frame
00029 # 1: global frame
00030 string frame_id
00031
00032 """
00033 __slots__ = ['foo','header']
00034 _slot_types = ['int8','Header']
00035
00036 def __init__(self, *args, **kwds):
00037 """
00038 Constructor. Any message fields that are implicitly/explicitly
00039 set to None will be assigned a default value. The recommend
00040 use is keyword arguments as this is more robust to future message
00041 changes. You cannot mix in-order arguments and keyword arguments.
00042
00043 The available fields are:
00044 foo,header
00045
00046 @param args: complete set of field values, in .msg order
00047 @param kwds: use keyword arguments corresponding to message field names
00048 to set specific fields.
00049 """
00050 if args or kwds:
00051 super(HeaderNotFirstMember, self).__init__(*args, **kwds)
00052
00053 if self.foo is None:
00054 self.foo = 0
00055 if self.header is None:
00056 self.header = std_msgs.msg._Header.Header()
00057 else:
00058 self.foo = 0
00059 self.header = std_msgs.msg._Header.Header()
00060
00061 def _get_types(self):
00062 """
00063 internal API method
00064 """
00065 return self._slot_types
00066
00067 def serialize(self, buff):
00068 """
00069 serialize message into buffer
00070 @param buff: buffer
00071 @type buff: StringIO
00072 """
00073 try:
00074 _x = self
00075 buff.write(_struct_b3I.pack(_x.foo, _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00076 _x = self.header.frame_id
00077 length = len(_x)
00078 buff.write(struct.pack('<I%ss'%length, length, _x))
00079 except struct.error, se: self._check_types(se)
00080 except TypeError, te: self._check_types(te)
00081
00082 def deserialize(self, str):
00083 """
00084 unpack serialized message in str into this message instance
00085 @param str: byte array of serialized message
00086 @type str: str
00087 """
00088 try:
00089 if self.header is None:
00090 self.header = std_msgs.msg._Header.Header()
00091 end = 0
00092 _x = self
00093 start = end
00094 end += 13
00095 (_x.foo, _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_b3I.unpack(str[start:end])
00096 start = end
00097 end += 4
00098 (length,) = _struct_I.unpack(str[start:end])
00099 start = end
00100 end += length
00101 self.header.frame_id = str[start:end]
00102 return self
00103 except struct.error, e:
00104 raise roslib.message.DeserializationError(e)
00105
00106
00107 def serialize_numpy(self, buff, numpy):
00108 """
00109 serialize message with numpy array types into buffer
00110 @param buff: buffer
00111 @type buff: StringIO
00112 @param numpy: numpy python module
00113 @type numpy module
00114 """
00115 try:
00116 _x = self
00117 buff.write(_struct_b3I.pack(_x.foo, _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00118 _x = self.header.frame_id
00119 length = len(_x)
00120 buff.write(struct.pack('<I%ss'%length, length, _x))
00121 except struct.error, se: self._check_types(se)
00122 except TypeError, te: self._check_types(te)
00123
00124 def deserialize_numpy(self, str, numpy):
00125 """
00126 unpack serialized message in str into this message instance using numpy for array types
00127 @param str: byte array of serialized message
00128 @type str: str
00129 @param numpy: numpy python module
00130 @type numpy: module
00131 """
00132 try:
00133 if self.header is None:
00134 self.header = std_msgs.msg._Header.Header()
00135 end = 0
00136 _x = self
00137 start = end
00138 end += 13
00139 (_x.foo, _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_b3I.unpack(str[start:end])
00140 start = end
00141 end += 4
00142 (length,) = _struct_I.unpack(str[start:end])
00143 start = end
00144 end += length
00145 self.header.frame_id = str[start:end]
00146 return self
00147 except struct.error, e:
00148 raise roslib.message.DeserializationError(e)
00149
00150 _struct_I = roslib.message.struct_I
00151 _struct_b3I = struct.Struct("<b3I")