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