00001 """autogenerated by genmsg_py from TypeNameChangeArray1.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import test_roslib_comm.msg
00006
00007 class TypeNameChangeArray1(roslib.message.Message):
00008 _md5sum = "31a9992534c4d020bfc4045e7dc1a786"
00009 _type = "test_roslib_comm/TypeNameChangeArray1"
00010 _has_header = False
00011 _full_text = """SameSubMsg1[] a
00012 ================================================================================
00013 MSG: test_roslib_comm/SameSubMsg1
00014 int32 a
00015 float32 b
00016 string c
00017 uint64[10] d
00018 float64[] e
00019 """
00020 __slots__ = ['a']
00021 _slot_types = ['test_roslib_comm/SameSubMsg1[]']
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 a
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(TypeNameChangeArray1, self).__init__(*args, **kwds)
00039
00040 if self.a is None:
00041 self.a = []
00042 else:
00043 self.a = []
00044
00045 def _get_types(self):
00046 """
00047 internal API method
00048 """
00049 return self._slot_types
00050
00051 def serialize(self, buff):
00052 """
00053 serialize message into buffer
00054 @param buff: buffer
00055 @type buff: StringIO
00056 """
00057 try:
00058 length = len(self.a)
00059 buff.write(_struct_I.pack(length))
00060 for val1 in self.a:
00061 _x = val1
00062 buff.write(_struct_if.pack(_x.a, _x.b))
00063 _x = val1.c
00064 length = len(_x)
00065 buff.write(struct.pack('<I%ss'%length, length, _x))
00066 buff.write(_struct_10Q.pack(*val1.d))
00067 length = len(val1.e)
00068 buff.write(_struct_I.pack(length))
00069 pattern = '<%sd'%length
00070 buff.write(struct.pack(pattern, *val1.e))
00071 except struct.error, se: self._check_types(se)
00072 except TypeError, te: self._check_types(te)
00073
00074 def deserialize(self, str):
00075 """
00076 unpack serialized message in str into this message instance
00077 @param str: byte array of serialized message
00078 @type str: str
00079 """
00080 try:
00081 end = 0
00082 start = end
00083 end += 4
00084 (length,) = _struct_I.unpack(str[start:end])
00085 self.a = []
00086 for i in xrange(0, length):
00087 val1 = test_roslib_comm.msg.SameSubMsg1()
00088 _x = val1
00089 start = end
00090 end += 8
00091 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00092 start = end
00093 end += 4
00094 (length,) = _struct_I.unpack(str[start:end])
00095 start = end
00096 end += length
00097 val1.c = str[start:end]
00098 start = end
00099 end += 80
00100 val1.d = _struct_10Q.unpack(str[start:end])
00101 start = end
00102 end += 4
00103 (length,) = _struct_I.unpack(str[start:end])
00104 pattern = '<%sd'%length
00105 start = end
00106 end += struct.calcsize(pattern)
00107 val1.e = struct.unpack(pattern, str[start:end])
00108 self.a.append(val1)
00109 return self
00110 except struct.error, e:
00111 raise roslib.message.DeserializationError(e)
00112
00113
00114 def serialize_numpy(self, buff, numpy):
00115 """
00116 serialize message with numpy array types into buffer
00117 @param buff: buffer
00118 @type buff: StringIO
00119 @param numpy: numpy python module
00120 @type numpy module
00121 """
00122 try:
00123 length = len(self.a)
00124 buff.write(_struct_I.pack(length))
00125 for val1 in self.a:
00126 _x = val1
00127 buff.write(_struct_if.pack(_x.a, _x.b))
00128 _x = val1.c
00129 length = len(_x)
00130 buff.write(struct.pack('<I%ss'%length, length, _x))
00131 buff.write(val1.d.tostring())
00132 length = len(val1.e)
00133 buff.write(_struct_I.pack(length))
00134 pattern = '<%sd'%length
00135 buff.write(val1.e.tostring())
00136 except struct.error, se: self._check_types(se)
00137 except TypeError, te: self._check_types(te)
00138
00139 def deserialize_numpy(self, str, numpy):
00140 """
00141 unpack serialized message in str into this message instance using numpy for array types
00142 @param str: byte array of serialized message
00143 @type str: str
00144 @param numpy: numpy python module
00145 @type numpy: module
00146 """
00147 try:
00148 end = 0
00149 start = end
00150 end += 4
00151 (length,) = _struct_I.unpack(str[start:end])
00152 self.a = []
00153 for i in xrange(0, length):
00154 val1 = test_roslib_comm.msg.SameSubMsg1()
00155 _x = val1
00156 start = end
00157 end += 8
00158 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00159 start = end
00160 end += 4
00161 (length,) = _struct_I.unpack(str[start:end])
00162 start = end
00163 end += length
00164 val1.c = str[start:end]
00165 start = end
00166 end += 80
00167 val1.d = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=10)
00168 start = end
00169 end += 4
00170 (length,) = _struct_I.unpack(str[start:end])
00171 pattern = '<%sd'%length
00172 start = end
00173 end += struct.calcsize(pattern)
00174 val1.e = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00175 self.a.append(val1)
00176 return self
00177 except struct.error, e:
00178 raise roslib.message.DeserializationError(e)
00179
00180 _struct_I = roslib.message.struct_I
00181 _struct_10Q = struct.Struct("<10Q")
00182 _struct_if = struct.Struct("<if")