_InsertInstance.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_knowledge/InsertInstanceRequest.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 InsertInstanceRequest(genpy.Message):
00009   _md5sum = "fb3b3eadea47ef754aac7e89289364e9"
00010   _type = "srs_knowledge/InsertInstanceRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 string objectName
00014 string objectClass
00015 
00016 string houseHoldId
00017 
00018 
00019 string classURI
00020 string objectURI
00021 
00022 
00023 """
00024   __slots__ = ['objectName','objectClass','houseHoldId','classURI','objectURI']
00025   _slot_types = ['string','string','string','string','string']
00026 
00027   def __init__(self, *args, **kwds):
00028     """
00029     Constructor. Any message fields that are implicitly/explicitly
00030     set to None will be assigned a default value. The recommend
00031     use is keyword arguments as this is more robust to future message
00032     changes.  You cannot mix in-order arguments and keyword arguments.
00033 
00034     The available fields are:
00035        objectName,objectClass,houseHoldId,classURI,objectURI
00036 
00037     :param args: complete set of field values, in .msg order
00038     :param kwds: use keyword arguments corresponding to message field names
00039     to set specific fields.
00040     """
00041     if args or kwds:
00042       super(InsertInstanceRequest, self).__init__(*args, **kwds)
00043       #message fields cannot be None, assign default values for those that are
00044       if self.objectName is None:
00045         self.objectName = ''
00046       if self.objectClass is None:
00047         self.objectClass = ''
00048       if self.houseHoldId is None:
00049         self.houseHoldId = ''
00050       if self.classURI is None:
00051         self.classURI = ''
00052       if self.objectURI is None:
00053         self.objectURI = ''
00054     else:
00055       self.objectName = ''
00056       self.objectClass = ''
00057       self.houseHoldId = ''
00058       self.classURI = ''
00059       self.objectURI = ''
00060 
00061   def _get_types(self):
00062     """
00063     internal API method
00064     """
00065     return self._slot_types
00066 
00067   def serialize(self, buff):
00068     """
00069     serialize message into buffer
00070     :param buff: buffer, ``StringIO``
00071     """
00072     try:
00073       _x = self.objectName
00074       length = len(_x)
00075       if python3 or type(_x) == unicode:
00076         _x = _x.encode('utf-8')
00077         length = len(_x)
00078       buff.write(struct.pack('<I%ss'%length, length, _x))
00079       _x = self.objectClass
00080       length = len(_x)
00081       if python3 or type(_x) == unicode:
00082         _x = _x.encode('utf-8')
00083         length = len(_x)
00084       buff.write(struct.pack('<I%ss'%length, length, _x))
00085       _x = self.houseHoldId
00086       length = len(_x)
00087       if python3 or type(_x) == unicode:
00088         _x = _x.encode('utf-8')
00089         length = len(_x)
00090       buff.write(struct.pack('<I%ss'%length, length, _x))
00091       _x = self.classURI
00092       length = len(_x)
00093       if python3 or type(_x) == unicode:
00094         _x = _x.encode('utf-8')
00095         length = len(_x)
00096       buff.write(struct.pack('<I%ss'%length, length, _x))
00097       _x = self.objectURI
00098       length = len(_x)
00099       if python3 or type(_x) == unicode:
00100         _x = _x.encode('utf-8')
00101         length = len(_x)
00102       buff.write(struct.pack('<I%ss'%length, length, _x))
00103     except struct.error as se: self._check_types(se)
00104     except TypeError as te: self._check_types(te)
00105 
00106   def deserialize(self, str):
00107     """
00108     unpack serialized message in str into this message instance
00109     :param str: byte array of serialized message, ``str``
00110     """
00111     try:
00112       end = 0
00113       start = end
00114       end += 4
00115       (length,) = _struct_I.unpack(str[start:end])
00116       start = end
00117       end += length
00118       if python3:
00119         self.objectName = str[start:end].decode('utf-8')
00120       else:
00121         self.objectName = str[start:end]
00122       start = end
00123       end += 4
00124       (length,) = _struct_I.unpack(str[start:end])
00125       start = end
00126       end += length
00127       if python3:
00128         self.objectClass = str[start:end].decode('utf-8')
00129       else:
00130         self.objectClass = str[start:end]
00131       start = end
00132       end += 4
00133       (length,) = _struct_I.unpack(str[start:end])
00134       start = end
00135       end += length
00136       if python3:
00137         self.houseHoldId = str[start:end].decode('utf-8')
00138       else:
00139         self.houseHoldId = str[start:end]
00140       start = end
00141       end += 4
00142       (length,) = _struct_I.unpack(str[start:end])
00143       start = end
00144       end += length
00145       if python3:
00146         self.classURI = str[start:end].decode('utf-8')
00147       else:
00148         self.classURI = str[start:end]
00149       start = end
00150       end += 4
00151       (length,) = _struct_I.unpack(str[start:end])
00152       start = end
00153       end += length
00154       if python3:
00155         self.objectURI = str[start:end].decode('utf-8')
00156       else:
00157         self.objectURI = str[start:end]
00158       return self
00159     except struct.error as e:
00160       raise genpy.DeserializationError(e) #most likely buffer underfill
00161 
00162 
00163   def serialize_numpy(self, buff, numpy):
00164     """
00165     serialize message with numpy array types into buffer
00166     :param buff: buffer, ``StringIO``
00167     :param numpy: numpy python module
00168     """
00169     try:
00170       _x = self.objectName
00171       length = len(_x)
00172       if python3 or type(_x) == unicode:
00173         _x = _x.encode('utf-8')
00174         length = len(_x)
00175       buff.write(struct.pack('<I%ss'%length, length, _x))
00176       _x = self.objectClass
00177       length = len(_x)
00178       if python3 or type(_x) == unicode:
00179         _x = _x.encode('utf-8')
00180         length = len(_x)
00181       buff.write(struct.pack('<I%ss'%length, length, _x))
00182       _x = self.houseHoldId
00183       length = len(_x)
00184       if python3 or type(_x) == unicode:
00185         _x = _x.encode('utf-8')
00186         length = len(_x)
00187       buff.write(struct.pack('<I%ss'%length, length, _x))
00188       _x = self.classURI
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       _x = self.objectURI
00195       length = len(_x)
00196       if python3 or type(_x) == unicode:
00197         _x = _x.encode('utf-8')
00198         length = len(_x)
00199       buff.write(struct.pack('<I%ss'%length, length, _x))
00200     except struct.error as se: self._check_types(se)
00201     except TypeError as te: self._check_types(te)
00202 
00203   def deserialize_numpy(self, str, numpy):
00204     """
00205     unpack serialized message in str into this message instance using numpy for array types
00206     :param str: byte array of serialized message, ``str``
00207     :param numpy: numpy python module
00208     """
00209     try:
00210       end = 0
00211       start = end
00212       end += 4
00213       (length,) = _struct_I.unpack(str[start:end])
00214       start = end
00215       end += length
00216       if python3:
00217         self.objectName = str[start:end].decode('utf-8')
00218       else:
00219         self.objectName = str[start:end]
00220       start = end
00221       end += 4
00222       (length,) = _struct_I.unpack(str[start:end])
00223       start = end
00224       end += length
00225       if python3:
00226         self.objectClass = str[start:end].decode('utf-8')
00227       else:
00228         self.objectClass = str[start:end]
00229       start = end
00230       end += 4
00231       (length,) = _struct_I.unpack(str[start:end])
00232       start = end
00233       end += length
00234       if python3:
00235         self.houseHoldId = str[start:end].decode('utf-8')
00236       else:
00237         self.houseHoldId = str[start:end]
00238       start = end
00239       end += 4
00240       (length,) = _struct_I.unpack(str[start:end])
00241       start = end
00242       end += length
00243       if python3:
00244         self.classURI = str[start:end].decode('utf-8')
00245       else:
00246         self.classURI = str[start:end]
00247       start = end
00248       end += 4
00249       (length,) = _struct_I.unpack(str[start:end])
00250       start = end
00251       end += length
00252       if python3:
00253         self.objectURI = str[start:end].decode('utf-8')
00254       else:
00255         self.objectURI = str[start:end]
00256       return self
00257     except struct.error as e:
00258       raise genpy.DeserializationError(e) #most likely buffer underfill
00259 
00260 _struct_I = genpy.struct_I
00261 """autogenerated by genpy from srs_knowledge/InsertInstanceResponse.msg. Do not edit."""
00262 import sys
00263 python3 = True if sys.hexversion > 0x03000000 else False
00264 import genpy
00265 import struct
00266 
00267 
00268 class InsertInstanceResponse(genpy.Message):
00269   _md5sum = "86791dcf1de997ec7de5a0de7e4dcfcc"
00270   _type = "srs_knowledge/InsertInstanceResponse"
00271   _has_header = False #flag to mark the presence of a Header object
00272   _full_text = """
00273 
00274 
00275 
00276 
00277 int32 status
00278 
00279 """
00280   __slots__ = ['status']
00281   _slot_types = ['int32']
00282 
00283   def __init__(self, *args, **kwds):
00284     """
00285     Constructor. Any message fields that are implicitly/explicitly
00286     set to None will be assigned a default value. The recommend
00287     use is keyword arguments as this is more robust to future message
00288     changes.  You cannot mix in-order arguments and keyword arguments.
00289 
00290     The available fields are:
00291        status
00292 
00293     :param args: complete set of field values, in .msg order
00294     :param kwds: use keyword arguments corresponding to message field names
00295     to set specific fields.
00296     """
00297     if args or kwds:
00298       super(InsertInstanceResponse, self).__init__(*args, **kwds)
00299       #message fields cannot be None, assign default values for those that are
00300       if self.status is None:
00301         self.status = 0
00302     else:
00303       self.status = 0
00304 
00305   def _get_types(self):
00306     """
00307     internal API method
00308     """
00309     return self._slot_types
00310 
00311   def serialize(self, buff):
00312     """
00313     serialize message into buffer
00314     :param buff: buffer, ``StringIO``
00315     """
00316     try:
00317       buff.write(_struct_i.pack(self.status))
00318     except struct.error as se: self._check_types(se)
00319     except TypeError as te: self._check_types(te)
00320 
00321   def deserialize(self, str):
00322     """
00323     unpack serialized message in str into this message instance
00324     :param str: byte array of serialized message, ``str``
00325     """
00326     try:
00327       end = 0
00328       start = end
00329       end += 4
00330       (self.status,) = _struct_i.unpack(str[start:end])
00331       return self
00332     except struct.error as e:
00333       raise genpy.DeserializationError(e) #most likely buffer underfill
00334 
00335 
00336   def serialize_numpy(self, buff, numpy):
00337     """
00338     serialize message with numpy array types into buffer
00339     :param buff: buffer, ``StringIO``
00340     :param numpy: numpy python module
00341     """
00342     try:
00343       buff.write(_struct_i.pack(self.status))
00344     except struct.error as se: self._check_types(se)
00345     except TypeError as te: self._check_types(te)
00346 
00347   def deserialize_numpy(self, str, numpy):
00348     """
00349     unpack serialized message in str into this message instance using numpy for array types
00350     :param str: byte array of serialized message, ``str``
00351     :param numpy: numpy python module
00352     """
00353     try:
00354       end = 0
00355       start = end
00356       end += 4
00357       (self.status,) = _struct_i.unpack(str[start:end])
00358       return self
00359     except struct.error as e:
00360       raise genpy.DeserializationError(e) #most likely buffer underfill
00361 
00362 _struct_I = genpy.struct_I
00363 _struct_i = struct.Struct("<i")
00364 class InsertInstance(object):
00365   _type          = 'srs_knowledge/InsertInstance'
00366   _md5sum = 'de4f778bc157f3ddb743a424085c4c81'
00367   _request_class  = InsertInstanceRequest
00368   _response_class = InsertInstanceResponse


srs_knowledge
Author(s): Ze Ji
autogenerated on Sun Jan 5 2014 12:03:26