$search
00001 """autogenerated by genmsg_py from PropertyTuple.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class PropertyTuple(roslib.message.Message): 00007 _md5sum = "91ad9ce27eca861d92b46a6fbf01654d" 00008 _type = "srs_knowledge/PropertyTuple" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string propertyName 00011 string dataType # float, int32, string, Literal etc 00012 string value 00013 string propertyURI 00014 00015 00016 """ 00017 __slots__ = ['propertyName','dataType','value','propertyURI'] 00018 _slot_types = ['string','string','string','string'] 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 propertyName,dataType,value,propertyURI 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(PropertyTuple, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.propertyName is None: 00038 self.propertyName = '' 00039 if self.dataType is None: 00040 self.dataType = '' 00041 if self.value is None: 00042 self.value = '' 00043 if self.propertyURI is None: 00044 self.propertyURI = '' 00045 else: 00046 self.propertyName = '' 00047 self.dataType = '' 00048 self.value = '' 00049 self.propertyURI = '' 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 00061 @type buff: StringIO 00062 """ 00063 try: 00064 _x = self.propertyName 00065 length = len(_x) 00066 buff.write(struct.pack('<I%ss'%length, length, _x)) 00067 _x = self.dataType 00068 length = len(_x) 00069 buff.write(struct.pack('<I%ss'%length, length, _x)) 00070 _x = self.value 00071 length = len(_x) 00072 buff.write(struct.pack('<I%ss'%length, length, _x)) 00073 _x = self.propertyURI 00074 length = len(_x) 00075 buff.write(struct.pack('<I%ss'%length, length, _x)) 00076 except struct.error as se: self._check_types(se) 00077 except TypeError as te: self._check_types(te) 00078 00079 def deserialize(self, str): 00080 """ 00081 unpack serialized message in str into this message instance 00082 @param str: byte array of serialized message 00083 @type str: str 00084 """ 00085 try: 00086 end = 0 00087 start = end 00088 end += 4 00089 (length,) = _struct_I.unpack(str[start:end]) 00090 start = end 00091 end += length 00092 self.propertyName = str[start:end] 00093 start = end 00094 end += 4 00095 (length,) = _struct_I.unpack(str[start:end]) 00096 start = end 00097 end += length 00098 self.dataType = str[start:end] 00099 start = end 00100 end += 4 00101 (length,) = _struct_I.unpack(str[start:end]) 00102 start = end 00103 end += length 00104 self.value = str[start:end] 00105 start = end 00106 end += 4 00107 (length,) = _struct_I.unpack(str[start:end]) 00108 start = end 00109 end += length 00110 self.propertyURI = str[start:end] 00111 return self 00112 except struct.error as e: 00113 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00114 00115 00116 def serialize_numpy(self, buff, numpy): 00117 """ 00118 serialize message with numpy array types into buffer 00119 @param buff: buffer 00120 @type buff: StringIO 00121 @param numpy: numpy python module 00122 @type numpy module 00123 """ 00124 try: 00125 _x = self.propertyName 00126 length = len(_x) 00127 buff.write(struct.pack('<I%ss'%length, length, _x)) 00128 _x = self.dataType 00129 length = len(_x) 00130 buff.write(struct.pack('<I%ss'%length, length, _x)) 00131 _x = self.value 00132 length = len(_x) 00133 buff.write(struct.pack('<I%ss'%length, length, _x)) 00134 _x = self.propertyURI 00135 length = len(_x) 00136 buff.write(struct.pack('<I%ss'%length, length, _x)) 00137 except struct.error as se: self._check_types(se) 00138 except TypeError as te: self._check_types(te) 00139 00140 def deserialize_numpy(self, str, numpy): 00141 """ 00142 unpack serialized message in str into this message instance using numpy for array types 00143 @param str: byte array of serialized message 00144 @type str: str 00145 @param numpy: numpy python module 00146 @type numpy: module 00147 """ 00148 try: 00149 end = 0 00150 start = end 00151 end += 4 00152 (length,) = _struct_I.unpack(str[start:end]) 00153 start = end 00154 end += length 00155 self.propertyName = str[start:end] 00156 start = end 00157 end += 4 00158 (length,) = _struct_I.unpack(str[start:end]) 00159 start = end 00160 end += length 00161 self.dataType = str[start:end] 00162 start = end 00163 end += 4 00164 (length,) = _struct_I.unpack(str[start:end]) 00165 start = end 00166 end += length 00167 self.value = str[start:end] 00168 start = end 00169 end += 4 00170 (length,) = _struct_I.unpack(str[start:end]) 00171 start = end 00172 end += length 00173 self.propertyURI = str[start:end] 00174 return self 00175 except struct.error as e: 00176 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00177 00178 _struct_I = roslib.message.struct_I