_Remapping.py
Go to the documentation of this file.
00001 """autogenerated by genpy from appmanager_msgs/Remapping.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 Remapping(genpy.Message):
00009   _md5sum = "26f16c667d483280bc5d040bf2c0cd8d"
00010   _type = "appmanager_msgs/Remapping"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Describes your typical ros remapping
00013 
00014 string remap_from
00015 string remap_to
00016 
00017 """
00018   __slots__ = ['remap_from','remap_to']
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        remap_from,remap_to
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(Remapping, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.remap_from is None:
00039         self.remap_from = ''
00040       if self.remap_to is None:
00041         self.remap_to = ''
00042     else:
00043       self.remap_from = ''
00044       self.remap_to = ''
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.remap_from
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.remap_to
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.remap_from = str[start:end].decode('utf-8')
00087       else:
00088         self.remap_from = 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.remap_to = str[start:end].decode('utf-8')
00096       else:
00097         self.remap_to = 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.remap_from
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.remap_to
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.remap_from = str[start:end].decode('utf-8')
00140       else:
00141         self.remap_from = 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.remap_to = str[start:end].decode('utf-8')
00149       else:
00150         self.remap_to = 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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


appmanager_msgs
Author(s): Jihoon
autogenerated on Tue Jan 15 2013 17:43:30