_Task.py
Go to the documentation of this file.
00001 """autogenerated by genpy from continuous_ops_msgs/Task.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import genpy
00008 
00009 class Task(genpy.Message):
00010   _md5sum = "6e00694b70b1c0d56c53112587f3804c"
00011   _type = "continuous_ops_msgs/Task"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """string name
00014 string description
00015 string task_id
00016 string run_id
00017 string launch_file
00018 string image_file
00019 string state
00020 string action_ns
00021 duration timeout
00022 """
00023   __slots__ = ['name','description','task_id','run_id','launch_file','image_file','state','action_ns','timeout']
00024   _slot_types = ['string','string','string','string','string','string','string','string','duration']
00025 
00026   def __init__(self, *args, **kwds):
00027     """
00028     Constructor. Any message fields that are implicitly/explicitly
00029     set to None will be assigned a default value. The recommend
00030     use is keyword arguments as this is more robust to future message
00031     changes.  You cannot mix in-order arguments and keyword arguments.
00032 
00033     The available fields are:
00034        name,description,task_id,run_id,launch_file,image_file,state,action_ns,timeout
00035 
00036     :param args: complete set of field values, in .msg order
00037     :param kwds: use keyword arguments corresponding to message field names
00038     to set specific fields.
00039     """
00040     if args or kwds:
00041       super(Task, self).__init__(*args, **kwds)
00042       #message fields cannot be None, assign default values for those that are
00043       if self.name is None:
00044         self.name = ''
00045       if self.description is None:
00046         self.description = ''
00047       if self.task_id is None:
00048         self.task_id = ''
00049       if self.run_id is None:
00050         self.run_id = ''
00051       if self.launch_file is None:
00052         self.launch_file = ''
00053       if self.image_file is None:
00054         self.image_file = ''
00055       if self.state is None:
00056         self.state = ''
00057       if self.action_ns is None:
00058         self.action_ns = ''
00059       if self.timeout is None:
00060         self.timeout = genpy.Duration()
00061     else:
00062       self.name = ''
00063       self.description = ''
00064       self.task_id = ''
00065       self.run_id = ''
00066       self.launch_file = ''
00067       self.image_file = ''
00068       self.state = ''
00069       self.action_ns = ''
00070       self.timeout = genpy.Duration()
00071 
00072   def _get_types(self):
00073     """
00074     internal API method
00075     """
00076     return self._slot_types
00077 
00078   def serialize(self, buff):
00079     """
00080     serialize message into buffer
00081     :param buff: buffer, ``StringIO``
00082     """
00083     try:
00084       _x = self.name
00085       length = len(_x)
00086       if python3 or type(_x) == unicode:
00087         _x = _x.encode('utf-8')
00088         length = len(_x)
00089       buff.write(struct.pack('<I%ss'%length, length, _x))
00090       _x = self.description
00091       length = len(_x)
00092       if python3 or type(_x) == unicode:
00093         _x = _x.encode('utf-8')
00094         length = len(_x)
00095       buff.write(struct.pack('<I%ss'%length, length, _x))
00096       _x = self.task_id
00097       length = len(_x)
00098       if python3 or type(_x) == unicode:
00099         _x = _x.encode('utf-8')
00100         length = len(_x)
00101       buff.write(struct.pack('<I%ss'%length, length, _x))
00102       _x = self.run_id
00103       length = len(_x)
00104       if python3 or type(_x) == unicode:
00105         _x = _x.encode('utf-8')
00106         length = len(_x)
00107       buff.write(struct.pack('<I%ss'%length, length, _x))
00108       _x = self.launch_file
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114       _x = self.image_file
00115       length = len(_x)
00116       if python3 or type(_x) == unicode:
00117         _x = _x.encode('utf-8')
00118         length = len(_x)
00119       buff.write(struct.pack('<I%ss'%length, length, _x))
00120       _x = self.state
00121       length = len(_x)
00122       if python3 or type(_x) == unicode:
00123         _x = _x.encode('utf-8')
00124         length = len(_x)
00125       buff.write(struct.pack('<I%ss'%length, length, _x))
00126       _x = self.action_ns
00127       length = len(_x)
00128       if python3 or type(_x) == unicode:
00129         _x = _x.encode('utf-8')
00130         length = len(_x)
00131       buff.write(struct.pack('<I%ss'%length, length, _x))
00132       _x = self
00133       buff.write(_struct_2i.pack(_x.timeout.secs, _x.timeout.nsecs))
00134     except struct.error as se: self._check_types(se)
00135     except TypeError as te: self._check_types(te)
00136 
00137   def deserialize(self, str):
00138     """
00139     unpack serialized message in str into this message instance
00140     :param str: byte array of serialized message, ``str``
00141     """
00142     try:
00143       if self.timeout is None:
00144         self.timeout = genpy.Duration()
00145       end = 0
00146       start = end
00147       end += 4
00148       (length,) = _struct_I.unpack(str[start:end])
00149       start = end
00150       end += length
00151       if python3:
00152         self.name = str[start:end].decode('utf-8')
00153       else:
00154         self.name = str[start:end]
00155       start = end
00156       end += 4
00157       (length,) = _struct_I.unpack(str[start:end])
00158       start = end
00159       end += length
00160       if python3:
00161         self.description = str[start:end].decode('utf-8')
00162       else:
00163         self.description = str[start:end]
00164       start = end
00165       end += 4
00166       (length,) = _struct_I.unpack(str[start:end])
00167       start = end
00168       end += length
00169       if python3:
00170         self.task_id = str[start:end].decode('utf-8')
00171       else:
00172         self.task_id = str[start:end]
00173       start = end
00174       end += 4
00175       (length,) = _struct_I.unpack(str[start:end])
00176       start = end
00177       end += length
00178       if python3:
00179         self.run_id = str[start:end].decode('utf-8')
00180       else:
00181         self.run_id = str[start:end]
00182       start = end
00183       end += 4
00184       (length,) = _struct_I.unpack(str[start:end])
00185       start = end
00186       end += length
00187       if python3:
00188         self.launch_file = str[start:end].decode('utf-8')
00189       else:
00190         self.launch_file = str[start:end]
00191       start = end
00192       end += 4
00193       (length,) = _struct_I.unpack(str[start:end])
00194       start = end
00195       end += length
00196       if python3:
00197         self.image_file = str[start:end].decode('utf-8')
00198       else:
00199         self.image_file = str[start:end]
00200       start = end
00201       end += 4
00202       (length,) = _struct_I.unpack(str[start:end])
00203       start = end
00204       end += length
00205       if python3:
00206         self.state = str[start:end].decode('utf-8')
00207       else:
00208         self.state = str[start:end]
00209       start = end
00210       end += 4
00211       (length,) = _struct_I.unpack(str[start:end])
00212       start = end
00213       end += length
00214       if python3:
00215         self.action_ns = str[start:end].decode('utf-8')
00216       else:
00217         self.action_ns = str[start:end]
00218       _x = self
00219       start = end
00220       end += 8
00221       (_x.timeout.secs, _x.timeout.nsecs,) = _struct_2i.unpack(str[start:end])
00222       self.timeout.canon()
00223       return self
00224     except struct.error as e:
00225       raise genpy.DeserializationError(e) #most likely buffer underfill
00226 
00227 
00228   def serialize_numpy(self, buff, numpy):
00229     """
00230     serialize message with numpy array types into buffer
00231     :param buff: buffer, ``StringIO``
00232     :param numpy: numpy python module
00233     """
00234     try:
00235       _x = self.name
00236       length = len(_x)
00237       if python3 or type(_x) == unicode:
00238         _x = _x.encode('utf-8')
00239         length = len(_x)
00240       buff.write(struct.pack('<I%ss'%length, length, _x))
00241       _x = self.description
00242       length = len(_x)
00243       if python3 or type(_x) == unicode:
00244         _x = _x.encode('utf-8')
00245         length = len(_x)
00246       buff.write(struct.pack('<I%ss'%length, length, _x))
00247       _x = self.task_id
00248       length = len(_x)
00249       if python3 or type(_x) == unicode:
00250         _x = _x.encode('utf-8')
00251         length = len(_x)
00252       buff.write(struct.pack('<I%ss'%length, length, _x))
00253       _x = self.run_id
00254       length = len(_x)
00255       if python3 or type(_x) == unicode:
00256         _x = _x.encode('utf-8')
00257         length = len(_x)
00258       buff.write(struct.pack('<I%ss'%length, length, _x))
00259       _x = self.launch_file
00260       length = len(_x)
00261       if python3 or type(_x) == unicode:
00262         _x = _x.encode('utf-8')
00263         length = len(_x)
00264       buff.write(struct.pack('<I%ss'%length, length, _x))
00265       _x = self.image_file
00266       length = len(_x)
00267       if python3 or type(_x) == unicode:
00268         _x = _x.encode('utf-8')
00269         length = len(_x)
00270       buff.write(struct.pack('<I%ss'%length, length, _x))
00271       _x = self.state
00272       length = len(_x)
00273       if python3 or type(_x) == unicode:
00274         _x = _x.encode('utf-8')
00275         length = len(_x)
00276       buff.write(struct.pack('<I%ss'%length, length, _x))
00277       _x = self.action_ns
00278       length = len(_x)
00279       if python3 or type(_x) == unicode:
00280         _x = _x.encode('utf-8')
00281         length = len(_x)
00282       buff.write(struct.pack('<I%ss'%length, length, _x))
00283       _x = self
00284       buff.write(_struct_2i.pack(_x.timeout.secs, _x.timeout.nsecs))
00285     except struct.error as se: self._check_types(se)
00286     except TypeError as te: self._check_types(te)
00287 
00288   def deserialize_numpy(self, str, numpy):
00289     """
00290     unpack serialized message in str into this message instance using numpy for array types
00291     :param str: byte array of serialized message, ``str``
00292     :param numpy: numpy python module
00293     """
00294     try:
00295       if self.timeout is None:
00296         self.timeout = genpy.Duration()
00297       end = 0
00298       start = end
00299       end += 4
00300       (length,) = _struct_I.unpack(str[start:end])
00301       start = end
00302       end += length
00303       if python3:
00304         self.name = str[start:end].decode('utf-8')
00305       else:
00306         self.name = str[start:end]
00307       start = end
00308       end += 4
00309       (length,) = _struct_I.unpack(str[start:end])
00310       start = end
00311       end += length
00312       if python3:
00313         self.description = str[start:end].decode('utf-8')
00314       else:
00315         self.description = str[start:end]
00316       start = end
00317       end += 4
00318       (length,) = _struct_I.unpack(str[start:end])
00319       start = end
00320       end += length
00321       if python3:
00322         self.task_id = str[start:end].decode('utf-8')
00323       else:
00324         self.task_id = str[start:end]
00325       start = end
00326       end += 4
00327       (length,) = _struct_I.unpack(str[start:end])
00328       start = end
00329       end += length
00330       if python3:
00331         self.run_id = str[start:end].decode('utf-8')
00332       else:
00333         self.run_id = str[start:end]
00334       start = end
00335       end += 4
00336       (length,) = _struct_I.unpack(str[start:end])
00337       start = end
00338       end += length
00339       if python3:
00340         self.launch_file = str[start:end].decode('utf-8')
00341       else:
00342         self.launch_file = str[start:end]
00343       start = end
00344       end += 4
00345       (length,) = _struct_I.unpack(str[start:end])
00346       start = end
00347       end += length
00348       if python3:
00349         self.image_file = str[start:end].decode('utf-8')
00350       else:
00351         self.image_file = str[start:end]
00352       start = end
00353       end += 4
00354       (length,) = _struct_I.unpack(str[start:end])
00355       start = end
00356       end += length
00357       if python3:
00358         self.state = str[start:end].decode('utf-8')
00359       else:
00360         self.state = str[start:end]
00361       start = end
00362       end += 4
00363       (length,) = _struct_I.unpack(str[start:end])
00364       start = end
00365       end += length
00366       if python3:
00367         self.action_ns = str[start:end].decode('utf-8')
00368       else:
00369         self.action_ns = str[start:end]
00370       _x = self
00371       start = end
00372       end += 8
00373       (_x.timeout.secs, _x.timeout.nsecs,) = _struct_2i.unpack(str[start:end])
00374       self.timeout.canon()
00375       return self
00376     except struct.error as e:
00377       raise genpy.DeserializationError(e) #most likely buffer underfill
00378 
00379 _struct_I = genpy.struct_I
00380 _struct_2i = struct.Struct("<2i")


continuous_ops_msgs
Author(s): Wim Meeussen
autogenerated on Fri Dec 6 2013 19:57:52