00001 """autogenerated by genmsg_py from TestMsgRename.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import test_crosspackage.msg
00006
00007 class TestMsgRename(roslib.message.Message):
00008 _md5sum = "796739ec6543fa03d2eb39f3aacaa2c0"
00009 _type = "test_crosspackage/TestMsgRename"
00010 _has_header = False
00011 _full_text = """string field1
00012 int32 field2
00013 TestSubMsgRename field3
00014 ================================================================================
00015 MSG: test_crosspackage/TestSubMsgRename
00016 string field1
00017 int32 field2
00018
00019 """
00020 __slots__ = ['field1','field2','field3']
00021 _slot_types = ['string','int32','test_crosspackage/TestSubMsgRename']
00022
00023 def __init__(self, *args, **kwds):
00024 """
00025 Constructor. Any message fields that are implicitly/explicitly
00026 set to None will be assigned a default value. The recommend
00027 use is keyword arguments as this is more robust to future message
00028 changes. You cannot mix in-order arguments and keyword arguments.
00029
00030 The available fields are:
00031 field1,field2,field3
00032
00033 @param args: complete set of field values, in .msg order
00034 @param kwds: use keyword arguments corresponding to message field names
00035 to set specific fields.
00036 """
00037 if args or kwds:
00038 super(TestMsgRename, self).__init__(*args, **kwds)
00039
00040 if self.field1 is None:
00041 self.field1 = ''
00042 if self.field2 is None:
00043 self.field2 = 0
00044 if self.field3 is None:
00045 self.field3 = test_crosspackage.msg.TestSubMsgRename()
00046 else:
00047 self.field1 = ''
00048 self.field2 = 0
00049 self.field3 = test_crosspackage.msg.TestSubMsgRename()
00050
00051 def _get_types(self):
00052 """
00053 internal API method
00054 """
00055 return self._slot_types
00056
00057 def serialize(self, buff):
00058 """
00059 serialize message into buffer
00060 @param buff: buffer
00061 @type buff: StringIO
00062 """
00063 try:
00064 _x = self.field1
00065 length = len(_x)
00066 buff.write(struct.pack('<I%ss'%length, length, _x))
00067 buff.write(_struct_i.pack(self.field2))
00068 _x = self.field3.field1
00069 length = len(_x)
00070 buff.write(struct.pack('<I%ss'%length, length, _x))
00071 buff.write(_struct_i.pack(self.field3.field2))
00072 except struct.error, se: self._check_types(se)
00073 except TypeError, te: self._check_types(te)
00074
00075 def deserialize(self, str):
00076 """
00077 unpack serialized message in str into this message instance
00078 @param str: byte array of serialized message
00079 @type str: str
00080 """
00081 try:
00082 if self.field3 is None:
00083 self.field3 = test_crosspackage.msg.TestSubMsgRename()
00084 end = 0
00085 start = end
00086 end += 4
00087 (length,) = _struct_I.unpack(str[start:end])
00088 start = end
00089 end += length
00090 self.field1 = str[start:end]
00091 start = end
00092 end += 4
00093 (self.field2,) = _struct_i.unpack(str[start:end])
00094 start = end
00095 end += 4
00096 (length,) = _struct_I.unpack(str[start:end])
00097 start = end
00098 end += length
00099 self.field3.field1 = str[start:end]
00100 start = end
00101 end += 4
00102 (self.field3.field2,) = _struct_i.unpack(str[start:end])
00103 return self
00104 except struct.error, e:
00105 raise roslib.message.DeserializationError(e)
00106
00107
00108 def serialize_numpy(self, buff, numpy):
00109 """
00110 serialize message with numpy array types into buffer
00111 @param buff: buffer
00112 @type buff: StringIO
00113 @param numpy: numpy python module
00114 @type numpy module
00115 """
00116 try:
00117 _x = self.field1
00118 length = len(_x)
00119 buff.write(struct.pack('<I%ss'%length, length, _x))
00120 buff.write(_struct_i.pack(self.field2))
00121 _x = self.field3.field1
00122 length = len(_x)
00123 buff.write(struct.pack('<I%ss'%length, length, _x))
00124 buff.write(_struct_i.pack(self.field3.field2))
00125 except struct.error, se: self._check_types(se)
00126 except TypeError, te: self._check_types(te)
00127
00128 def deserialize_numpy(self, str, numpy):
00129 """
00130 unpack serialized message in str into this message instance using numpy for array types
00131 @param str: byte array of serialized message
00132 @type str: str
00133 @param numpy: numpy python module
00134 @type numpy: module
00135 """
00136 try:
00137 if self.field3 is None:
00138 self.field3 = test_crosspackage.msg.TestSubMsgRename()
00139 end = 0
00140 start = end
00141 end += 4
00142 (length,) = _struct_I.unpack(str[start:end])
00143 start = end
00144 end += length
00145 self.field1 = str[start:end]
00146 start = end
00147 end += 4
00148 (self.field2,) = _struct_i.unpack(str[start:end])
00149 start = end
00150 end += 4
00151 (length,) = _struct_I.unpack(str[start:end])
00152 start = end
00153 end += length
00154 self.field3.field1 = str[start:end]
00155 start = end
00156 end += 4
00157 (self.field3.field2,) = _struct_i.unpack(str[start:end])
00158 return self
00159 except struct.error, e:
00160 raise roslib.message.DeserializationError(e)
00161
00162 _struct_I = roslib.message.struct_I
00163 _struct_i = struct.Struct("<i")