_TopicLoggerResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from topic_logger/TopicLoggerResult.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 TopicLoggerResult(genpy.Message):
00009   _md5sum = "d8f288c73d2dfcebb5e4fb8a1eb85278"
00010   _type = "topic_logger/TopicLoggerResult"
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 #result definition
00014 string downloadURL
00015 string target_filename
00016 
00017 """
00018   __slots__ = ['downloadURL','target_filename']
00019   _slot_types = ['string','string']
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        downloadURL,target_filename
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(TopicLoggerResult, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.downloadURL is None:
00039         self.downloadURL = ''
00040       if self.target_filename is None:
00041         self.target_filename = ''
00042     else:
00043       self.downloadURL = ''
00044       self.target_filename = ''
00045 
00046   def _get_types(self):
00047     """
00048     internal API method
00049     """
00050     return self._slot_types
00051 
00052   def serialize(self, buff):
00053     """
00054     serialize message into buffer
00055     :param buff: buffer, ``StringIO``
00056     """
00057     try:
00058       _x = self.downloadURL
00059       length = len(_x)
00060       if python3 or type(_x) == unicode:
00061         _x = _x.encode('utf-8')
00062         length = len(_x)
00063       buff.write(struct.pack('<I%ss'%length, length, _x))
00064       _x = self.target_filename
00065       length = len(_x)
00066       if python3 or type(_x) == unicode:
00067         _x = _x.encode('utf-8')
00068         length = len(_x)
00069       buff.write(struct.pack('<I%ss'%length, length, _x))
00070     except struct.error as se: self._check_types(se)
00071     except TypeError as te: self._check_types(te)
00072 
00073   def deserialize(self, str):
00074     """
00075     unpack serialized message in str into this message instance
00076     :param str: byte array of serialized message, ``str``
00077     """
00078     try:
00079       end = 0
00080       start = end
00081       end += 4
00082       (length,) = _struct_I.unpack(str[start:end])
00083       start = end
00084       end += length
00085       if python3:
00086         self.downloadURL = str[start:end].decode('utf-8')
00087       else:
00088         self.downloadURL = str[start:end]
00089       start = end
00090       end += 4
00091       (length,) = _struct_I.unpack(str[start:end])
00092       start = end
00093       end += length
00094       if python3:
00095         self.target_filename = str[start:end].decode('utf-8')
00096       else:
00097         self.target_filename = str[start:end]
00098       return self
00099     except struct.error as e:
00100       raise genpy.DeserializationError(e) #most likely buffer underfill
00101 
00102 
00103   def serialize_numpy(self, buff, numpy):
00104     """
00105     serialize message with numpy array types into buffer
00106     :param buff: buffer, ``StringIO``
00107     :param numpy: numpy python module
00108     """
00109     try:
00110       _x = self.downloadURL
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       _x = self.target_filename
00117       length = len(_x)
00118       if python3 or type(_x) == unicode:
00119         _x = _x.encode('utf-8')
00120         length = len(_x)
00121       buff.write(struct.pack('<I%ss'%length, length, _x))
00122     except struct.error as se: self._check_types(se)
00123     except TypeError as te: self._check_types(te)
00124 
00125   def deserialize_numpy(self, str, numpy):
00126     """
00127     unpack serialized message in str into this message instance using numpy for array types
00128     :param str: byte array of serialized message, ``str``
00129     :param numpy: numpy python module
00130     """
00131     try:
00132       end = 0
00133       start = end
00134       end += 4
00135       (length,) = _struct_I.unpack(str[start:end])
00136       start = end
00137       end += length
00138       if python3:
00139         self.downloadURL = str[start:end].decode('utf-8')
00140       else:
00141         self.downloadURL = str[start:end]
00142       start = end
00143       end += 4
00144       (length,) = _struct_I.unpack(str[start:end])
00145       start = end
00146       end += length
00147       if python3:
00148         self.target_filename = str[start:end].decode('utf-8')
00149       else:
00150         self.target_filename = str[start:end]
00151       return self
00152     except struct.error as e:
00153       raise genpy.DeserializationError(e) #most likely buffer underfill
00154 
00155 _struct_I = genpy.struct_I


topic_logger
Author(s): Ralf Kempf Maintained by Sarah Osentoski and Ben Pitzer
autogenerated on Sun Jan 5 2014 11:33:05