_GetVariable.py
Go to the documentation of this file.
00001 """autogenerated by genpy from asebaros/GetVariableRequest.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 GetVariableRequest(genpy.Message):
00009   _md5sum = "accc95a117f3076a20077c08081a00fb"
00010   _type = "asebaros/GetVariableRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string nodeName
00013 string variableName
00014 
00015 """
00016   __slots__ = ['nodeName','variableName']
00017   _slot_types = ['string','string']
00018 
00019   def __init__(self, *args, **kwds):
00020     """
00021     Constructor. Any message fields that are implicitly/explicitly
00022     set to None will be assigned a default value. The recommend
00023     use is keyword arguments as this is more robust to future message
00024     changes.  You cannot mix in-order arguments and keyword arguments.
00025 
00026     The available fields are:
00027        nodeName,variableName
00028 
00029     :param args: complete set of field values, in .msg order
00030     :param kwds: use keyword arguments corresponding to message field names
00031     to set specific fields.
00032     """
00033     if args or kwds:
00034       super(GetVariableRequest, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.nodeName is None:
00037         self.nodeName = ''
00038       if self.variableName is None:
00039         self.variableName = ''
00040     else:
00041       self.nodeName = ''
00042       self.variableName = ''
00043 
00044   def _get_types(self):
00045     """
00046     internal API method
00047     """
00048     return self._slot_types
00049 
00050   def serialize(self, buff):
00051     """
00052     serialize message into buffer
00053     :param buff: buffer, ``StringIO``
00054     """
00055     try:
00056       _x = self.nodeName
00057       length = len(_x)
00058       if python3 or type(_x) == unicode:
00059         _x = _x.encode('utf-8')
00060         length = len(_x)
00061       buff.write(struct.pack('<I%ss'%length, length, _x))
00062       _x = self.variableName
00063       length = len(_x)
00064       if python3 or type(_x) == unicode:
00065         _x = _x.encode('utf-8')
00066         length = len(_x)
00067       buff.write(struct.pack('<I%ss'%length, length, _x))
00068     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00069     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00070 
00071   def deserialize(self, str):
00072     """
00073     unpack serialized message in str into this message instance
00074     :param str: byte array of serialized message, ``str``
00075     """
00076     try:
00077       end = 0
00078       start = end
00079       end += 4
00080       (length,) = _struct_I.unpack(str[start:end])
00081       start = end
00082       end += length
00083       if python3:
00084         self.nodeName = str[start:end].decode('utf-8')
00085       else:
00086         self.nodeName = str[start:end]
00087       start = end
00088       end += 4
00089       (length,) = _struct_I.unpack(str[start:end])
00090       start = end
00091       end += length
00092       if python3:
00093         self.variableName = str[start:end].decode('utf-8')
00094       else:
00095         self.variableName = str[start:end]
00096       return self
00097     except struct.error as e:
00098       raise genpy.DeserializationError(e) #most likely buffer underfill
00099 
00100 
00101   def serialize_numpy(self, buff, numpy):
00102     """
00103     serialize message with numpy array types into buffer
00104     :param buff: buffer, ``StringIO``
00105     :param numpy: numpy python module
00106     """
00107     try:
00108       _x = self.nodeName
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114       _x = self.variableName
00115       length = len(_x)
00116       if python3 or type(_x) == unicode:
00117         _x = _x.encode('utf-8')
00118         length = len(_x)
00119       buff.write(struct.pack('<I%ss'%length, length, _x))
00120     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00121     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00122 
00123   def deserialize_numpy(self, str, numpy):
00124     """
00125     unpack serialized message in str into this message instance using numpy for array types
00126     :param str: byte array of serialized message, ``str``
00127     :param numpy: numpy python module
00128     """
00129     try:
00130       end = 0
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.nodeName = str[start:end].decode('utf-8')
00138       else:
00139         self.nodeName = 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.variableName = str[start:end].decode('utf-8')
00147       else:
00148         self.variableName = str[start:end]
00149       return self
00150     except struct.error as e:
00151       raise genpy.DeserializationError(e) #most likely buffer underfill
00152 
00153 _struct_I = genpy.struct_I
00154 """autogenerated by genpy from asebaros/GetVariableResponse.msg. Do not edit."""
00155 import sys
00156 python3 = True if sys.hexversion > 0x03000000 else False
00157 import genpy
00158 import struct
00159 
00160 
00161 class GetVariableResponse(genpy.Message):
00162   _md5sum = "8560fbebb34fa1b9472337b5c3d38fda"
00163   _type = "asebaros/GetVariableResponse"
00164   _has_header = False #flag to mark the presence of a Header object
00165   _full_text = """int16[] data
00166 
00167 
00168 """
00169   __slots__ = ['data']
00170   _slot_types = ['int16[]']
00171 
00172   def __init__(self, *args, **kwds):
00173     """
00174     Constructor. Any message fields that are implicitly/explicitly
00175     set to None will be assigned a default value. The recommend
00176     use is keyword arguments as this is more robust to future message
00177     changes.  You cannot mix in-order arguments and keyword arguments.
00178 
00179     The available fields are:
00180        data
00181 
00182     :param args: complete set of field values, in .msg order
00183     :param kwds: use keyword arguments corresponding to message field names
00184     to set specific fields.
00185     """
00186     if args or kwds:
00187       super(GetVariableResponse, self).__init__(*args, **kwds)
00188       #message fields cannot be None, assign default values for those that are
00189       if self.data is None:
00190         self.data = []
00191     else:
00192       self.data = []
00193 
00194   def _get_types(self):
00195     """
00196     internal API method
00197     """
00198     return self._slot_types
00199 
00200   def serialize(self, buff):
00201     """
00202     serialize message into buffer
00203     :param buff: buffer, ``StringIO``
00204     """
00205     try:
00206       length = len(self.data)
00207       buff.write(_struct_I.pack(length))
00208       pattern = '<%sh'%length
00209       buff.write(struct.pack(pattern, *self.data))
00210     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00211     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00212 
00213   def deserialize(self, str):
00214     """
00215     unpack serialized message in str into this message instance
00216     :param str: byte array of serialized message, ``str``
00217     """
00218     try:
00219       end = 0
00220       start = end
00221       end += 4
00222       (length,) = _struct_I.unpack(str[start:end])
00223       pattern = '<%sh'%length
00224       start = end
00225       end += struct.calcsize(pattern)
00226       self.data = struct.unpack(pattern, str[start:end])
00227       return self
00228     except struct.error as e:
00229       raise genpy.DeserializationError(e) #most likely buffer underfill
00230 
00231 
00232   def serialize_numpy(self, buff, numpy):
00233     """
00234     serialize message with numpy array types into buffer
00235     :param buff: buffer, ``StringIO``
00236     :param numpy: numpy python module
00237     """
00238     try:
00239       length = len(self.data)
00240       buff.write(_struct_I.pack(length))
00241       pattern = '<%sh'%length
00242       buff.write(self.data.tostring())
00243     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00244     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00245 
00246   def deserialize_numpy(self, str, numpy):
00247     """
00248     unpack serialized message in str into this message instance using numpy for array types
00249     :param str: byte array of serialized message, ``str``
00250     :param numpy: numpy python module
00251     """
00252     try:
00253       end = 0
00254       start = end
00255       end += 4
00256       (length,) = _struct_I.unpack(str[start:end])
00257       pattern = '<%sh'%length
00258       start = end
00259       end += struct.calcsize(pattern)
00260       self.data = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=length)
00261       return self
00262     except struct.error as e:
00263       raise genpy.DeserializationError(e) #most likely buffer underfill
00264 
00265 _struct_I = genpy.struct_I
00266 class GetVariable(object):
00267   _type          = 'asebaros/GetVariable'
00268   _md5sum = '3cd4991b8773048bf30c23665796d94b'
00269   _request_class  = GetVariableRequest
00270   _response_class = GetVariableResponse


asebaros
Author(s): Stéphane Magnenat
autogenerated on Sun Oct 5 2014 23:47:01