_PrologQuery.py
Go to the documentation of this file.
00001 """autogenerated by genpy from json_prolog_msgs/PrologQueryRequest.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 PrologQueryRequest(genpy.Message):
00009   _md5sum = "ae1d940ff32be0f4c9af16fc85baab7a"
00010   _type = "json_prolog_msgs/PrologQueryRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 
00016 
00017 
00018 
00019 byte ALL_SOLUTIONS=0
00020 byte INCREMENTAL=1
00021 
00022 byte mode
00023 string id
00024 string query
00025 
00026 """
00027   # Pseudo-constants
00028   ALL_SOLUTIONS = 0
00029   INCREMENTAL = 1
00030 
00031   __slots__ = ['mode','id','query']
00032   _slot_types = ['byte','string','string']
00033 
00034   def __init__(self, *args, **kwds):
00035     """
00036     Constructor. Any message fields that are implicitly/explicitly
00037     set to None will be assigned a default value. The recommend
00038     use is keyword arguments as this is more robust to future message
00039     changes.  You cannot mix in-order arguments and keyword arguments.
00040 
00041     The available fields are:
00042        mode,id,query
00043 
00044     :param args: complete set of field values, in .msg order
00045     :param kwds: use keyword arguments corresponding to message field names
00046     to set specific fields.
00047     """
00048     if args or kwds:
00049       super(PrologQueryRequest, self).__init__(*args, **kwds)
00050       #message fields cannot be None, assign default values for those that are
00051       if self.mode is None:
00052         self.mode = 0
00053       if self.id is None:
00054         self.id = ''
00055       if self.query is None:
00056         self.query = ''
00057     else:
00058       self.mode = 0
00059       self.id = ''
00060       self.query = ''
00061 
00062   def _get_types(self):
00063     """
00064     internal API method
00065     """
00066     return self._slot_types
00067 
00068   def serialize(self, buff):
00069     """
00070     serialize message into buffer
00071     :param buff: buffer, ``StringIO``
00072     """
00073     try:
00074       buff.write(_struct_b.pack(self.mode))
00075       _x = self.id
00076       length = len(_x)
00077       if python3 or type(_x) == unicode:
00078         _x = _x.encode('utf-8')
00079         length = len(_x)
00080       buff.write(struct.pack('<I%ss'%length, length, _x))
00081       _x = self.query
00082       length = len(_x)
00083       if python3 or type(_x) == unicode:
00084         _x = _x.encode('utf-8')
00085         length = len(_x)
00086       buff.write(struct.pack('<I%ss'%length, length, _x))
00087     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00088     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00089 
00090   def deserialize(self, str):
00091     """
00092     unpack serialized message in str into this message instance
00093     :param str: byte array of serialized message, ``str``
00094     """
00095     try:
00096       end = 0
00097       start = end
00098       end += 1
00099       (self.mode,) = _struct_b.unpack(str[start:end])
00100       start = end
00101       end += 4
00102       (length,) = _struct_I.unpack(str[start:end])
00103       start = end
00104       end += length
00105       if python3:
00106         self.id = str[start:end].decode('utf-8')
00107       else:
00108         self.id = str[start:end]
00109       start = end
00110       end += 4
00111       (length,) = _struct_I.unpack(str[start:end])
00112       start = end
00113       end += length
00114       if python3:
00115         self.query = str[start:end].decode('utf-8')
00116       else:
00117         self.query = str[start:end]
00118       return self
00119     except struct.error as e:
00120       raise genpy.DeserializationError(e) #most likely buffer underfill
00121 
00122 
00123   def serialize_numpy(self, buff, numpy):
00124     """
00125     serialize message with numpy array types into buffer
00126     :param buff: buffer, ``StringIO``
00127     :param numpy: numpy python module
00128     """
00129     try:
00130       buff.write(_struct_b.pack(self.mode))
00131       _x = self.id
00132       length = len(_x)
00133       if python3 or type(_x) == unicode:
00134         _x = _x.encode('utf-8')
00135         length = len(_x)
00136       buff.write(struct.pack('<I%ss'%length, length, _x))
00137       _x = self.query
00138       length = len(_x)
00139       if python3 or type(_x) == unicode:
00140         _x = _x.encode('utf-8')
00141         length = len(_x)
00142       buff.write(struct.pack('<I%ss'%length, length, _x))
00143     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00144     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00145 
00146   def deserialize_numpy(self, str, numpy):
00147     """
00148     unpack serialized message in str into this message instance using numpy for array types
00149     :param str: byte array of serialized message, ``str``
00150     :param numpy: numpy python module
00151     """
00152     try:
00153       end = 0
00154       start = end
00155       end += 1
00156       (self.mode,) = _struct_b.unpack(str[start:end])
00157       start = end
00158       end += 4
00159       (length,) = _struct_I.unpack(str[start:end])
00160       start = end
00161       end += length
00162       if python3:
00163         self.id = str[start:end].decode('utf-8')
00164       else:
00165         self.id = str[start:end]
00166       start = end
00167       end += 4
00168       (length,) = _struct_I.unpack(str[start:end])
00169       start = end
00170       end += length
00171       if python3:
00172         self.query = str[start:end].decode('utf-8')
00173       else:
00174         self.query = str[start:end]
00175       return self
00176     except struct.error as e:
00177       raise genpy.DeserializationError(e) #most likely buffer underfill
00178 
00179 _struct_I = genpy.struct_I
00180 _struct_b = struct.Struct("<b")
00181 """autogenerated by genpy from json_prolog_msgs/PrologQueryResponse.msg. Do not edit."""
00182 import sys
00183 python3 = True if sys.hexversion > 0x03000000 else False
00184 import genpy
00185 import struct
00186 
00187 
00188 class PrologQueryResponse(genpy.Message):
00189   _md5sum = "f6fcb3b1ed8c7743c7fb7d5bcca28513"
00190   _type = "json_prolog_msgs/PrologQueryResponse"
00191   _has_header = False #flag to mark the presence of a Header object
00192   _full_text = """bool ok
00193 string message
00194 
00195 
00196 """
00197   __slots__ = ['ok','message']
00198   _slot_types = ['bool','string']
00199 
00200   def __init__(self, *args, **kwds):
00201     """
00202     Constructor. Any message fields that are implicitly/explicitly
00203     set to None will be assigned a default value. The recommend
00204     use is keyword arguments as this is more robust to future message
00205     changes.  You cannot mix in-order arguments and keyword arguments.
00206 
00207     The available fields are:
00208        ok,message
00209 
00210     :param args: complete set of field values, in .msg order
00211     :param kwds: use keyword arguments corresponding to message field names
00212     to set specific fields.
00213     """
00214     if args or kwds:
00215       super(PrologQueryResponse, self).__init__(*args, **kwds)
00216       #message fields cannot be None, assign default values for those that are
00217       if self.ok is None:
00218         self.ok = False
00219       if self.message is None:
00220         self.message = ''
00221     else:
00222       self.ok = False
00223       self.message = ''
00224 
00225   def _get_types(self):
00226     """
00227     internal API method
00228     """
00229     return self._slot_types
00230 
00231   def serialize(self, buff):
00232     """
00233     serialize message into buffer
00234     :param buff: buffer, ``StringIO``
00235     """
00236     try:
00237       buff.write(_struct_B.pack(self.ok))
00238       _x = self.message
00239       length = len(_x)
00240       if python3 or type(_x) == unicode:
00241         _x = _x.encode('utf-8')
00242         length = len(_x)
00243       buff.write(struct.pack('<I%ss'%length, length, _x))
00244     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00245     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00246 
00247   def deserialize(self, str):
00248     """
00249     unpack serialized message in str into this message instance
00250     :param str: byte array of serialized message, ``str``
00251     """
00252     try:
00253       end = 0
00254       start = end
00255       end += 1
00256       (self.ok,) = _struct_B.unpack(str[start:end])
00257       self.ok = bool(self.ok)
00258       start = end
00259       end += 4
00260       (length,) = _struct_I.unpack(str[start:end])
00261       start = end
00262       end += length
00263       if python3:
00264         self.message = str[start:end].decode('utf-8')
00265       else:
00266         self.message = str[start:end]
00267       return self
00268     except struct.error as e:
00269       raise genpy.DeserializationError(e) #most likely buffer underfill
00270 
00271 
00272   def serialize_numpy(self, buff, numpy):
00273     """
00274     serialize message with numpy array types into buffer
00275     :param buff: buffer, ``StringIO``
00276     :param numpy: numpy python module
00277     """
00278     try:
00279       buff.write(_struct_B.pack(self.ok))
00280       _x = self.message
00281       length = len(_x)
00282       if python3 or type(_x) == unicode:
00283         _x = _x.encode('utf-8')
00284         length = len(_x)
00285       buff.write(struct.pack('<I%ss'%length, length, _x))
00286     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00287     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00288 
00289   def deserialize_numpy(self, str, numpy):
00290     """
00291     unpack serialized message in str into this message instance using numpy for array types
00292     :param str: byte array of serialized message, ``str``
00293     :param numpy: numpy python module
00294     """
00295     try:
00296       end = 0
00297       start = end
00298       end += 1
00299       (self.ok,) = _struct_B.unpack(str[start:end])
00300       self.ok = bool(self.ok)
00301       start = end
00302       end += 4
00303       (length,) = _struct_I.unpack(str[start:end])
00304       start = end
00305       end += length
00306       if python3:
00307         self.message = str[start:end].decode('utf-8')
00308       else:
00309         self.message = str[start:end]
00310       return self
00311     except struct.error as e:
00312       raise genpy.DeserializationError(e) #most likely buffer underfill
00313 
00314 _struct_I = genpy.struct_I
00315 _struct_B = struct.Struct("<B")
00316 class PrologQuery(object):
00317   _type          = 'json_prolog_msgs/PrologQuery'
00318   _md5sum = 'b98fb21a498cfd5b16c55f4b1f1cfa7d'
00319   _request_class  = PrologQueryRequest
00320   _response_class = PrologQueryResponse


json_prolog_msgs
Author(s): Georg Bartels
autogenerated on Mon Oct 6 2014 01:29:47