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