00001 """autogenerated by genmsg_py from InitiateQueryRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import warehouse.msg
00006
00007 class InitiateQueryRequest(roslib.message.Message):
00008 _md5sum = "a16d57a61179cc1956c03193340744da"
00009 _type = "warehouse/InitiateQueryRequest"
00010 _has_header = False
00011 _full_text = """
00012 string db_name
00013 string collection_name
00014
00015
00016 warehouse/Condition[] query
00017
00018 warehouse/OrderingCriterion order
00019
00020
00021
00022 bool metadata_only
00023
00024 ================================================================================
00025 MSG: warehouse/Condition
00026 # Represents an individual condition on a field in a query
00027
00028 # Field name, which can be nested. E.g., "pose.position.x"
00029 string field_name
00030
00031 # Predicate, which must be of one the types below
00032 uint8 predicate
00033
00034 # Predicate arguments, which are parsed from strings, in a predicate-dependent manner
00035 string[] args
00036
00037
00038 ## Predicate types
00039
00040 # numerical field must be less than args[0]
00041 uint8 LESS_THAN=0
00042
00043 # numerical field must be greater than args[0]
00044 uint8 GREATER_THAN=1
00045
00046 # field must equal args[0]
00047 uint8 EQUALS=2
00048 ================================================================================
00049 MSG: warehouse/OrderingCriterion
00050 # Represents an ordering criterion to use in a query result set
00051
00052 # Name of the (nested) field to order by, e.g., "position.x"
00053 # Can also be "_creation_time"
00054 string field
00055
00056 # If true, we'll use descending rather than ascending order
00057 bool reverse
00058 """
00059 __slots__ = ['db_name','collection_name','query','order','metadata_only']
00060 _slot_types = ['string','string','warehouse/Condition[]','warehouse/OrderingCriterion','bool']
00061
00062 def __init__(self, *args, **kwds):
00063 """
00064 Constructor. Any message fields that are implicitly/explicitly
00065 set to None will be assigned a default value. The recommend
00066 use is keyword arguments as this is more robust to future message
00067 changes. You cannot mix in-order arguments and keyword arguments.
00068
00069 The available fields are:
00070 db_name,collection_name,query,order,metadata_only
00071
00072 @param args: complete set of field values, in .msg order
00073 @param kwds: use keyword arguments corresponding to message field names
00074 to set specific fields.
00075 """
00076 if args or kwds:
00077 super(InitiateQueryRequest, self).__init__(*args, **kwds)
00078
00079 if self.db_name is None:
00080 self.db_name = ''
00081 if self.collection_name is None:
00082 self.collection_name = ''
00083 if self.query is None:
00084 self.query = []
00085 if self.order is None:
00086 self.order = warehouse.msg.OrderingCriterion()
00087 if self.metadata_only is None:
00088 self.metadata_only = False
00089 else:
00090 self.db_name = ''
00091 self.collection_name = ''
00092 self.query = []
00093 self.order = warehouse.msg.OrderingCriterion()
00094 self.metadata_only = False
00095
00096 def _get_types(self):
00097 """
00098 internal API method
00099 """
00100 return self._slot_types
00101
00102 def serialize(self, buff):
00103 """
00104 serialize message into buffer
00105 @param buff: buffer
00106 @type buff: StringIO
00107 """
00108 try:
00109 _x = self.db_name
00110 length = len(_x)
00111 buff.write(struct.pack('<I%ss'%length, length, _x))
00112 _x = self.collection_name
00113 length = len(_x)
00114 buff.write(struct.pack('<I%ss'%length, length, _x))
00115 length = len(self.query)
00116 buff.write(_struct_I.pack(length))
00117 for val1 in self.query:
00118 _x = val1.field_name
00119 length = len(_x)
00120 buff.write(struct.pack('<I%ss'%length, length, _x))
00121 buff.write(_struct_B.pack(val1.predicate))
00122 length = len(val1.args)
00123 buff.write(_struct_I.pack(length))
00124 for val2 in val1.args:
00125 length = len(val2)
00126 buff.write(struct.pack('<I%ss'%length, length, val2))
00127 _x = self.order.field
00128 length = len(_x)
00129 buff.write(struct.pack('<I%ss'%length, length, _x))
00130 _x = self
00131 buff.write(_struct_2B.pack(_x.order.reverse, _x.metadata_only))
00132 except struct.error, se: self._check_types(se)
00133 except TypeError, te: self._check_types(te)
00134
00135 def deserialize(self, str):
00136 """
00137 unpack serialized message in str into this message instance
00138 @param str: byte array of serialized message
00139 @type str: str
00140 """
00141 try:
00142 if self.order is None:
00143 self.order = warehouse.msg.OrderingCriterion()
00144 end = 0
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 start = end
00149 end += length
00150 self.db_name = str[start:end]
00151 start = end
00152 end += 4
00153 (length,) = _struct_I.unpack(str[start:end])
00154 start = end
00155 end += length
00156 self.collection_name = str[start:end]
00157 start = end
00158 end += 4
00159 (length,) = _struct_I.unpack(str[start:end])
00160 self.query = []
00161 for i in xrange(0, length):
00162 val1 = warehouse.msg.Condition()
00163 start = end
00164 end += 4
00165 (length,) = _struct_I.unpack(str[start:end])
00166 start = end
00167 end += length
00168 val1.field_name = str[start:end]
00169 start = end
00170 end += 1
00171 (val1.predicate,) = _struct_B.unpack(str[start:end])
00172 start = end
00173 end += 4
00174 (length,) = _struct_I.unpack(str[start:end])
00175 val1.args = []
00176 for i in xrange(0, length):
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 start = end
00181 end += length
00182 val2 = str[start:end]
00183 val1.args.append(val2)
00184 self.query.append(val1)
00185 start = end
00186 end += 4
00187 (length,) = _struct_I.unpack(str[start:end])
00188 start = end
00189 end += length
00190 self.order.field = str[start:end]
00191 _x = self
00192 start = end
00193 end += 2
00194 (_x.order.reverse, _x.metadata_only,) = _struct_2B.unpack(str[start:end])
00195 self.order.reverse = bool(self.order.reverse)
00196 self.metadata_only = bool(self.metadata_only)
00197 return self
00198 except struct.error, e:
00199 raise roslib.message.DeserializationError(e)
00200
00201
00202 def serialize_numpy(self, buff, numpy):
00203 """
00204 serialize message with numpy array types into buffer
00205 @param buff: buffer
00206 @type buff: StringIO
00207 @param numpy: numpy python module
00208 @type numpy module
00209 """
00210 try:
00211 _x = self.db_name
00212 length = len(_x)
00213 buff.write(struct.pack('<I%ss'%length, length, _x))
00214 _x = self.collection_name
00215 length = len(_x)
00216 buff.write(struct.pack('<I%ss'%length, length, _x))
00217 length = len(self.query)
00218 buff.write(_struct_I.pack(length))
00219 for val1 in self.query:
00220 _x = val1.field_name
00221 length = len(_x)
00222 buff.write(struct.pack('<I%ss'%length, length, _x))
00223 buff.write(_struct_B.pack(val1.predicate))
00224 length = len(val1.args)
00225 buff.write(_struct_I.pack(length))
00226 for val2 in val1.args:
00227 length = len(val2)
00228 buff.write(struct.pack('<I%ss'%length, length, val2))
00229 _x = self.order.field
00230 length = len(_x)
00231 buff.write(struct.pack('<I%ss'%length, length, _x))
00232 _x = self
00233 buff.write(_struct_2B.pack(_x.order.reverse, _x.metadata_only))
00234 except struct.error, se: self._check_types(se)
00235 except TypeError, te: self._check_types(te)
00236
00237 def deserialize_numpy(self, str, numpy):
00238 """
00239 unpack serialized message in str into this message instance using numpy for array types
00240 @param str: byte array of serialized message
00241 @type str: str
00242 @param numpy: numpy python module
00243 @type numpy: module
00244 """
00245 try:
00246 if self.order is None:
00247 self.order = warehouse.msg.OrderingCriterion()
00248 end = 0
00249 start = end
00250 end += 4
00251 (length,) = _struct_I.unpack(str[start:end])
00252 start = end
00253 end += length
00254 self.db_name = str[start:end]
00255 start = end
00256 end += 4
00257 (length,) = _struct_I.unpack(str[start:end])
00258 start = end
00259 end += length
00260 self.collection_name = str[start:end]
00261 start = end
00262 end += 4
00263 (length,) = _struct_I.unpack(str[start:end])
00264 self.query = []
00265 for i in xrange(0, length):
00266 val1 = warehouse.msg.Condition()
00267 start = end
00268 end += 4
00269 (length,) = _struct_I.unpack(str[start:end])
00270 start = end
00271 end += length
00272 val1.field_name = str[start:end]
00273 start = end
00274 end += 1
00275 (val1.predicate,) = _struct_B.unpack(str[start:end])
00276 start = end
00277 end += 4
00278 (length,) = _struct_I.unpack(str[start:end])
00279 val1.args = []
00280 for i in xrange(0, length):
00281 start = end
00282 end += 4
00283 (length,) = _struct_I.unpack(str[start:end])
00284 start = end
00285 end += length
00286 val2 = str[start:end]
00287 val1.args.append(val2)
00288 self.query.append(val1)
00289 start = end
00290 end += 4
00291 (length,) = _struct_I.unpack(str[start:end])
00292 start = end
00293 end += length
00294 self.order.field = str[start:end]
00295 _x = self
00296 start = end
00297 end += 2
00298 (_x.order.reverse, _x.metadata_only,) = _struct_2B.unpack(str[start:end])
00299 self.order.reverse = bool(self.order.reverse)
00300 self.metadata_only = bool(self.metadata_only)
00301 return self
00302 except struct.error, e:
00303 raise roslib.message.DeserializationError(e)
00304
00305 _struct_I = roslib.message.struct_I
00306 _struct_B = struct.Struct("<B")
00307 _struct_2B = struct.Struct("<2B")
00308 """autogenerated by genmsg_py from InitiateQueryResponse.msg. Do not edit."""
00309 import roslib.message
00310 import struct
00311
00312
00313 class InitiateQueryResponse(roslib.message.Message):
00314 _md5sum = "2445fbb91e099a39ade02d30b6062bd8"
00315 _type = "warehouse/InitiateQueryResponse"
00316 _has_header = False
00317 _full_text = """
00318 string query_id
00319
00320
00321
00322
00323 """
00324 __slots__ = ['query_id']
00325 _slot_types = ['string']
00326
00327 def __init__(self, *args, **kwds):
00328 """
00329 Constructor. Any message fields that are implicitly/explicitly
00330 set to None will be assigned a default value. The recommend
00331 use is keyword arguments as this is more robust to future message
00332 changes. You cannot mix in-order arguments and keyword arguments.
00333
00334 The available fields are:
00335 query_id
00336
00337 @param args: complete set of field values, in .msg order
00338 @param kwds: use keyword arguments corresponding to message field names
00339 to set specific fields.
00340 """
00341 if args or kwds:
00342 super(InitiateQueryResponse, self).__init__(*args, **kwds)
00343
00344 if self.query_id is None:
00345 self.query_id = ''
00346 else:
00347 self.query_id = ''
00348
00349 def _get_types(self):
00350 """
00351 internal API method
00352 """
00353 return self._slot_types
00354
00355 def serialize(self, buff):
00356 """
00357 serialize message into buffer
00358 @param buff: buffer
00359 @type buff: StringIO
00360 """
00361 try:
00362 _x = self.query_id
00363 length = len(_x)
00364 buff.write(struct.pack('<I%ss'%length, length, _x))
00365 except struct.error, se: self._check_types(se)
00366 except TypeError, te: self._check_types(te)
00367
00368 def deserialize(self, str):
00369 """
00370 unpack serialized message in str into this message instance
00371 @param str: byte array of serialized message
00372 @type str: str
00373 """
00374 try:
00375 end = 0
00376 start = end
00377 end += 4
00378 (length,) = _struct_I.unpack(str[start:end])
00379 start = end
00380 end += length
00381 self.query_id = str[start:end]
00382 return self
00383 except struct.error, e:
00384 raise roslib.message.DeserializationError(e)
00385
00386
00387 def serialize_numpy(self, buff, numpy):
00388 """
00389 serialize message with numpy array types into buffer
00390 @param buff: buffer
00391 @type buff: StringIO
00392 @param numpy: numpy python module
00393 @type numpy module
00394 """
00395 try:
00396 _x = self.query_id
00397 length = len(_x)
00398 buff.write(struct.pack('<I%ss'%length, length, _x))
00399 except struct.error, se: self._check_types(se)
00400 except TypeError, te: self._check_types(te)
00401
00402 def deserialize_numpy(self, str, numpy):
00403 """
00404 unpack serialized message in str into this message instance using numpy for array types
00405 @param str: byte array of serialized message
00406 @type str: str
00407 @param numpy: numpy python module
00408 @type numpy: module
00409 """
00410 try:
00411 end = 0
00412 start = end
00413 end += 4
00414 (length,) = _struct_I.unpack(str[start:end])
00415 start = end
00416 end += length
00417 self.query_id = str[start:end]
00418 return self
00419 except struct.error, e:
00420 raise roslib.message.DeserializationError(e)
00421
00422 _struct_I = roslib.message.struct_I
00423 class InitiateQuery(roslib.message.ServiceDefinition):
00424 _type = 'warehouse/InitiateQuery'
00425 _md5sum = '8bd9a1214f9512d68a0e5a3e2876a83b'
00426 _request_class = InitiateQueryRequest
00427 _response_class = InitiateQueryResponse