00001 """autogenerated by genmsg_py from TypeNameChangeComplex2.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import test_roslib_comm.msg
00006
00007 class TypeNameChangeComplex2(roslib.message.Message):
00008 _md5sum = "a01688a0991b9d7d9facf6d94b993e93"
00009 _type = "test_roslib_comm/TypeNameChangeComplex2"
00010 _has_header = False
00011 _full_text = """SameSubMsg2[] a
00012 SameSubMsg3[10] b
00013
00014 ================================================================================
00015 MSG: test_roslib_comm/SameSubMsg2
00016 int32 a
00017 float32 b
00018 string c
00019 uint64[10] d
00020 float64[] e
00021 ================================================================================
00022 MSG: test_roslib_comm/SameSubMsg3
00023
00024 # Lots of comments
00025 int32 a #And more comments
00026 float32 b
00027 string c
00028 # And also some white space
00029
00030
00031 uint64[10] d
00032 float64[] e
00033
00034
00035 """
00036 __slots__ = ['a','b']
00037 _slot_types = ['test_roslib_comm/SameSubMsg2[]','test_roslib_comm/SameSubMsg3[10]']
00038
00039 def __init__(self, *args, **kwds):
00040 """
00041 Constructor. Any message fields that are implicitly/explicitly
00042 set to None will be assigned a default value. The recommend
00043 use is keyword arguments as this is more robust to future message
00044 changes. You cannot mix in-order arguments and keyword arguments.
00045
00046 The available fields are:
00047 a,b
00048
00049 @param args: complete set of field values, in .msg order
00050 @param kwds: use keyword arguments corresponding to message field names
00051 to set specific fields.
00052 """
00053 if args or kwds:
00054 super(TypeNameChangeComplex2, self).__init__(*args, **kwds)
00055
00056 if self.a is None:
00057 self.a = []
00058 if self.b is None:
00059 self.b = [test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3()]
00060 else:
00061 self.a = []
00062 self.b = [test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3(),test_roslib_comm.msg.SameSubMsg3()]
00063
00064 def _get_types(self):
00065 """
00066 internal API method
00067 """
00068 return self._slot_types
00069
00070 def serialize(self, buff):
00071 """
00072 serialize message into buffer
00073 @param buff: buffer
00074 @type buff: StringIO
00075 """
00076 try:
00077 length = len(self.a)
00078 buff.write(_struct_I.pack(length))
00079 for val1 in self.a:
00080 _x = val1
00081 buff.write(_struct_if.pack(_x.a, _x.b))
00082 _x = val1.c
00083 length = len(_x)
00084 buff.write(struct.pack('<I%ss'%length, length, _x))
00085 buff.write(_struct_10Q.pack(*val1.d))
00086 length = len(val1.e)
00087 buff.write(_struct_I.pack(length))
00088 pattern = '<%sd'%length
00089 buff.write(struct.pack(pattern, *val1.e))
00090 for val1 in self.b:
00091 _x = val1
00092 buff.write(_struct_if.pack(_x.a, _x.b))
00093 _x = val1.c
00094 length = len(_x)
00095 buff.write(struct.pack('<I%ss'%length, length, _x))
00096 buff.write(_struct_10Q.pack(*val1.d))
00097 length = len(val1.e)
00098 buff.write(_struct_I.pack(length))
00099 pattern = '<%sd'%length
00100 buff.write(struct.pack(pattern, *val1.e))
00101 except struct.error, se: self._check_types(se)
00102 except TypeError, te: self._check_types(te)
00103
00104 def deserialize(self, str):
00105 """
00106 unpack serialized message in str into this message instance
00107 @param str: byte array of serialized message
00108 @type str: str
00109 """
00110 try:
00111 end = 0
00112 start = end
00113 end += 4
00114 (length,) = _struct_I.unpack(str[start:end])
00115 self.a = []
00116 for i in xrange(0, length):
00117 val1 = test_roslib_comm.msg.SameSubMsg2()
00118 _x = val1
00119 start = end
00120 end += 8
00121 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00122 start = end
00123 end += 4
00124 (length,) = _struct_I.unpack(str[start:end])
00125 start = end
00126 end += length
00127 val1.c = str[start:end]
00128 start = end
00129 end += 80
00130 val1.d = _struct_10Q.unpack(str[start:end])
00131 start = end
00132 end += 4
00133 (length,) = _struct_I.unpack(str[start:end])
00134 pattern = '<%sd'%length
00135 start = end
00136 end += struct.calcsize(pattern)
00137 val1.e = struct.unpack(pattern, str[start:end])
00138 self.a.append(val1)
00139 self.b = []
00140 for i in xrange(0, 10):
00141 val1 = test_roslib_comm.msg.SameSubMsg3()
00142 _x = val1
00143 start = end
00144 end += 8
00145 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00146 start = end
00147 end += 4
00148 (length,) = _struct_I.unpack(str[start:end])
00149 start = end
00150 end += length
00151 val1.c = str[start:end]
00152 start = end
00153 end += 80
00154 val1.d = _struct_10Q.unpack(str[start:end])
00155 start = end
00156 end += 4
00157 (length,) = _struct_I.unpack(str[start:end])
00158 pattern = '<%sd'%length
00159 start = end
00160 end += struct.calcsize(pattern)
00161 val1.e = struct.unpack(pattern, str[start:end])
00162 self.b.append(val1)
00163 return self
00164 except struct.error, e:
00165 raise roslib.message.DeserializationError(e)
00166
00167
00168 def serialize_numpy(self, buff, numpy):
00169 """
00170 serialize message with numpy array types into buffer
00171 @param buff: buffer
00172 @type buff: StringIO
00173 @param numpy: numpy python module
00174 @type numpy module
00175 """
00176 try:
00177 length = len(self.a)
00178 buff.write(_struct_I.pack(length))
00179 for val1 in self.a:
00180 _x = val1
00181 buff.write(_struct_if.pack(_x.a, _x.b))
00182 _x = val1.c
00183 length = len(_x)
00184 buff.write(struct.pack('<I%ss'%length, length, _x))
00185 buff.write(val1.d.tostring())
00186 length = len(val1.e)
00187 buff.write(_struct_I.pack(length))
00188 pattern = '<%sd'%length
00189 buff.write(val1.e.tostring())
00190 for val1 in self.b:
00191 _x = val1
00192 buff.write(_struct_if.pack(_x.a, _x.b))
00193 _x = val1.c
00194 length = len(_x)
00195 buff.write(struct.pack('<I%ss'%length, length, _x))
00196 buff.write(val1.d.tostring())
00197 length = len(val1.e)
00198 buff.write(_struct_I.pack(length))
00199 pattern = '<%sd'%length
00200 buff.write(val1.e.tostring())
00201 except struct.error, se: self._check_types(se)
00202 except TypeError, te: self._check_types(te)
00203
00204 def deserialize_numpy(self, str, numpy):
00205 """
00206 unpack serialized message in str into this message instance using numpy for array types
00207 @param str: byte array of serialized message
00208 @type str: str
00209 @param numpy: numpy python module
00210 @type numpy: module
00211 """
00212 try:
00213 end = 0
00214 start = end
00215 end += 4
00216 (length,) = _struct_I.unpack(str[start:end])
00217 self.a = []
00218 for i in xrange(0, length):
00219 val1 = test_roslib_comm.msg.SameSubMsg2()
00220 _x = val1
00221 start = end
00222 end += 8
00223 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00224 start = end
00225 end += 4
00226 (length,) = _struct_I.unpack(str[start:end])
00227 start = end
00228 end += length
00229 val1.c = str[start:end]
00230 start = end
00231 end += 80
00232 val1.d = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=10)
00233 start = end
00234 end += 4
00235 (length,) = _struct_I.unpack(str[start:end])
00236 pattern = '<%sd'%length
00237 start = end
00238 end += struct.calcsize(pattern)
00239 val1.e = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00240 self.a.append(val1)
00241 self.b = []
00242 for i in xrange(0, 10):
00243 val1 = test_roslib_comm.msg.SameSubMsg3()
00244 _x = val1
00245 start = end
00246 end += 8
00247 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00248 start = end
00249 end += 4
00250 (length,) = _struct_I.unpack(str[start:end])
00251 start = end
00252 end += length
00253 val1.c = str[start:end]
00254 start = end
00255 end += 80
00256 val1.d = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=10)
00257 start = end
00258 end += 4
00259 (length,) = _struct_I.unpack(str[start:end])
00260 pattern = '<%sd'%length
00261 start = end
00262 end += struct.calcsize(pattern)
00263 val1.e = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00264 self.b.append(val1)
00265 return self
00266 except struct.error, e:
00267 raise roslib.message.DeserializationError(e)
00268
00269 _struct_I = roslib.message.struct_I
00270 _struct_10Q = struct.Struct("<10Q")
00271 _struct_if = struct.Struct("<if")