_Dialog.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cob_hardware_test/DialogRequest.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 DialogRequest(genpy.Message):
00009   _md5sum = "a114ea5669631329625767b345da8854"
00010   _type = "cob_hardware_test/DialogRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint8 type
00013 uint8 CONFIRM         = 0
00014 uint8 QUESTION        = 0
00015 
00016 string message
00017 
00018 """
00019   # Pseudo-constants
00020   CONFIRM = 0
00021   QUESTION = 0
00022 
00023   __slots__ = ['type','message']
00024   _slot_types = ['uint8','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        type,message
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(DialogRequest, self).__init__(*args, **kwds)
00042       #message fields cannot be None, assign default values for those that are
00043       if self.type is None:
00044         self.type = 0
00045       if self.message is None:
00046         self.message = ''
00047     else:
00048       self.type = 0
00049       self.message = ''
00050 
00051   def _get_types(self):
00052     """
00053     internal API method
00054     """
00055     return self._slot_types
00056 
00057   def serialize(self, buff):
00058     """
00059     serialize message into buffer
00060     :param buff: buffer, ``StringIO``
00061     """
00062     try:
00063       buff.write(_struct_B.pack(self.type))
00064       _x = self.message
00065       length = len(_x)
00066       if python3 or type(_x) == unicode:
00067         _x = _x.encode('utf-8')
00068         length = len(_x)
00069       buff.write(struct.pack('<I%ss'%length, length, _x))
00070     except struct.error as se: self._check_types(se)
00071     except TypeError as te: self._check_types(te)
00072 
00073   def deserialize(self, str):
00074     """
00075     unpack serialized message in str into this message instance
00076     :param str: byte array of serialized message, ``str``
00077     """
00078     try:
00079       end = 0
00080       start = end
00081       end += 1
00082       (self.type,) = _struct_B.unpack(str[start:end])
00083       start = end
00084       end += 4
00085       (length,) = _struct_I.unpack(str[start:end])
00086       start = end
00087       end += length
00088       if python3:
00089         self.message = str[start:end].decode('utf-8')
00090       else:
00091         self.message = str[start:end]
00092       return self
00093     except struct.error as e:
00094       raise genpy.DeserializationError(e) #most likely buffer underfill
00095 
00096 
00097   def serialize_numpy(self, buff, numpy):
00098     """
00099     serialize message with numpy array types into buffer
00100     :param buff: buffer, ``StringIO``
00101     :param numpy: numpy python module
00102     """
00103     try:
00104       buff.write(_struct_B.pack(self.type))
00105       _x = self.message
00106       length = len(_x)
00107       if python3 or type(_x) == unicode:
00108         _x = _x.encode('utf-8')
00109         length = len(_x)
00110       buff.write(struct.pack('<I%ss'%length, length, _x))
00111     except struct.error as se: self._check_types(se)
00112     except TypeError as te: self._check_types(te)
00113 
00114   def deserialize_numpy(self, str, numpy):
00115     """
00116     unpack serialized message in str into this message instance using numpy for array types
00117     :param str: byte array of serialized message, ``str``
00118     :param numpy: numpy python module
00119     """
00120     try:
00121       end = 0
00122       start = end
00123       end += 1
00124       (self.type,) = _struct_B.unpack(str[start:end])
00125       start = end
00126       end += 4
00127       (length,) = _struct_I.unpack(str[start:end])
00128       start = end
00129       end += length
00130       if python3:
00131         self.message = str[start:end].decode('utf-8')
00132       else:
00133         self.message = str[start:end]
00134       return self
00135     except struct.error as e:
00136       raise genpy.DeserializationError(e) #most likely buffer underfill
00137 
00138 _struct_I = genpy.struct_I
00139 _struct_B = struct.Struct("<B")
00140 """autogenerated by genpy from cob_hardware_test/DialogResponse.msg. Do not edit."""
00141 import sys
00142 python3 = True if sys.hexversion > 0x03000000 else False
00143 import genpy
00144 import struct
00145 
00146 
00147 class DialogResponse(genpy.Message):
00148   _md5sum = "00a50c1bd863054691f197c515f4e922"
00149   _type = "cob_hardware_test/DialogResponse"
00150   _has_header = False #flag to mark the presence of a Header object
00151   _full_text = """bool answer
00152 
00153 
00154 """
00155   __slots__ = ['answer']
00156   _slot_types = ['bool']
00157 
00158   def __init__(self, *args, **kwds):
00159     """
00160     Constructor. Any message fields that are implicitly/explicitly
00161     set to None will be assigned a default value. The recommend
00162     use is keyword arguments as this is more robust to future message
00163     changes.  You cannot mix in-order arguments and keyword arguments.
00164 
00165     The available fields are:
00166        answer
00167 
00168     :param args: complete set of field values, in .msg order
00169     :param kwds: use keyword arguments corresponding to message field names
00170     to set specific fields.
00171     """
00172     if args or kwds:
00173       super(DialogResponse, self).__init__(*args, **kwds)
00174       #message fields cannot be None, assign default values for those that are
00175       if self.answer is None:
00176         self.answer = False
00177     else:
00178       self.answer = False
00179 
00180   def _get_types(self):
00181     """
00182     internal API method
00183     """
00184     return self._slot_types
00185 
00186   def serialize(self, buff):
00187     """
00188     serialize message into buffer
00189     :param buff: buffer, ``StringIO``
00190     """
00191     try:
00192       buff.write(_struct_B.pack(self.answer))
00193     except struct.error as se: self._check_types(se)
00194     except TypeError as te: self._check_types(te)
00195 
00196   def deserialize(self, str):
00197     """
00198     unpack serialized message in str into this message instance
00199     :param str: byte array of serialized message, ``str``
00200     """
00201     try:
00202       end = 0
00203       start = end
00204       end += 1
00205       (self.answer,) = _struct_B.unpack(str[start:end])
00206       self.answer = bool(self.answer)
00207       return self
00208     except struct.error as e:
00209       raise genpy.DeserializationError(e) #most likely buffer underfill
00210 
00211 
00212   def serialize_numpy(self, buff, numpy):
00213     """
00214     serialize message with numpy array types into buffer
00215     :param buff: buffer, ``StringIO``
00216     :param numpy: numpy python module
00217     """
00218     try:
00219       buff.write(_struct_B.pack(self.answer))
00220     except struct.error as se: self._check_types(se)
00221     except TypeError as te: self._check_types(te)
00222 
00223   def deserialize_numpy(self, str, numpy):
00224     """
00225     unpack serialized message in str into this message instance using numpy for array types
00226     :param str: byte array of serialized message, ``str``
00227     :param numpy: numpy python module
00228     """
00229     try:
00230       end = 0
00231       start = end
00232       end += 1
00233       (self.answer,) = _struct_B.unpack(str[start:end])
00234       self.answer = bool(self.answer)
00235       return self
00236     except struct.error as e:
00237       raise genpy.DeserializationError(e) #most likely buffer underfill
00238 
00239 _struct_I = genpy.struct_I
00240 _struct_B = struct.Struct("<B")
00241 class Dialog(object):
00242   _type          = 'cob_hardware_test/Dialog'
00243   _md5sum = '55ca5c42769f23444b15de98003dd260'
00244   _request_class  = DialogRequest
00245   _response_class = DialogResponse
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


cob_hardware_test
Author(s): Florian Weisshardt
autogenerated on Fri Mar 1 2013 18:00:26