$search
00001 """autogenerated by genmsg_py from ClientApp.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import app_manager.msg 00006 00007 class ClientApp(roslib.message.Message): 00008 _md5sum = "0a8112672c3fbf73cb62ec78d67e41bb" 00009 _type = "app_manager/ClientApp" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# like "android" or "web" or "linux" 00012 string client_type 00013 00014 # like "intent = ros.android.teleop" and "accelerometer = true", used to choose which ClientApp to use 00015 KeyValue[] manager_data 00016 00017 # parameters which just get passed through to the client app. 00018 KeyValue[] app_data 00019 00020 ================================================================================ 00021 MSG: app_manager/KeyValue 00022 string key 00023 string value 00024 00025 """ 00026 __slots__ = ['client_type','manager_data','app_data'] 00027 _slot_types = ['string','app_manager/KeyValue[]','app_manager/KeyValue[]'] 00028 00029 def __init__(self, *args, **kwds): 00030 """ 00031 Constructor. Any message fields that are implicitly/explicitly 00032 set to None will be assigned a default value. The recommend 00033 use is keyword arguments as this is more robust to future message 00034 changes. You cannot mix in-order arguments and keyword arguments. 00035 00036 The available fields are: 00037 client_type,manager_data,app_data 00038 00039 @param args: complete set of field values, in .msg order 00040 @param kwds: use keyword arguments corresponding to message field names 00041 to set specific fields. 00042 """ 00043 if args or kwds: 00044 super(ClientApp, self).__init__(*args, **kwds) 00045 #message fields cannot be None, assign default values for those that are 00046 if self.client_type is None: 00047 self.client_type = '' 00048 if self.manager_data is None: 00049 self.manager_data = [] 00050 if self.app_data is None: 00051 self.app_data = [] 00052 else: 00053 self.client_type = '' 00054 self.manager_data = [] 00055 self.app_data = [] 00056 00057 def _get_types(self): 00058 """ 00059 internal API method 00060 """ 00061 return self._slot_types 00062 00063 def serialize(self, buff): 00064 """ 00065 serialize message into buffer 00066 @param buff: buffer 00067 @type buff: StringIO 00068 """ 00069 try: 00070 _x = self.client_type 00071 length = len(_x) 00072 buff.write(struct.pack('<I%ss'%length, length, _x)) 00073 length = len(self.manager_data) 00074 buff.write(_struct_I.pack(length)) 00075 for val1 in self.manager_data: 00076 _x = val1.key 00077 length = len(_x) 00078 buff.write(struct.pack('<I%ss'%length, length, _x)) 00079 _x = val1.value 00080 length = len(_x) 00081 buff.write(struct.pack('<I%ss'%length, length, _x)) 00082 length = len(self.app_data) 00083 buff.write(_struct_I.pack(length)) 00084 for val1 in self.app_data: 00085 _x = val1.key 00086 length = len(_x) 00087 buff.write(struct.pack('<I%ss'%length, length, _x)) 00088 _x = val1.value 00089 length = len(_x) 00090 buff.write(struct.pack('<I%ss'%length, length, _x)) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize(self, str): 00095 """ 00096 unpack serialized message in str into this message instance 00097 @param str: byte array of serialized message 00098 @type str: str 00099 """ 00100 try: 00101 end = 0 00102 start = end 00103 end += 4 00104 (length,) = _struct_I.unpack(str[start:end]) 00105 start = end 00106 end += length 00107 self.client_type = str[start:end] 00108 start = end 00109 end += 4 00110 (length,) = _struct_I.unpack(str[start:end]) 00111 self.manager_data = [] 00112 for i in range(0, length): 00113 val1 = app_manager.msg.KeyValue() 00114 start = end 00115 end += 4 00116 (length,) = _struct_I.unpack(str[start:end]) 00117 start = end 00118 end += length 00119 val1.key = str[start:end] 00120 start = end 00121 end += 4 00122 (length,) = _struct_I.unpack(str[start:end]) 00123 start = end 00124 end += length 00125 val1.value = str[start:end] 00126 self.manager_data.append(val1) 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 self.app_data = [] 00131 for i in range(0, length): 00132 val1 = app_manager.msg.KeyValue() 00133 start = end 00134 end += 4 00135 (length,) = _struct_I.unpack(str[start:end]) 00136 start = end 00137 end += length 00138 val1.key = str[start:end] 00139 start = end 00140 end += 4 00141 (length,) = _struct_I.unpack(str[start:end]) 00142 start = end 00143 end += length 00144 val1.value = str[start:end] 00145 self.app_data.append(val1) 00146 return self 00147 except struct.error as e: 00148 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00149 00150 00151 def serialize_numpy(self, buff, numpy): 00152 """ 00153 serialize message with numpy array types into buffer 00154 @param buff: buffer 00155 @type buff: StringIO 00156 @param numpy: numpy python module 00157 @type numpy module 00158 """ 00159 try: 00160 _x = self.client_type 00161 length = len(_x) 00162 buff.write(struct.pack('<I%ss'%length, length, _x)) 00163 length = len(self.manager_data) 00164 buff.write(_struct_I.pack(length)) 00165 for val1 in self.manager_data: 00166 _x = val1.key 00167 length = len(_x) 00168 buff.write(struct.pack('<I%ss'%length, length, _x)) 00169 _x = val1.value 00170 length = len(_x) 00171 buff.write(struct.pack('<I%ss'%length, length, _x)) 00172 length = len(self.app_data) 00173 buff.write(_struct_I.pack(length)) 00174 for val1 in self.app_data: 00175 _x = val1.key 00176 length = len(_x) 00177 buff.write(struct.pack('<I%ss'%length, length, _x)) 00178 _x = val1.value 00179 length = len(_x) 00180 buff.write(struct.pack('<I%ss'%length, length, _x)) 00181 except struct.error as se: self._check_types(se) 00182 except TypeError as te: self._check_types(te) 00183 00184 def deserialize_numpy(self, str, numpy): 00185 """ 00186 unpack serialized message in str into this message instance using numpy for array types 00187 @param str: byte array of serialized message 00188 @type str: str 00189 @param numpy: numpy python module 00190 @type numpy: module 00191 """ 00192 try: 00193 end = 0 00194 start = end 00195 end += 4 00196 (length,) = _struct_I.unpack(str[start:end]) 00197 start = end 00198 end += length 00199 self.client_type = str[start:end] 00200 start = end 00201 end += 4 00202 (length,) = _struct_I.unpack(str[start:end]) 00203 self.manager_data = [] 00204 for i in range(0, length): 00205 val1 = app_manager.msg.KeyValue() 00206 start = end 00207 end += 4 00208 (length,) = _struct_I.unpack(str[start:end]) 00209 start = end 00210 end += length 00211 val1.key = str[start:end] 00212 start = end 00213 end += 4 00214 (length,) = _struct_I.unpack(str[start:end]) 00215 start = end 00216 end += length 00217 val1.value = str[start:end] 00218 self.manager_data.append(val1) 00219 start = end 00220 end += 4 00221 (length,) = _struct_I.unpack(str[start:end]) 00222 self.app_data = [] 00223 for i in range(0, length): 00224 val1 = app_manager.msg.KeyValue() 00225 start = end 00226 end += 4 00227 (length,) = _struct_I.unpack(str[start:end]) 00228 start = end 00229 end += length 00230 val1.key = str[start:end] 00231 start = end 00232 end += 4 00233 (length,) = _struct_I.unpack(str[start:end]) 00234 start = end 00235 end += length 00236 val1.value = str[start:end] 00237 self.app_data.append(val1) 00238 return self 00239 except struct.error as e: 00240 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00241 00242 _struct_I = roslib.message.struct_I