00001 """autogenerated by genmsg_py from SetupCollectionRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class SetupCollectionRequest(roslib.message.Message):
00007 _md5sum = "951edafce54d5ca98a323aa86f5cd6e8"
00008 _type = "warehouse/SetupCollectionRequest"
00009 _has_header = False
00010 _full_text = """string db_name
00011 string collection_name
00012
00013 string msg_pkg
00014 string msg_type
00015
00016
00017
00018 string[] additional_metadata_fields
00019
00020
00021
00022 string[] indexed_fields
00023
00024
00025
00026
00027 string topic
00028
00029
00030 """
00031 __slots__ = ['db_name','collection_name','msg_pkg','msg_type','additional_metadata_fields','indexed_fields','topic']
00032 _slot_types = ['string','string','string','string','string[]','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 db_name,collection_name,msg_pkg,msg_type,additional_metadata_fields,indexed_fields,topic
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(SetupCollectionRequest, self).__init__(*args, **kwds)
00050
00051 if self.db_name is None:
00052 self.db_name = ''
00053 if self.collection_name is None:
00054 self.collection_name = ''
00055 if self.msg_pkg is None:
00056 self.msg_pkg = ''
00057 if self.msg_type is None:
00058 self.msg_type = ''
00059 if self.additional_metadata_fields is None:
00060 self.additional_metadata_fields = []
00061 if self.indexed_fields is None:
00062 self.indexed_fields = []
00063 if self.topic is None:
00064 self.topic = ''
00065 else:
00066 self.db_name = ''
00067 self.collection_name = ''
00068 self.msg_pkg = ''
00069 self.msg_type = ''
00070 self.additional_metadata_fields = []
00071 self.indexed_fields = []
00072 self.topic = ''
00073
00074 def _get_types(self):
00075 """
00076 internal API method
00077 """
00078 return self._slot_types
00079
00080 def serialize(self, buff):
00081 """
00082 serialize message into buffer
00083 @param buff: buffer
00084 @type buff: StringIO
00085 """
00086 try:
00087 _x = self.db_name
00088 length = len(_x)
00089 buff.write(struct.pack('<I%ss'%length, length, _x))
00090 _x = self.collection_name
00091 length = len(_x)
00092 buff.write(struct.pack('<I%ss'%length, length, _x))
00093 _x = self.msg_pkg
00094 length = len(_x)
00095 buff.write(struct.pack('<I%ss'%length, length, _x))
00096 _x = self.msg_type
00097 length = len(_x)
00098 buff.write(struct.pack('<I%ss'%length, length, _x))
00099 length = len(self.additional_metadata_fields)
00100 buff.write(_struct_I.pack(length))
00101 for val1 in self.additional_metadata_fields:
00102 length = len(val1)
00103 buff.write(struct.pack('<I%ss'%length, length, val1))
00104 length = len(self.indexed_fields)
00105 buff.write(_struct_I.pack(length))
00106 for val1 in self.indexed_fields:
00107 length = len(val1)
00108 buff.write(struct.pack('<I%ss'%length, length, val1))
00109 _x = self.topic
00110 length = len(_x)
00111 buff.write(struct.pack('<I%ss'%length, length, _x))
00112 except struct.error, se: self._check_types(se)
00113 except TypeError, te: self._check_types(te)
00114
00115 def deserialize(self, str):
00116 """
00117 unpack serialized message in str into this message instance
00118 @param str: byte array of serialized message
00119 @type str: str
00120 """
00121 try:
00122 end = 0
00123 start = end
00124 end += 4
00125 (length,) = _struct_I.unpack(str[start:end])
00126 start = end
00127 end += length
00128 self.db_name = str[start:end]
00129 start = end
00130 end += 4
00131 (length,) = _struct_I.unpack(str[start:end])
00132 start = end
00133 end += length
00134 self.collection_name = str[start:end]
00135 start = end
00136 end += 4
00137 (length,) = _struct_I.unpack(str[start:end])
00138 start = end
00139 end += length
00140 self.msg_pkg = str[start:end]
00141 start = end
00142 end += 4
00143 (length,) = _struct_I.unpack(str[start:end])
00144 start = end
00145 end += length
00146 self.msg_type = str[start:end]
00147 start = end
00148 end += 4
00149 (length,) = _struct_I.unpack(str[start:end])
00150 self.additional_metadata_fields = []
00151 for i in xrange(0, length):
00152 start = end
00153 end += 4
00154 (length,) = _struct_I.unpack(str[start:end])
00155 start = end
00156 end += length
00157 val1 = str[start:end]
00158 self.additional_metadata_fields.append(val1)
00159 start = end
00160 end += 4
00161 (length,) = _struct_I.unpack(str[start:end])
00162 self.indexed_fields = []
00163 for i in xrange(0, length):
00164 start = end
00165 end += 4
00166 (length,) = _struct_I.unpack(str[start:end])
00167 start = end
00168 end += length
00169 val1 = str[start:end]
00170 self.indexed_fields.append(val1)
00171 start = end
00172 end += 4
00173 (length,) = _struct_I.unpack(str[start:end])
00174 start = end
00175 end += length
00176 self.topic = str[start:end]
00177 return self
00178 except struct.error, e:
00179 raise roslib.message.DeserializationError(e)
00180
00181
00182 def serialize_numpy(self, buff, numpy):
00183 """
00184 serialize message with numpy array types into buffer
00185 @param buff: buffer
00186 @type buff: StringIO
00187 @param numpy: numpy python module
00188 @type numpy module
00189 """
00190 try:
00191 _x = self.db_name
00192 length = len(_x)
00193 buff.write(struct.pack('<I%ss'%length, length, _x))
00194 _x = self.collection_name
00195 length = len(_x)
00196 buff.write(struct.pack('<I%ss'%length, length, _x))
00197 _x = self.msg_pkg
00198 length = len(_x)
00199 buff.write(struct.pack('<I%ss'%length, length, _x))
00200 _x = self.msg_type
00201 length = len(_x)
00202 buff.write(struct.pack('<I%ss'%length, length, _x))
00203 length = len(self.additional_metadata_fields)
00204 buff.write(_struct_I.pack(length))
00205 for val1 in self.additional_metadata_fields:
00206 length = len(val1)
00207 buff.write(struct.pack('<I%ss'%length, length, val1))
00208 length = len(self.indexed_fields)
00209 buff.write(_struct_I.pack(length))
00210 for val1 in self.indexed_fields:
00211 length = len(val1)
00212 buff.write(struct.pack('<I%ss'%length, length, val1))
00213 _x = self.topic
00214 length = len(_x)
00215 buff.write(struct.pack('<I%ss'%length, length, _x))
00216 except struct.error, se: self._check_types(se)
00217 except TypeError, te: self._check_types(te)
00218
00219 def deserialize_numpy(self, str, numpy):
00220 """
00221 unpack serialized message in str into this message instance using numpy for array types
00222 @param str: byte array of serialized message
00223 @type str: str
00224 @param numpy: numpy python module
00225 @type numpy: module
00226 """
00227 try:
00228 end = 0
00229 start = end
00230 end += 4
00231 (length,) = _struct_I.unpack(str[start:end])
00232 start = end
00233 end += length
00234 self.db_name = str[start:end]
00235 start = end
00236 end += 4
00237 (length,) = _struct_I.unpack(str[start:end])
00238 start = end
00239 end += length
00240 self.collection_name = str[start:end]
00241 start = end
00242 end += 4
00243 (length,) = _struct_I.unpack(str[start:end])
00244 start = end
00245 end += length
00246 self.msg_pkg = str[start:end]
00247 start = end
00248 end += 4
00249 (length,) = _struct_I.unpack(str[start:end])
00250 start = end
00251 end += length
00252 self.msg_type = str[start:end]
00253 start = end
00254 end += 4
00255 (length,) = _struct_I.unpack(str[start:end])
00256 self.additional_metadata_fields = []
00257 for i in xrange(0, length):
00258 start = end
00259 end += 4
00260 (length,) = _struct_I.unpack(str[start:end])
00261 start = end
00262 end += length
00263 val1 = str[start:end]
00264 self.additional_metadata_fields.append(val1)
00265 start = end
00266 end += 4
00267 (length,) = _struct_I.unpack(str[start:end])
00268 self.indexed_fields = []
00269 for i in xrange(0, length):
00270 start = end
00271 end += 4
00272 (length,) = _struct_I.unpack(str[start:end])
00273 start = end
00274 end += length
00275 val1 = str[start:end]
00276 self.indexed_fields.append(val1)
00277 start = end
00278 end += 4
00279 (length,) = _struct_I.unpack(str[start:end])
00280 start = end
00281 end += length
00282 self.topic = str[start:end]
00283 return self
00284 except struct.error, e:
00285 raise roslib.message.DeserializationError(e)
00286
00287 _struct_I = roslib.message.struct_I
00288 """autogenerated by genmsg_py from SetupCollectionResponse.msg. Do not edit."""
00289 import roslib.message
00290 import struct
00291
00292
00293 class SetupCollectionResponse(roslib.message.Message):
00294 _md5sum = "60987d4183548cf4020578d7f6366bb4"
00295 _type = "warehouse/SetupCollectionResponse"
00296 _has_header = False
00297 _full_text = """int8 error_code
00298 string error_msg
00299
00300
00301 string topic
00302
00303
00304 bool db_created
00305
00306
00307 bool collection_created
00308
00309
00310 int8 SUCCESS=0
00311 int8 PACKAGE_NOT_FOUND=1
00312 int8 MESSAGE_NOT_FOUND_IN_PACKAGE=2
00313 int8 EXISTING_COLLECTION_MISMATCH=3
00314 int8 INVALID_INDEXED_FIELD=4
00315 int8 ILLEGAL_DB_NAME=5
00316 int8 ILLEGAL_COLLECTION_NAME=6
00317 int8 ILLEGAL_TOPIC_NAME=7
00318
00319 """
00320
00321 SUCCESS = 0
00322 PACKAGE_NOT_FOUND = 1
00323 MESSAGE_NOT_FOUND_IN_PACKAGE = 2
00324 EXISTING_COLLECTION_MISMATCH = 3
00325 INVALID_INDEXED_FIELD = 4
00326 ILLEGAL_DB_NAME = 5
00327 ILLEGAL_COLLECTION_NAME = 6
00328 ILLEGAL_TOPIC_NAME = 7
00329
00330 __slots__ = ['error_code','error_msg','topic','db_created','collection_created']
00331 _slot_types = ['int8','string','string','bool','bool']
00332
00333 def __init__(self, *args, **kwds):
00334 """
00335 Constructor. Any message fields that are implicitly/explicitly
00336 set to None will be assigned a default value. The recommend
00337 use is keyword arguments as this is more robust to future message
00338 changes. You cannot mix in-order arguments and keyword arguments.
00339
00340 The available fields are:
00341 error_code,error_msg,topic,db_created,collection_created
00342
00343 @param args: complete set of field values, in .msg order
00344 @param kwds: use keyword arguments corresponding to message field names
00345 to set specific fields.
00346 """
00347 if args or kwds:
00348 super(SetupCollectionResponse, self).__init__(*args, **kwds)
00349
00350 if self.error_code is None:
00351 self.error_code = 0
00352 if self.error_msg is None:
00353 self.error_msg = ''
00354 if self.topic is None:
00355 self.topic = ''
00356 if self.db_created is None:
00357 self.db_created = False
00358 if self.collection_created is None:
00359 self.collection_created = False
00360 else:
00361 self.error_code = 0
00362 self.error_msg = ''
00363 self.topic = ''
00364 self.db_created = False
00365 self.collection_created = False
00366
00367 def _get_types(self):
00368 """
00369 internal API method
00370 """
00371 return self._slot_types
00372
00373 def serialize(self, buff):
00374 """
00375 serialize message into buffer
00376 @param buff: buffer
00377 @type buff: StringIO
00378 """
00379 try:
00380 buff.write(_struct_b.pack(self.error_code))
00381 _x = self.error_msg
00382 length = len(_x)
00383 buff.write(struct.pack('<I%ss'%length, length, _x))
00384 _x = self.topic
00385 length = len(_x)
00386 buff.write(struct.pack('<I%ss'%length, length, _x))
00387 _x = self
00388 buff.write(_struct_2B.pack(_x.db_created, _x.collection_created))
00389 except struct.error, se: self._check_types(se)
00390 except TypeError, te: self._check_types(te)
00391
00392 def deserialize(self, str):
00393 """
00394 unpack serialized message in str into this message instance
00395 @param str: byte array of serialized message
00396 @type str: str
00397 """
00398 try:
00399 end = 0
00400 start = end
00401 end += 1
00402 (self.error_code,) = _struct_b.unpack(str[start:end])
00403 start = end
00404 end += 4
00405 (length,) = _struct_I.unpack(str[start:end])
00406 start = end
00407 end += length
00408 self.error_msg = str[start:end]
00409 start = end
00410 end += 4
00411 (length,) = _struct_I.unpack(str[start:end])
00412 start = end
00413 end += length
00414 self.topic = str[start:end]
00415 _x = self
00416 start = end
00417 end += 2
00418 (_x.db_created, _x.collection_created,) = _struct_2B.unpack(str[start:end])
00419 self.db_created = bool(self.db_created)
00420 self.collection_created = bool(self.collection_created)
00421 return self
00422 except struct.error, e:
00423 raise roslib.message.DeserializationError(e)
00424
00425
00426 def serialize_numpy(self, buff, numpy):
00427 """
00428 serialize message with numpy array types into buffer
00429 @param buff: buffer
00430 @type buff: StringIO
00431 @param numpy: numpy python module
00432 @type numpy module
00433 """
00434 try:
00435 buff.write(_struct_b.pack(self.error_code))
00436 _x = self.error_msg
00437 length = len(_x)
00438 buff.write(struct.pack('<I%ss'%length, length, _x))
00439 _x = self.topic
00440 length = len(_x)
00441 buff.write(struct.pack('<I%ss'%length, length, _x))
00442 _x = self
00443 buff.write(_struct_2B.pack(_x.db_created, _x.collection_created))
00444 except struct.error, se: self._check_types(se)
00445 except TypeError, te: self._check_types(te)
00446
00447 def deserialize_numpy(self, str, numpy):
00448 """
00449 unpack serialized message in str into this message instance using numpy for array types
00450 @param str: byte array of serialized message
00451 @type str: str
00452 @param numpy: numpy python module
00453 @type numpy: module
00454 """
00455 try:
00456 end = 0
00457 start = end
00458 end += 1
00459 (self.error_code,) = _struct_b.unpack(str[start:end])
00460 start = end
00461 end += 4
00462 (length,) = _struct_I.unpack(str[start:end])
00463 start = end
00464 end += length
00465 self.error_msg = str[start:end]
00466 start = end
00467 end += 4
00468 (length,) = _struct_I.unpack(str[start:end])
00469 start = end
00470 end += length
00471 self.topic = str[start:end]
00472 _x = self
00473 start = end
00474 end += 2
00475 (_x.db_created, _x.collection_created,) = _struct_2B.unpack(str[start:end])
00476 self.db_created = bool(self.db_created)
00477 self.collection_created = bool(self.collection_created)
00478 return self
00479 except struct.error, e:
00480 raise roslib.message.DeserializationError(e)
00481
00482 _struct_I = roslib.message.struct_I
00483 _struct_b = struct.Struct("<b")
00484 _struct_2B = struct.Struct("<2B")
00485 class SetupCollection(roslib.message.ServiceDefinition):
00486 _type = 'warehouse/SetupCollection'
00487 _md5sum = 'a8b88948c712c7460f4fad513bb5fc30'
00488 _request_class = SetupCollectionRequest
00489 _response_class = SetupCollectionResponse