_EmptyFrameElement.py
Go to the documentation of this file.
00001 """autogenerated by genpy from roboframenet_msgs/EmptyFrameElement.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 EmptyFrameElement(genpy.Message):
00009   _md5sum = "a29b0317b8ca9f43f3140ecb78df89fc"
00010   _type = "roboframenet_msgs/EmptyFrameElement"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string name   # eg object, recipient
00013 string default
00014 bool is_core
00015 
00016 """
00017   __slots__ = ['name','default','is_core']
00018   _slot_types = ['string','string','bool']
00019 
00020   def __init__(self, *args, **kwds):
00021     """
00022     Constructor. Any message fields that are implicitly/explicitly
00023     set to None will be assigned a default value. The recommend
00024     use is keyword arguments as this is more robust to future message
00025     changes.  You cannot mix in-order arguments and keyword arguments.
00026 
00027     The available fields are:
00028        name,default,is_core
00029 
00030     :param args: complete set of field values, in .msg order
00031     :param kwds: use keyword arguments corresponding to message field names
00032     to set specific fields.
00033     """
00034     if args or kwds:
00035       super(EmptyFrameElement, self).__init__(*args, **kwds)
00036       #message fields cannot be None, assign default values for those that are
00037       if self.name is None:
00038         self.name = ''
00039       if self.default is None:
00040         self.default = ''
00041       if self.is_core is None:
00042         self.is_core = False
00043     else:
00044       self.name = ''
00045       self.default = ''
00046       self.is_core = False
00047 
00048   def _get_types(self):
00049     """
00050     internal API method
00051     """
00052     return self._slot_types
00053 
00054   def serialize(self, buff):
00055     """
00056     serialize message into buffer
00057     :param buff: buffer, ``StringIO``
00058     """
00059     try:
00060       _x = self.name
00061       length = len(_x)
00062       if python3 or type(_x) == unicode:
00063         _x = _x.encode('utf-8')
00064         length = len(_x)
00065       buff.write(struct.pack('<I%ss'%length, length, _x))
00066       _x = self.default
00067       length = len(_x)
00068       if python3 or type(_x) == unicode:
00069         _x = _x.encode('utf-8')
00070         length = len(_x)
00071       buff.write(struct.pack('<I%ss'%length, length, _x))
00072       buff.write(_struct_B.pack(self.is_core))
00073     except struct.error as se: self._check_types(se)
00074     except TypeError as te: self._check_types(te)
00075 
00076   def deserialize(self, str):
00077     """
00078     unpack serialized message in str into this message instance
00079     :param str: byte array of serialized message, ``str``
00080     """
00081     try:
00082       end = 0
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.name = str[start:end].decode('utf-8')
00090       else:
00091         self.name = str[start:end]
00092       start = end
00093       end += 4
00094       (length,) = _struct_I.unpack(str[start:end])
00095       start = end
00096       end += length
00097       if python3:
00098         self.default = str[start:end].decode('utf-8')
00099       else:
00100         self.default = str[start:end]
00101       start = end
00102       end += 1
00103       (self.is_core,) = _struct_B.unpack(str[start:end])
00104       self.is_core = bool(self.is_core)
00105       return self
00106     except struct.error as e:
00107       raise genpy.DeserializationError(e) #most likely buffer underfill
00108 
00109 
00110   def serialize_numpy(self, buff, numpy):
00111     """
00112     serialize message with numpy array types into buffer
00113     :param buff: buffer, ``StringIO``
00114     :param numpy: numpy python module
00115     """
00116     try:
00117       _x = self.name
00118       length = len(_x)
00119       if python3 or type(_x) == unicode:
00120         _x = _x.encode('utf-8')
00121         length = len(_x)
00122       buff.write(struct.pack('<I%ss'%length, length, _x))
00123       _x = self.default
00124       length = len(_x)
00125       if python3 or type(_x) == unicode:
00126         _x = _x.encode('utf-8')
00127         length = len(_x)
00128       buff.write(struct.pack('<I%ss'%length, length, _x))
00129       buff.write(_struct_B.pack(self.is_core))
00130     except struct.error as se: self._check_types(se)
00131     except TypeError as te: self._check_types(te)
00132 
00133   def deserialize_numpy(self, str, numpy):
00134     """
00135     unpack serialized message in str into this message instance using numpy for array types
00136     :param str: byte array of serialized message, ``str``
00137     :param numpy: numpy python module
00138     """
00139     try:
00140       end = 0
00141       start = end
00142       end += 4
00143       (length,) = _struct_I.unpack(str[start:end])
00144       start = end
00145       end += length
00146       if python3:
00147         self.name = str[start:end].decode('utf-8')
00148       else:
00149         self.name = str[start:end]
00150       start = end
00151       end += 4
00152       (length,) = _struct_I.unpack(str[start:end])
00153       start = end
00154       end += length
00155       if python3:
00156         self.default = str[start:end].decode('utf-8')
00157       else:
00158         self.default = str[start:end]
00159       start = end
00160       end += 1
00161       (self.is_core,) = _struct_B.unpack(str[start:end])
00162       self.is_core = bool(self.is_core)
00163       return self
00164     except struct.error as e:
00165       raise genpy.DeserializationError(e) #most likely buffer underfill
00166 
00167 _struct_I = genpy.struct_I
00168 _struct_B = struct.Struct("<B")


roboframenet_msgs
Author(s): Brian Thomas
autogenerated on Fri Dec 6 2013 20:32:42