_LinkNode.py
Go to the documentation of this file.
00001 """autogenerated by genpy from concert_msgs/LinkNode.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 LinkNode(genpy.Message):
00009   _md5sum = "47b77811c098e77805b5325bcf577ddb"
00010   _type = "concert_msgs/LinkNode"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Representation of a concert client node in the 
00013 # implementation graph
00014 
00015 # unique identifier
00016 string id
00017 # tuple representing the client node - platform.system.robot.app, e.g. linux.ros.turtlebot.turtle_stroll
00018 string tuple
00019 
00020 """
00021   __slots__ = ['id','tuple']
00022   _slot_types = ['string','string']
00023 
00024   def __init__(self, *args, **kwds):
00025     """
00026     Constructor. Any message fields that are implicitly/explicitly
00027     set to None will be assigned a default value. The recommend
00028     use is keyword arguments as this is more robust to future message
00029     changes.  You cannot mix in-order arguments and keyword arguments.
00030 
00031     The available fields are:
00032        id,tuple
00033 
00034     :param args: complete set of field values, in .msg order
00035     :param kwds: use keyword arguments corresponding to message field names
00036     to set specific fields.
00037     """
00038     if args or kwds:
00039       super(LinkNode, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.id is None:
00042         self.id = ''
00043       if self.tuple is None:
00044         self.tuple = ''
00045     else:
00046       self.id = ''
00047       self.tuple = ''
00048 
00049   def _get_types(self):
00050     """
00051     internal API method
00052     """
00053     return self._slot_types
00054 
00055   def serialize(self, buff):
00056     """
00057     serialize message into buffer
00058     :param buff: buffer, ``StringIO``
00059     """
00060     try:
00061       _x = self.id
00062       length = len(_x)
00063       if python3 or type(_x) == unicode:
00064         _x = _x.encode('utf-8')
00065         length = len(_x)
00066       buff.write(struct.pack('<I%ss'%length, length, _x))
00067       _x = self.tuple
00068       length = len(_x)
00069       if python3 or type(_x) == unicode:
00070         _x = _x.encode('utf-8')
00071         length = len(_x)
00072       buff.write(struct.pack('<I%ss'%length, length, _x))
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.id = str[start:end].decode('utf-8')
00090       else:
00091         self.id = 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.tuple = str[start:end].decode('utf-8')
00099       else:
00100         self.tuple = str[start:end]
00101       return self
00102     except struct.error as e:
00103       raise genpy.DeserializationError(e) #most likely buffer underfill
00104 
00105 
00106   def serialize_numpy(self, buff, numpy):
00107     """
00108     serialize message with numpy array types into buffer
00109     :param buff: buffer, ``StringIO``
00110     :param numpy: numpy python module
00111     """
00112     try:
00113       _x = self.id
00114       length = len(_x)
00115       if python3 or type(_x) == unicode:
00116         _x = _x.encode('utf-8')
00117         length = len(_x)
00118       buff.write(struct.pack('<I%ss'%length, length, _x))
00119       _x = self.tuple
00120       length = len(_x)
00121       if python3 or type(_x) == unicode:
00122         _x = _x.encode('utf-8')
00123         length = len(_x)
00124       buff.write(struct.pack('<I%ss'%length, length, _x))
00125     except struct.error as se: self._check_types(se)
00126     except TypeError as te: self._check_types(te)
00127 
00128   def deserialize_numpy(self, str, numpy):
00129     """
00130     unpack serialized message in str into this message instance using numpy for array types
00131     :param str: byte array of serialized message, ``str``
00132     :param numpy: numpy python module
00133     """
00134     try:
00135       end = 0
00136       start = end
00137       end += 4
00138       (length,) = _struct_I.unpack(str[start:end])
00139       start = end
00140       end += length
00141       if python3:
00142         self.id = str[start:end].decode('utf-8')
00143       else:
00144         self.id = str[start:end]
00145       start = end
00146       end += 4
00147       (length,) = _struct_I.unpack(str[start:end])
00148       start = end
00149       end += length
00150       if python3:
00151         self.tuple = str[start:end].decode('utf-8')
00152       else:
00153         self.tuple = str[start:end]
00154       return self
00155     except struct.error as e:
00156       raise genpy.DeserializationError(e) #most likely buffer underfill
00157 
00158 _struct_I = genpy.struct_I
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


concert_msgs
Author(s): Daniel Stonier
autogenerated on Tue Jan 15 2013 17:43:37