_RemoteAll.py
Go to the documentation of this file.
00001 """autogenerated by genpy from gateway_comms/RemoteAllRequest.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 gateway_comms.msg
00008 
00009 class RemoteAllRequest(genpy.Message):
00010   _md5sum = "036fdb1a9946cb6fec17ef2d907450d9"
00011   _type = "gateway_comms/RemoteAllRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """
00014 
00015 
00016 string gateway
00017 
00018 
00019 Rule[] blacklist
00020 
00021 
00022 bool cancel
00023 
00024 
00025 ================================================================================
00026 MSG: gateway_comms/Rule
00027 # Standard gateway connection rule
00028 
00029 # type of connection (from gateway_comms.msg.Connection)
00030 string type
00031 
00032 # this is the topic/service name or the action base name (a regex is supported)
00033 string name 
00034 
00035 # (optional) an optional node name can be provided. if node name is not provided
00036 # then all nodes are matched (also supports regex)
00037 string node
00038 
00039 """
00040   __slots__ = ['gateway','blacklist','cancel']
00041   _slot_types = ['string','gateway_comms/Rule[]','bool']
00042 
00043   def __init__(self, *args, **kwds):
00044     """
00045     Constructor. Any message fields that are implicitly/explicitly
00046     set to None will be assigned a default value. The recommend
00047     use is keyword arguments as this is more robust to future message
00048     changes.  You cannot mix in-order arguments and keyword arguments.
00049 
00050     The available fields are:
00051        gateway,blacklist,cancel
00052 
00053     :param args: complete set of field values, in .msg order
00054     :param kwds: use keyword arguments corresponding to message field names
00055     to set specific fields.
00056     """
00057     if args or kwds:
00058       super(RemoteAllRequest, self).__init__(*args, **kwds)
00059       #message fields cannot be None, assign default values for those that are
00060       if self.gateway is None:
00061         self.gateway = ''
00062       if self.blacklist is None:
00063         self.blacklist = []
00064       if self.cancel is None:
00065         self.cancel = False
00066     else:
00067       self.gateway = ''
00068       self.blacklist = []
00069       self.cancel = False
00070 
00071   def _get_types(self):
00072     """
00073     internal API method
00074     """
00075     return self._slot_types
00076 
00077   def serialize(self, buff):
00078     """
00079     serialize message into buffer
00080     :param buff: buffer, ``StringIO``
00081     """
00082     try:
00083       _x = self.gateway
00084       length = len(_x)
00085       if python3 or type(_x) == unicode:
00086         _x = _x.encode('utf-8')
00087         length = len(_x)
00088       buff.write(struct.pack('<I%ss'%length, length, _x))
00089       length = len(self.blacklist)
00090       buff.write(_struct_I.pack(length))
00091       for val1 in self.blacklist:
00092         _x = val1.type
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.name
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.node
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       buff.write(_struct_B.pack(self.cancel))
00111     except struct.error as se: self._check_types(se)
00112     except TypeError as te: self._check_types(te)
00113 
00114   def deserialize(self, str):
00115     """
00116     unpack serialized message in str into this message instance
00117     :param str: byte array of serialized message, ``str``
00118     """
00119     try:
00120       if self.blacklist is None:
00121         self.blacklist = None
00122       end = 0
00123       start = end
00124       end += 4
00125       (length,) = _struct_I.unpack(str[start:end])
00126       start = end
00127       end += length
00128       if python3:
00129         self.gateway = str[start:end].decode('utf-8')
00130       else:
00131         self.gateway = str[start:end]
00132       start = end
00133       end += 4
00134       (length,) = _struct_I.unpack(str[start:end])
00135       self.blacklist = []
00136       for i in range(0, length):
00137         val1 = gateway_comms.msg.Rule()
00138         start = end
00139         end += 4
00140         (length,) = _struct_I.unpack(str[start:end])
00141         start = end
00142         end += length
00143         if python3:
00144           val1.type = str[start:end].decode('utf-8')
00145         else:
00146           val1.type = str[start:end]
00147         start = end
00148         end += 4
00149         (length,) = _struct_I.unpack(str[start:end])
00150         start = end
00151         end += length
00152         if python3:
00153           val1.name = str[start:end].decode('utf-8')
00154         else:
00155           val1.name = str[start:end]
00156         start = end
00157         end += 4
00158         (length,) = _struct_I.unpack(str[start:end])
00159         start = end
00160         end += length
00161         if python3:
00162           val1.node = str[start:end].decode('utf-8')
00163         else:
00164           val1.node = str[start:end]
00165         self.blacklist.append(val1)
00166       start = end
00167       end += 1
00168       (self.cancel,) = _struct_B.unpack(str[start:end])
00169       self.cancel = bool(self.cancel)
00170       return self
00171     except struct.error as e:
00172       raise genpy.DeserializationError(e) #most likely buffer underfill
00173 
00174 
00175   def serialize_numpy(self, buff, numpy):
00176     """
00177     serialize message with numpy array types into buffer
00178     :param buff: buffer, ``StringIO``
00179     :param numpy: numpy python module
00180     """
00181     try:
00182       _x = self.gateway
00183       length = len(_x)
00184       if python3 or type(_x) == unicode:
00185         _x = _x.encode('utf-8')
00186         length = len(_x)
00187       buff.write(struct.pack('<I%ss'%length, length, _x))
00188       length = len(self.blacklist)
00189       buff.write(_struct_I.pack(length))
00190       for val1 in self.blacklist:
00191         _x = val1.type
00192         length = len(_x)
00193         if python3 or type(_x) == unicode:
00194           _x = _x.encode('utf-8')
00195           length = len(_x)
00196         buff.write(struct.pack('<I%ss'%length, length, _x))
00197         _x = val1.name
00198         length = len(_x)
00199         if python3 or type(_x) == unicode:
00200           _x = _x.encode('utf-8')
00201           length = len(_x)
00202         buff.write(struct.pack('<I%ss'%length, length, _x))
00203         _x = val1.node
00204         length = len(_x)
00205         if python3 or type(_x) == unicode:
00206           _x = _x.encode('utf-8')
00207           length = len(_x)
00208         buff.write(struct.pack('<I%ss'%length, length, _x))
00209       buff.write(_struct_B.pack(self.cancel))
00210     except struct.error as se: self._check_types(se)
00211     except TypeError as te: self._check_types(te)
00212 
00213   def deserialize_numpy(self, str, numpy):
00214     """
00215     unpack serialized message in str into this message instance using numpy for array types
00216     :param str: byte array of serialized message, ``str``
00217     :param numpy: numpy python module
00218     """
00219     try:
00220       if self.blacklist is None:
00221         self.blacklist = None
00222       end = 0
00223       start = end
00224       end += 4
00225       (length,) = _struct_I.unpack(str[start:end])
00226       start = end
00227       end += length
00228       if python3:
00229         self.gateway = str[start:end].decode('utf-8')
00230       else:
00231         self.gateway = str[start:end]
00232       start = end
00233       end += 4
00234       (length,) = _struct_I.unpack(str[start:end])
00235       self.blacklist = []
00236       for i in range(0, length):
00237         val1 = gateway_comms.msg.Rule()
00238         start = end
00239         end += 4
00240         (length,) = _struct_I.unpack(str[start:end])
00241         start = end
00242         end += length
00243         if python3:
00244           val1.type = str[start:end].decode('utf-8')
00245         else:
00246           val1.type = str[start:end]
00247         start = end
00248         end += 4
00249         (length,) = _struct_I.unpack(str[start:end])
00250         start = end
00251         end += length
00252         if python3:
00253           val1.name = str[start:end].decode('utf-8')
00254         else:
00255           val1.name = str[start:end]
00256         start = end
00257         end += 4
00258         (length,) = _struct_I.unpack(str[start:end])
00259         start = end
00260         end += length
00261         if python3:
00262           val1.node = str[start:end].decode('utf-8')
00263         else:
00264           val1.node = str[start:end]
00265         self.blacklist.append(val1)
00266       start = end
00267       end += 1
00268       (self.cancel,) = _struct_B.unpack(str[start:end])
00269       self.cancel = bool(self.cancel)
00270       return self
00271     except struct.error as e:
00272       raise genpy.DeserializationError(e) #most likely buffer underfill
00273 
00274 _struct_I = genpy.struct_I
00275 _struct_B = struct.Struct("<B")
00276 """autogenerated by genpy from gateway_comms/RemoteAllResponse.msg. Do not edit."""
00277 import sys
00278 python3 = True if sys.hexversion > 0x03000000 else False
00279 import genpy
00280 import struct
00281 
00282 
00283 class RemoteAllResponse(genpy.Message):
00284   _md5sum = "cb1e85ae0c5f4b1c31221493724cc5aa"
00285   _type = "gateway_comms/RemoteAllResponse"
00286   _has_header = False #flag to mark the presence of a Header object
00287   _full_text = """
00288 
00289 
00290 int8 result
00291 string error_message
00292 
00293 
00294 
00295 """
00296   __slots__ = ['result','error_message']
00297   _slot_types = ['int8','string']
00298 
00299   def __init__(self, *args, **kwds):
00300     """
00301     Constructor. Any message fields that are implicitly/explicitly
00302     set to None will be assigned a default value. The recommend
00303     use is keyword arguments as this is more robust to future message
00304     changes.  You cannot mix in-order arguments and keyword arguments.
00305 
00306     The available fields are:
00307        result,error_message
00308 
00309     :param args: complete set of field values, in .msg order
00310     :param kwds: use keyword arguments corresponding to message field names
00311     to set specific fields.
00312     """
00313     if args or kwds:
00314       super(RemoteAllResponse, self).__init__(*args, **kwds)
00315       #message fields cannot be None, assign default values for those that are
00316       if self.result is None:
00317         self.result = 0
00318       if self.error_message is None:
00319         self.error_message = ''
00320     else:
00321       self.result = 0
00322       self.error_message = ''
00323 
00324   def _get_types(self):
00325     """
00326     internal API method
00327     """
00328     return self._slot_types
00329 
00330   def serialize(self, buff):
00331     """
00332     serialize message into buffer
00333     :param buff: buffer, ``StringIO``
00334     """
00335     try:
00336       buff.write(_struct_b.pack(self.result))
00337       _x = self.error_message
00338       length = len(_x)
00339       if python3 or type(_x) == unicode:
00340         _x = _x.encode('utf-8')
00341         length = len(_x)
00342       buff.write(struct.pack('<I%ss'%length, length, _x))
00343     except struct.error as se: self._check_types(se)
00344     except TypeError as te: self._check_types(te)
00345 
00346   def deserialize(self, str):
00347     """
00348     unpack serialized message in str into this message instance
00349     :param str: byte array of serialized message, ``str``
00350     """
00351     try:
00352       end = 0
00353       start = end
00354       end += 1
00355       (self.result,) = _struct_b.unpack(str[start:end])
00356       start = end
00357       end += 4
00358       (length,) = _struct_I.unpack(str[start:end])
00359       start = end
00360       end += length
00361       if python3:
00362         self.error_message = str[start:end].decode('utf-8')
00363       else:
00364         self.error_message = str[start:end]
00365       return self
00366     except struct.error as e:
00367       raise genpy.DeserializationError(e) #most likely buffer underfill
00368 
00369 
00370   def serialize_numpy(self, buff, numpy):
00371     """
00372     serialize message with numpy array types into buffer
00373     :param buff: buffer, ``StringIO``
00374     :param numpy: numpy python module
00375     """
00376     try:
00377       buff.write(_struct_b.pack(self.result))
00378       _x = self.error_message
00379       length = len(_x)
00380       if python3 or type(_x) == unicode:
00381         _x = _x.encode('utf-8')
00382         length = len(_x)
00383       buff.write(struct.pack('<I%ss'%length, length, _x))
00384     except struct.error as se: self._check_types(se)
00385     except TypeError as te: self._check_types(te)
00386 
00387   def deserialize_numpy(self, str, numpy):
00388     """
00389     unpack serialized message in str into this message instance using numpy for array types
00390     :param str: byte array of serialized message, ``str``
00391     :param numpy: numpy python module
00392     """
00393     try:
00394       end = 0
00395       start = end
00396       end += 1
00397       (self.result,) = _struct_b.unpack(str[start:end])
00398       start = end
00399       end += 4
00400       (length,) = _struct_I.unpack(str[start:end])
00401       start = end
00402       end += length
00403       if python3:
00404         self.error_message = str[start:end].decode('utf-8')
00405       else:
00406         self.error_message = str[start:end]
00407       return self
00408     except struct.error as e:
00409       raise genpy.DeserializationError(e) #most likely buffer underfill
00410 
00411 _struct_I = genpy.struct_I
00412 _struct_b = struct.Struct("<b")
00413 class RemoteAll(object):
00414   _type          = 'gateway_comms/RemoteAll'
00415   _md5sum = 'dae39b2540424f9672db2c4f37b6394a'
00416   _request_class  = RemoteAllRequest
00417   _response_class = RemoteAllResponse
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


gateway_comms
Author(s): Jihoon
autogenerated on Wed Nov 21 2012 15:02:06