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