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