Go to the documentation of this file.00001 """autogenerated by genpy from concert_msgs/LinkConnection.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 LinkConnection(genpy.Message):
00009 _md5sum = "3ba1be4318fd20a9a1eb2187efdddb8d"
00010 _type = "concert_msgs/LinkConnection"
00011 _has_header = False
00012 _full_text = """# Representation of a topic/action node in the
00013 # implementation graph
00014
00015 # unique identifier
00016 string id
00017 # type of the topic, e.g. std_msgs/String
00018 string type
00019
00020 """
00021 __slots__ = ['id','type']
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,type
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(LinkConnection, self).__init__(*args, **kwds)
00040
00041 if self.id is None:
00042 self.id = ''
00043 if self.type is None:
00044 self.type = ''
00045 else:
00046 self.id = ''
00047 self.type = ''
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.type
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.type = str[start:end].decode('utf-8')
00099 else:
00100 self.type = str[start:end]
00101 return self
00102 except struct.error as e:
00103 raise genpy.DeserializationError(e)
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.type
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.type = str[start:end].decode('utf-8')
00152 else:
00153 self.type = str[start:end]
00154 return self
00155 except struct.error as e:
00156 raise genpy.DeserializationError(e)
00157
00158 _struct_I = genpy.struct_I