_MultipleRequestFields.py
Go to the documentation of this file.
00001 """autogenerated by genpy from rosbridge_test/MultipleRequestFieldsRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class MultipleRequestFieldsRequest(genpy.Message):
00009   _md5sum = "6cce9fb727dd0f31d504d7d198a1f4ef"
00010   _type = "rosbridge_test/MultipleRequestFieldsRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """int32 int
00013 float32 float
00014 string string
00015 bool bool
00016 
00017 """
00018   __slots__ = ['int','float','string','bool']
00019   _slot_types = ['int32','float32','string','bool']
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        int,float,string,bool
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(MultipleRequestFieldsRequest, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.int is None:
00039         self.int = 0
00040       if self.float is None:
00041         self.float = 0.
00042       if self.string is None:
00043         self.string = ''
00044       if self.bool is None:
00045         self.bool = False
00046     else:
00047       self.int = 0
00048       self.float = 0.
00049       self.string = ''
00050       self.bool = False
00051 
00052   def _get_types(self):
00053     """
00054     internal API method
00055     """
00056     return self._slot_types
00057 
00058   def serialize(self, buff):
00059     """
00060     serialize message into buffer
00061     :param buff: buffer, ``StringIO``
00062     """
00063     try:
00064       _x = self
00065       buff.write(_struct_if.pack(_x.int, _x.float))
00066       _x = self.string
00067       length = len(_x)
00068       if python3 or type(_x) == unicode:
00069         _x = _x.encode('utf-8')
00070         length = len(_x)
00071       buff.write(struct.pack('<I%ss'%length, length, _x))
00072       buff.write(_struct_B.pack(self.bool))
00073     except struct.error as se: self._check_types(se)
00074     except TypeError as te: self._check_types(te)
00075 
00076   def deserialize(self, str):
00077     """
00078     unpack serialized message in str into this message instance
00079     :param str: byte array of serialized message, ``str``
00080     """
00081     try:
00082       end = 0
00083       _x = self
00084       start = end
00085       end += 8
00086       (_x.int, _x.float,) = _struct_if.unpack(str[start:end])
00087       start = end
00088       end += 4
00089       (length,) = _struct_I.unpack(str[start:end])
00090       start = end
00091       end += length
00092       if python3:
00093         self.string = str[start:end].decode('utf-8')
00094       else:
00095         self.string = str[start:end]
00096       start = end
00097       end += 1
00098       (self.bool,) = _struct_B.unpack(str[start:end])
00099       self.bool = bool(self.bool)
00100       return self
00101     except struct.error as e:
00102       raise genpy.DeserializationError(e) #most likely buffer underfill
00103 
00104 
00105   def serialize_numpy(self, buff, numpy):
00106     """
00107     serialize message with numpy array types into buffer
00108     :param buff: buffer, ``StringIO``
00109     :param numpy: numpy python module
00110     """
00111     try:
00112       _x = self
00113       buff.write(_struct_if.pack(_x.int, _x.float))
00114       _x = self.string
00115       length = len(_x)
00116       if python3 or type(_x) == unicode:
00117         _x = _x.encode('utf-8')
00118         length = len(_x)
00119       buff.write(struct.pack('<I%ss'%length, length, _x))
00120       buff.write(_struct_B.pack(self.bool))
00121     except struct.error as se: self._check_types(se)
00122     except TypeError as te: self._check_types(te)
00123 
00124   def deserialize_numpy(self, str, numpy):
00125     """
00126     unpack serialized message in str into this message instance using numpy for array types
00127     :param str: byte array of serialized message, ``str``
00128     :param numpy: numpy python module
00129     """
00130     try:
00131       end = 0
00132       _x = self
00133       start = end
00134       end += 8
00135       (_x.int, _x.float,) = _struct_if.unpack(str[start:end])
00136       start = end
00137       end += 4
00138       (length,) = _struct_I.unpack(str[start:end])
00139       start = end
00140       end += length
00141       if python3:
00142         self.string = str[start:end].decode('utf-8')
00143       else:
00144         self.string = str[start:end]
00145       start = end
00146       end += 1
00147       (self.bool,) = _struct_B.unpack(str[start:end])
00148       self.bool = bool(self.bool)
00149       return self
00150     except struct.error as e:
00151       raise genpy.DeserializationError(e) #most likely buffer underfill
00152 
00153 _struct_I = genpy.struct_I
00154 _struct_B = struct.Struct("<B")
00155 _struct_if = struct.Struct("<if")
00156 """autogenerated by genpy from rosbridge_test/MultipleRequestFieldsResponse.msg. Do not edit."""
00157 import sys
00158 python3 = True if sys.hexversion > 0x03000000 else False
00159 import genpy
00160 import struct
00161 
00162 
00163 class MultipleRequestFieldsResponse(genpy.Message):
00164   _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00165   _type = "rosbridge_test/MultipleRequestFieldsResponse"
00166   _has_header = False #flag to mark the presence of a Header object
00167   _full_text = """
00168 """
00169   __slots__ = []
00170   _slot_types = []
00171 
00172   def __init__(self, *args, **kwds):
00173     """
00174     Constructor. Any message fields that are implicitly/explicitly
00175     set to None will be assigned a default value. The recommend
00176     use is keyword arguments as this is more robust to future message
00177     changes.  You cannot mix in-order arguments and keyword arguments.
00178 
00179     The available fields are:
00180        
00181 
00182     :param args: complete set of field values, in .msg order
00183     :param kwds: use keyword arguments corresponding to message field names
00184     to set specific fields.
00185     """
00186     if args or kwds:
00187       super(MultipleRequestFieldsResponse, self).__init__(*args, **kwds)
00188 
00189   def _get_types(self):
00190     """
00191     internal API method
00192     """
00193     return self._slot_types
00194 
00195   def serialize(self, buff):
00196     """
00197     serialize message into buffer
00198     :param buff: buffer, ``StringIO``
00199     """
00200     try:
00201       pass
00202     except struct.error as se: self._check_types(se)
00203     except TypeError as te: self._check_types(te)
00204 
00205   def deserialize(self, str):
00206     """
00207     unpack serialized message in str into this message instance
00208     :param str: byte array of serialized message, ``str``
00209     """
00210     try:
00211       end = 0
00212       return self
00213     except struct.error as e:
00214       raise genpy.DeserializationError(e) #most likely buffer underfill
00215 
00216 
00217   def serialize_numpy(self, buff, numpy):
00218     """
00219     serialize message with numpy array types into buffer
00220     :param buff: buffer, ``StringIO``
00221     :param numpy: numpy python module
00222     """
00223     try:
00224       pass
00225     except struct.error as se: self._check_types(se)
00226     except TypeError as te: self._check_types(te)
00227 
00228   def deserialize_numpy(self, str, numpy):
00229     """
00230     unpack serialized message in str into this message instance using numpy for array types
00231     :param str: byte array of serialized message, ``str``
00232     :param numpy: numpy python module
00233     """
00234     try:
00235       end = 0
00236       return self
00237     except struct.error as e:
00238       raise genpy.DeserializationError(e) #most likely buffer underfill
00239 
00240 _struct_I = genpy.struct_I
00241 class MultipleRequestFields(object):
00242   _type          = 'rosbridge_test/MultipleRequestFields'
00243   _md5sum = '6cce9fb727dd0f31d504d7d198a1f4ef'
00244   _request_class  = MultipleRequestFieldsRequest
00245   _response_class = MultipleRequestFieldsResponse


rosbridge_test
Author(s): Jonathan Mace
autogenerated on Thu Jan 2 2014 11:54:04