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