"""autogenerated by genmsg_py from StringStringRequest.msg. Do not edit."""
import roslib.message
import struct

import test_rospy.msg
import std_msgs.msg

class StringStringRequest(roslib.message.Message):
  _md5sum = "1546156fedebbd48201e9764f27ae3e2"
  _type = "test_rospy/StringStringRequest"
  _has_header = False #flag to mark the presence of a Header object
  _full_text = """std_msgs/String str
Val str2

================================================================================
MSG: std_msgs/String
string data

================================================================================
MSG: test_rospy/Val
string val
"""
  __slots__ = ['str','str2']
  _slot_types = ['std_msgs/String','test_rospy/Val']

  def __init__(self, *args, **kwds):
    """
    Constructor. Any message fields that are implicitly/explicitly
    set to None will be assigned a default value. The recommend
    use is keyword arguments as this is more robust to future message
    changes.  You cannot mix in-order arguments and keyword arguments.
    
    The available fields are:
       str,str2
    
    @param args: complete set of field values, in .msg order
    @param kwds: use keyword arguments corresponding to message field names
    to set specific fields. 
    """
    if args or kwds:
      super(StringStringRequest, self).__init__(*args, **kwds)
      #message fields cannot be None, assign default values for those that are
      if self.str is None:
        self.str = std_msgs.msg.String()
      if self.str2 is None:
        self.str2 = test_rospy.msg.Val()
    else:
      self.str = std_msgs.msg.String()
      self.str2 = test_rospy.msg.Val()

  def _get_types(self):
    """
    internal API method
    """
    return self._slot_types

  def serialize(self, buff):
    """
    serialize message into buffer
    @param buff: buffer
    @type  buff: StringIO
    """
    try:
      _x = self.str.data
      length = len(_x)
      buff.write(struct.pack('<I%ss'%length, length, _x))
      _x = self.str2.val
      length = len(_x)
      buff.write(struct.pack('<I%ss'%length, length, _x))
    except struct.error, se: self._check_types(se)
    except TypeError, te: self._check_types(te)

  def deserialize(self, str):
    """
    unpack serialized message in str into this message instance
    @param str: byte array of serialized message
    @type  str: str
    """
    try:
      if self.str is None:
        self.str = std_msgs.msg.String()
      if self.str2 is None:
        self.str2 = test_rospy.msg.Val()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      self.str.data = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      self.str2.val = str[start:end]
      return self
    except struct.error, e:
      raise roslib.message.DeserializationError(e) #most likely buffer underfill


  def serialize_numpy(self, buff, numpy):
    """
    serialize message with numpy array types into buffer
    @param buff: buffer
    @type  buff: StringIO
    @param numpy: numpy python module
    @type  numpy module
    """
    try:
      _x = self.str.data
      length = len(_x)
      buff.write(struct.pack('<I%ss'%length, length, _x))
      _x = self.str2.val
      length = len(_x)
      buff.write(struct.pack('<I%ss'%length, length, _x))
    except struct.error, se: self._check_types(se)
    except TypeError, te: self._check_types(te)

  def deserialize_numpy(self, str, numpy):
    """
    unpack serialized message in str into this message instance using numpy for array types
    @param str: byte array of serialized message
    @type  str: str
    @param numpy: numpy python module
    @type  numpy: module
    """
    try:
      if self.str is None:
        self.str = std_msgs.msg.String()
      if self.str2 is None:
        self.str2 = test_rospy.msg.Val()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      self.str.data = str[start:end]
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      self.str2.val = str[start:end]
      return self
    except struct.error, e:
      raise roslib.message.DeserializationError(e) #most likely buffer underfill

_struct_I = roslib.message.struct_I
"""autogenerated by genmsg_py from StringStringResponse.msg. Do not edit."""
import roslib.message
import struct

import std_msgs.msg

class StringStringResponse(roslib.message.Message):
  _md5sum = "32224c1636e75e68745b61629dfa07c5"
  _type = "test_rospy/StringStringResponse"
  _has_header = False #flag to mark the presence of a Header object
  _full_text = """std_msgs/String str


================================================================================
MSG: std_msgs/String
string data

"""
  __slots__ = ['str']
  _slot_types = ['std_msgs/String']

  def __init__(self, *args, **kwds):
    """
    Constructor. Any message fields that are implicitly/explicitly
    set to None will be assigned a default value. The recommend
    use is keyword arguments as this is more robust to future message
    changes.  You cannot mix in-order arguments and keyword arguments.
    
    The available fields are:
       str
    
    @param args: complete set of field values, in .msg order
    @param kwds: use keyword arguments corresponding to message field names
    to set specific fields. 
    """
    if args or kwds:
      super(StringStringResponse, self).__init__(*args, **kwds)
      #message fields cannot be None, assign default values for those that are
      if self.str is None:
        self.str = std_msgs.msg.String()
    else:
      self.str = std_msgs.msg.String()

  def _get_types(self):
    """
    internal API method
    """
    return self._slot_types

  def serialize(self, buff):
    """
    serialize message into buffer
    @param buff: buffer
    @type  buff: StringIO
    """
    try:
      _x = self.str.data
      length = len(_x)
      buff.write(struct.pack('<I%ss'%length, length, _x))
    except struct.error, se: self._check_types(se)
    except TypeError, te: self._check_types(te)

  def deserialize(self, str):
    """
    unpack serialized message in str into this message instance
    @param str: byte array of serialized message
    @type  str: str
    """
    try:
      if self.str is None:
        self.str = std_msgs.msg.String()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      self.str.data = str[start:end]
      return self
    except struct.error, e:
      raise roslib.message.DeserializationError(e) #most likely buffer underfill


  def serialize_numpy(self, buff, numpy):
    """
    serialize message with numpy array types into buffer
    @param buff: buffer
    @type  buff: StringIO
    @param numpy: numpy python module
    @type  numpy module
    """
    try:
      _x = self.str.data
      length = len(_x)
      buff.write(struct.pack('<I%ss'%length, length, _x))
    except struct.error, se: self._check_types(se)
    except TypeError, te: self._check_types(te)

  def deserialize_numpy(self, str, numpy):
    """
    unpack serialized message in str into this message instance using numpy for array types
    @param str: byte array of serialized message
    @type  str: str
    @param numpy: numpy python module
    @type  numpy: module
    """
    try:
      if self.str is None:
        self.str = std_msgs.msg.String()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      self.str.data = str[start:end]
      return self
    except struct.error, e:
      raise roslib.message.DeserializationError(e) #most likely buffer underfill

_struct_I = roslib.message.struct_I
class StringString(roslib.message.ServiceDefinition):
  _type          = 'test_rospy/StringString'
  _md5sum = '37bf11bf0378473e105b4a52f61d1a75'
  _request_class  = StringStringRequest
  _response_class = StringStringResponse
