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


continuous_ops_msgs
Author(s): Wim Meeussen
autogenerated on Fri Dec 6 2013 21:18:55