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


class ListReturnRequest(roslib.message.Message):
  _md5sum = "55328e64986cccd71be7fe834e693c76"
  _type = "test_rospy/ListReturnRequest"
  _has_header = False #flag to mark the presence of a Header object
  _full_text = """
int32 a
int32 b
int32 c
int32 d

"""
  __slots__ = ['a','b','c','d']
  _slot_types = ['int32','int32','int32','int32']

  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:
       a,b,c,d
    
    @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(ListReturnRequest, self).__init__(*args, **kwds)
      #message fields cannot be None, assign default values for those that are
      if self.a is None:
        self.a = 0
      if self.b is None:
        self.b = 0
      if self.c is None:
        self.c = 0
      if self.d is None:
        self.d = 0
    else:
      self.a = 0
      self.b = 0
      self.c = 0
      self.d = 0

  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
      buff.write(_struct_4i.pack(_x.a, _x.b, _x.c, _x.d))
    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:
      end = 0
      _x = self
      start = end
      end += 16
      (_x.a, _x.b, _x.c, _x.d,) = _struct_4i.unpack(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
      buff.write(_struct_4i.pack(_x.a, _x.b, _x.c, _x.d))
    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:
      end = 0
      _x = self
      start = end
      end += 16
      (_x.a, _x.b, _x.c, _x.d,) = _struct_4i.unpack(str[start:end])
      return self
    except struct.error, e:
      raise roslib.message.DeserializationError(e) #most likely buffer underfill

_struct_I = roslib.message.struct_I
_struct_4i = struct.Struct("<4i")
"""autogenerated by genmsg_py from ListReturnResponse.msg. Do not edit."""
import roslib.message
import struct


class ListReturnResponse(roslib.message.Message):
  _md5sum = "f962153177b365e43b03cfe90160f33e"
  _type = "test_rospy/ListReturnResponse"
  _has_header = False #flag to mark the presence of a Header object
  _full_text = """int32[] abcd


"""
  __slots__ = ['abcd']
  _slot_types = ['int32[]']

  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:
       abcd
    
    @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(ListReturnResponse, self).__init__(*args, **kwds)
      #message fields cannot be None, assign default values for those that are
      if self.abcd is None:
        self.abcd = []
    else:
      self.abcd = []

  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:
      length = len(self.abcd)
      buff.write(_struct_I.pack(length))
      pattern = '<%si'%length
      buff.write(struct.pack(pattern, *self.abcd))
    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:
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%si'%length
      start = end
      end += struct.calcsize(pattern)
      self.abcd = struct.unpack(pattern, 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:
      length = len(self.abcd)
      buff.write(_struct_I.pack(length))
      pattern = '<%si'%length
      buff.write(self.abcd.tostring())
    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:
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%si'%length
      start = end
      end += struct.calcsize(pattern)
      self.abcd = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
      return self
    except struct.error, e:
      raise roslib.message.DeserializationError(e) #most likely buffer underfill

_struct_I = roslib.message.struct_I
class ListReturn(roslib.message.ServiceDefinition):
  _type          = 'test_rospy/ListReturn'
  _md5sum = '8083abf57e6eb0ff97ebb506984b66b8'
  _request_class  = ListReturnRequest
  _response_class = ListReturnResponse
