_ListApplicationsResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from application_msgs/ListApplicationsResult.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 ListApplicationsResult(genpy.Message):
00009   _md5sum = "529b1334801bfd8ac373e2c8fd509c92"
00010   _type = "application_msgs/ListApplicationsResult"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 string[] application_name
00014 string[] application_status
00015 bool[] daemonize
00016 
00017 """
00018   __slots__ = ['application_name','application_status','daemonize']
00019   _slot_types = ['string[]','string[]','bool[]']
00020 
00021   def __init__(self, *args, **kwds):
00022     """
00023     Constructor. Any message fields that are implicitly/explicitly
00024     set to None will be assigned a default value. The recommend
00025     use is keyword arguments as this is more robust to future message
00026     changes.  You cannot mix in-order arguments and keyword arguments.
00027 
00028     The available fields are:
00029        application_name,application_status,daemonize
00030 
00031     :param args: complete set of field values, in .msg order
00032     :param kwds: use keyword arguments corresponding to message field names
00033     to set specific fields.
00034     """
00035     if args or kwds:
00036       super(ListApplicationsResult, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.application_name is None:
00039         self.application_name = []
00040       if self.application_status is None:
00041         self.application_status = []
00042       if self.daemonize is None:
00043         self.daemonize = []
00044     else:
00045       self.application_name = []
00046       self.application_status = []
00047       self.daemonize = []
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       length = len(self.application_name)
00062       buff.write(_struct_I.pack(length))
00063       for val1 in self.application_name:
00064         length = len(val1)
00065         if python3 or type(val1) == unicode:
00066           val1 = val1.encode('utf-8')
00067           length = len(val1)
00068         buff.write(struct.pack('<I%ss'%length, length, val1))
00069       length = len(self.application_status)
00070       buff.write(_struct_I.pack(length))
00071       for val1 in self.application_status:
00072         length = len(val1)
00073         if python3 or type(val1) == unicode:
00074           val1 = val1.encode('utf-8')
00075           length = len(val1)
00076         buff.write(struct.pack('<I%ss'%length, length, val1))
00077       length = len(self.daemonize)
00078       buff.write(_struct_I.pack(length))
00079       pattern = '<%sB'%length
00080       buff.write(struct.pack(pattern, *self.daemonize))
00081     except struct.error as se: self._check_types(se)
00082     except TypeError as te: self._check_types(te)
00083 
00084   def deserialize(self, str):
00085     """
00086     unpack serialized message in str into this message instance
00087     :param str: byte array of serialized message, ``str``
00088     """
00089     try:
00090       end = 0
00091       start = end
00092       end += 4
00093       (length,) = _struct_I.unpack(str[start:end])
00094       self.application_name = []
00095       for i in range(0, length):
00096         start = end
00097         end += 4
00098         (length,) = _struct_I.unpack(str[start:end])
00099         start = end
00100         end += length
00101         if python3:
00102           val1 = str[start:end].decode('utf-8')
00103         else:
00104           val1 = str[start:end]
00105         self.application_name.append(val1)
00106       start = end
00107       end += 4
00108       (length,) = _struct_I.unpack(str[start:end])
00109       self.application_status = []
00110       for i in range(0, length):
00111         start = end
00112         end += 4
00113         (length,) = _struct_I.unpack(str[start:end])
00114         start = end
00115         end += length
00116         if python3:
00117           val1 = str[start:end].decode('utf-8')
00118         else:
00119           val1 = str[start:end]
00120         self.application_status.append(val1)
00121       start = end
00122       end += 4
00123       (length,) = _struct_I.unpack(str[start:end])
00124       pattern = '<%sB'%length
00125       start = end
00126       end += struct.calcsize(pattern)
00127       self.daemonize = struct.unpack(pattern, str[start:end])
00128       self.daemonize = map(bool, self.daemonize)
00129       return self
00130     except struct.error as e:
00131       raise genpy.DeserializationError(e) #most likely buffer underfill
00132 
00133 
00134   def serialize_numpy(self, buff, numpy):
00135     """
00136     serialize message with numpy array types into buffer
00137     :param buff: buffer, ``StringIO``
00138     :param numpy: numpy python module
00139     """
00140     try:
00141       length = len(self.application_name)
00142       buff.write(_struct_I.pack(length))
00143       for val1 in self.application_name:
00144         length = len(val1)
00145         if python3 or type(val1) == unicode:
00146           val1 = val1.encode('utf-8')
00147           length = len(val1)
00148         buff.write(struct.pack('<I%ss'%length, length, val1))
00149       length = len(self.application_status)
00150       buff.write(_struct_I.pack(length))
00151       for val1 in self.application_status:
00152         length = len(val1)
00153         if python3 or type(val1) == unicode:
00154           val1 = val1.encode('utf-8')
00155           length = len(val1)
00156         buff.write(struct.pack('<I%ss'%length, length, val1))
00157       length = len(self.daemonize)
00158       buff.write(_struct_I.pack(length))
00159       pattern = '<%sB'%length
00160       buff.write(self.daemonize.tostring())
00161     except struct.error as se: self._check_types(se)
00162     except TypeError as te: self._check_types(te)
00163 
00164   def deserialize_numpy(self, str, numpy):
00165     """
00166     unpack serialized message in str into this message instance using numpy for array types
00167     :param str: byte array of serialized message, ``str``
00168     :param numpy: numpy python module
00169     """
00170     try:
00171       end = 0
00172       start = end
00173       end += 4
00174       (length,) = _struct_I.unpack(str[start:end])
00175       self.application_name = []
00176       for i in range(0, length):
00177         start = end
00178         end += 4
00179         (length,) = _struct_I.unpack(str[start:end])
00180         start = end
00181         end += length
00182         if python3:
00183           val1 = str[start:end].decode('utf-8')
00184         else:
00185           val1 = str[start:end]
00186         self.application_name.append(val1)
00187       start = end
00188       end += 4
00189       (length,) = _struct_I.unpack(str[start:end])
00190       self.application_status = []
00191       for i in range(0, length):
00192         start = end
00193         end += 4
00194         (length,) = _struct_I.unpack(str[start:end])
00195         start = end
00196         end += length
00197         if python3:
00198           val1 = str[start:end].decode('utf-8')
00199         else:
00200           val1 = str[start:end]
00201         self.application_status.append(val1)
00202       start = end
00203       end += 4
00204       (length,) = _struct_I.unpack(str[start:end])
00205       pattern = '<%sB'%length
00206       start = end
00207       end += struct.calcsize(pattern)
00208       self.daemonize = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length)
00209       self.daemonize = map(bool, self.daemonize)
00210       return self
00211     except struct.error as e:
00212       raise genpy.DeserializationError(e) #most likely buffer underfill
00213 
00214 _struct_I = genpy.struct_I


application_msgs
Author(s):
autogenerated on Mon Dec 2 2013 12:00:38