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