_RemoteGateway.py
Go to the documentation of this file.
00001 """autogenerated by genpy from gateway_msgs/RemoteGateway.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_msgs.msg
00008 
00009 class RemoteGateway(genpy.Message):
00010   _md5sum = "c2825a110d4bc0a2e94421a89778e5f4"
00011   _type = "gateway_msgs/RemoteGateway"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """###### Gateway information ######
00014 string name
00015 string ip
00016 #TODO blocking status,health
00017 bool firewall
00018 
00019 ###### Public Interface ######
00020 
00021 Rule[] public_interface
00022 
00023 
00024 ###### Flipped Interface ######
00025 
00026 # Flipped and pulled interfaces would be useful for debugging 
00027 #    https://github.com/robotics-in-concert/rocon_multimaster/issues/84
00028 
00029 RemoteRule[] flipped_interface
00030 RemoteRule[] pulled_interface
00031 
00032 ###### Foreign Interface ######
00033 
00034 # Q) Should we show these?
00035 # A) Probably not, in the overall scheme of things, 
00036 #    it doubles up the information from above
00037 
00038 # RemoteRule[] flipped_in_connections
00039 # RemoteRule[] pulled_connections
00040 
00041 ================================================================================
00042 MSG: gateway_msgs/Rule
00043 # Standard gateway connection rule
00044 
00045 # type of connection (from gateway_msgs.msg.Connection)
00046 string type
00047 
00048 # this is the topic/service name or the action base name (a regex is supported)
00049 string name 
00050 
00051 # (optional) an optional node name can be provided. if node name is not provided
00052 # then all nodes are matched (also supports regex)
00053 string node
00054 
00055 ================================================================================
00056 MSG: gateway_msgs/RemoteRule
00057 # Definition for a flip. It represents either:
00058 #
00059 # 1) an existing flipped connection (from the local gateway)
00060 # 2) a rule that is put on a watchlist
00061 
00062 # The target recipient of the flip
00063 string gateway
00064 
00065 # Connection has the following parameters that need setting
00066 # - name : fully qualified name of the connection (str)
00067 # - type : connection type (str)
00068 #  
00069 # Use one of the types defined in Connection string constants:
00070 #     (publisher, subscriber, service, action_client, action_server)
00071 #
00072 # - node : name of the node it originates from (str)(optional)
00073 #
00074 # Node name is necessary, for instance, if you have multiple subscribers
00075 # publishing to a single topic. Most of the time it is not necessary,
00076 # but in some cases it helps refine the rule. It helps refine the rule.
00077 #
00078 Rule rule
00079 
00080 """
00081   __slots__ = ['name','ip','firewall','public_interface','flipped_interface','pulled_interface']
00082   _slot_types = ['string','string','bool','gateway_msgs/Rule[]','gateway_msgs/RemoteRule[]','gateway_msgs/RemoteRule[]']
00083 
00084   def __init__(self, *args, **kwds):
00085     """
00086     Constructor. Any message fields that are implicitly/explicitly
00087     set to None will be assigned a default value. The recommend
00088     use is keyword arguments as this is more robust to future message
00089     changes.  You cannot mix in-order arguments and keyword arguments.
00090 
00091     The available fields are:
00092        name,ip,firewall,public_interface,flipped_interface,pulled_interface
00093 
00094     :param args: complete set of field values, in .msg order
00095     :param kwds: use keyword arguments corresponding to message field names
00096     to set specific fields.
00097     """
00098     if args or kwds:
00099       super(RemoteGateway, self).__init__(*args, **kwds)
00100       #message fields cannot be None, assign default values for those that are
00101       if self.name is None:
00102         self.name = ''
00103       if self.ip is None:
00104         self.ip = ''
00105       if self.firewall is None:
00106         self.firewall = False
00107       if self.public_interface is None:
00108         self.public_interface = []
00109       if self.flipped_interface is None:
00110         self.flipped_interface = []
00111       if self.pulled_interface is None:
00112         self.pulled_interface = []
00113     else:
00114       self.name = ''
00115       self.ip = ''
00116       self.firewall = False
00117       self.public_interface = []
00118       self.flipped_interface = []
00119       self.pulled_interface = []
00120 
00121   def _get_types(self):
00122     """
00123     internal API method
00124     """
00125     return self._slot_types
00126 
00127   def serialize(self, buff):
00128     """
00129     serialize message into buffer
00130     :param buff: buffer, ``StringIO``
00131     """
00132     try:
00133       _x = self.name
00134       length = len(_x)
00135       if python3 or type(_x) == unicode:
00136         _x = _x.encode('utf-8')
00137         length = len(_x)
00138       buff.write(struct.pack('<I%ss'%length, length, _x))
00139       _x = self.ip
00140       length = len(_x)
00141       if python3 or type(_x) == unicode:
00142         _x = _x.encode('utf-8')
00143         length = len(_x)
00144       buff.write(struct.pack('<I%ss'%length, length, _x))
00145       buff.write(_struct_B.pack(self.firewall))
00146       length = len(self.public_interface)
00147       buff.write(_struct_I.pack(length))
00148       for val1 in self.public_interface:
00149         _x = val1.type
00150         length = len(_x)
00151         if python3 or type(_x) == unicode:
00152           _x = _x.encode('utf-8')
00153           length = len(_x)
00154         buff.write(struct.pack('<I%ss'%length, length, _x))
00155         _x = val1.name
00156         length = len(_x)
00157         if python3 or type(_x) == unicode:
00158           _x = _x.encode('utf-8')
00159           length = len(_x)
00160         buff.write(struct.pack('<I%ss'%length, length, _x))
00161         _x = val1.node
00162         length = len(_x)
00163         if python3 or type(_x) == unicode:
00164           _x = _x.encode('utf-8')
00165           length = len(_x)
00166         buff.write(struct.pack('<I%ss'%length, length, _x))
00167       length = len(self.flipped_interface)
00168       buff.write(_struct_I.pack(length))
00169       for val1 in self.flipped_interface:
00170         _x = val1.gateway
00171         length = len(_x)
00172         if python3 or type(_x) == unicode:
00173           _x = _x.encode('utf-8')
00174           length = len(_x)
00175         buff.write(struct.pack('<I%ss'%length, length, _x))
00176         _v1 = val1.rule
00177         _x = _v1.type
00178         length = len(_x)
00179         if python3 or type(_x) == unicode:
00180           _x = _x.encode('utf-8')
00181           length = len(_x)
00182         buff.write(struct.pack('<I%ss'%length, length, _x))
00183         _x = _v1.name
00184         length = len(_x)
00185         if python3 or type(_x) == unicode:
00186           _x = _x.encode('utf-8')
00187           length = len(_x)
00188         buff.write(struct.pack('<I%ss'%length, length, _x))
00189         _x = _v1.node
00190         length = len(_x)
00191         if python3 or type(_x) == unicode:
00192           _x = _x.encode('utf-8')
00193           length = len(_x)
00194         buff.write(struct.pack('<I%ss'%length, length, _x))
00195       length = len(self.pulled_interface)
00196       buff.write(_struct_I.pack(length))
00197       for val1 in self.pulled_interface:
00198         _x = val1.gateway
00199         length = len(_x)
00200         if python3 or type(_x) == unicode:
00201           _x = _x.encode('utf-8')
00202           length = len(_x)
00203         buff.write(struct.pack('<I%ss'%length, length, _x))
00204         _v2 = val1.rule
00205         _x = _v2.type
00206         length = len(_x)
00207         if python3 or type(_x) == unicode:
00208           _x = _x.encode('utf-8')
00209           length = len(_x)
00210         buff.write(struct.pack('<I%ss'%length, length, _x))
00211         _x = _v2.name
00212         length = len(_x)
00213         if python3 or type(_x) == unicode:
00214           _x = _x.encode('utf-8')
00215           length = len(_x)
00216         buff.write(struct.pack('<I%ss'%length, length, _x))
00217         _x = _v2.node
00218         length = len(_x)
00219         if python3 or type(_x) == unicode:
00220           _x = _x.encode('utf-8')
00221           length = len(_x)
00222         buff.write(struct.pack('<I%ss'%length, length, _x))
00223     except struct.error as se: self._check_types(se)
00224     except TypeError as te: self._check_types(te)
00225 
00226   def deserialize(self, str):
00227     """
00228     unpack serialized message in str into this message instance
00229     :param str: byte array of serialized message, ``str``
00230     """
00231     try:
00232       if self.public_interface is None:
00233         self.public_interface = None
00234       if self.flipped_interface is None:
00235         self.flipped_interface = None
00236       if self.pulled_interface is None:
00237         self.pulled_interface = None
00238       end = 0
00239       start = end
00240       end += 4
00241       (length,) = _struct_I.unpack(str[start:end])
00242       start = end
00243       end += length
00244       if python3:
00245         self.name = str[start:end].decode('utf-8')
00246       else:
00247         self.name = str[start:end]
00248       start = end
00249       end += 4
00250       (length,) = _struct_I.unpack(str[start:end])
00251       start = end
00252       end += length
00253       if python3:
00254         self.ip = str[start:end].decode('utf-8')
00255       else:
00256         self.ip = str[start:end]
00257       start = end
00258       end += 1
00259       (self.firewall,) = _struct_B.unpack(str[start:end])
00260       self.firewall = bool(self.firewall)
00261       start = end
00262       end += 4
00263       (length,) = _struct_I.unpack(str[start:end])
00264       self.public_interface = []
00265       for i in range(0, length):
00266         val1 = gateway_msgs.msg.Rule()
00267         start = end
00268         end += 4
00269         (length,) = _struct_I.unpack(str[start:end])
00270         start = end
00271         end += length
00272         if python3:
00273           val1.type = str[start:end].decode('utf-8')
00274         else:
00275           val1.type = str[start:end]
00276         start = end
00277         end += 4
00278         (length,) = _struct_I.unpack(str[start:end])
00279         start = end
00280         end += length
00281         if python3:
00282           val1.name = str[start:end].decode('utf-8')
00283         else:
00284           val1.name = str[start:end]
00285         start = end
00286         end += 4
00287         (length,) = _struct_I.unpack(str[start:end])
00288         start = end
00289         end += length
00290         if python3:
00291           val1.node = str[start:end].decode('utf-8')
00292         else:
00293           val1.node = str[start:end]
00294         self.public_interface.append(val1)
00295       start = end
00296       end += 4
00297       (length,) = _struct_I.unpack(str[start:end])
00298       self.flipped_interface = []
00299       for i in range(0, length):
00300         val1 = gateway_msgs.msg.RemoteRule()
00301         start = end
00302         end += 4
00303         (length,) = _struct_I.unpack(str[start:end])
00304         start = end
00305         end += length
00306         if python3:
00307           val1.gateway = str[start:end].decode('utf-8')
00308         else:
00309           val1.gateway = str[start:end]
00310         _v3 = val1.rule
00311         start = end
00312         end += 4
00313         (length,) = _struct_I.unpack(str[start:end])
00314         start = end
00315         end += length
00316         if python3:
00317           _v3.type = str[start:end].decode('utf-8')
00318         else:
00319           _v3.type = str[start:end]
00320         start = end
00321         end += 4
00322         (length,) = _struct_I.unpack(str[start:end])
00323         start = end
00324         end += length
00325         if python3:
00326           _v3.name = str[start:end].decode('utf-8')
00327         else:
00328           _v3.name = str[start:end]
00329         start = end
00330         end += 4
00331         (length,) = _struct_I.unpack(str[start:end])
00332         start = end
00333         end += length
00334         if python3:
00335           _v3.node = str[start:end].decode('utf-8')
00336         else:
00337           _v3.node = str[start:end]
00338         self.flipped_interface.append(val1)
00339       start = end
00340       end += 4
00341       (length,) = _struct_I.unpack(str[start:end])
00342       self.pulled_interface = []
00343       for i in range(0, length):
00344         val1 = gateway_msgs.msg.RemoteRule()
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.gateway = str[start:end].decode('utf-8')
00352         else:
00353           val1.gateway = str[start:end]
00354         _v4 = val1.rule
00355         start = end
00356         end += 4
00357         (length,) = _struct_I.unpack(str[start:end])
00358         start = end
00359         end += length
00360         if python3:
00361           _v4.type = str[start:end].decode('utf-8')
00362         else:
00363           _v4.type = str[start:end]
00364         start = end
00365         end += 4
00366         (length,) = _struct_I.unpack(str[start:end])
00367         start = end
00368         end += length
00369         if python3:
00370           _v4.name = str[start:end].decode('utf-8')
00371         else:
00372           _v4.name = str[start:end]
00373         start = end
00374         end += 4
00375         (length,) = _struct_I.unpack(str[start:end])
00376         start = end
00377         end += length
00378         if python3:
00379           _v4.node = str[start:end].decode('utf-8')
00380         else:
00381           _v4.node = str[start:end]
00382         self.pulled_interface.append(val1)
00383       return self
00384     except struct.error as e:
00385       raise genpy.DeserializationError(e) #most likely buffer underfill
00386 
00387 
00388   def serialize_numpy(self, buff, numpy):
00389     """
00390     serialize message with numpy array types into buffer
00391     :param buff: buffer, ``StringIO``
00392     :param numpy: numpy python module
00393     """
00394     try:
00395       _x = self.name
00396       length = len(_x)
00397       if python3 or type(_x) == unicode:
00398         _x = _x.encode('utf-8')
00399         length = len(_x)
00400       buff.write(struct.pack('<I%ss'%length, length, _x))
00401       _x = self.ip
00402       length = len(_x)
00403       if python3 or type(_x) == unicode:
00404         _x = _x.encode('utf-8')
00405         length = len(_x)
00406       buff.write(struct.pack('<I%ss'%length, length, _x))
00407       buff.write(_struct_B.pack(self.firewall))
00408       length = len(self.public_interface)
00409       buff.write(_struct_I.pack(length))
00410       for val1 in self.public_interface:
00411         _x = val1.type
00412         length = len(_x)
00413         if python3 or type(_x) == unicode:
00414           _x = _x.encode('utf-8')
00415           length = len(_x)
00416         buff.write(struct.pack('<I%ss'%length, length, _x))
00417         _x = val1.name
00418         length = len(_x)
00419         if python3 or type(_x) == unicode:
00420           _x = _x.encode('utf-8')
00421           length = len(_x)
00422         buff.write(struct.pack('<I%ss'%length, length, _x))
00423         _x = val1.node
00424         length = len(_x)
00425         if python3 or type(_x) == unicode:
00426           _x = _x.encode('utf-8')
00427           length = len(_x)
00428         buff.write(struct.pack('<I%ss'%length, length, _x))
00429       length = len(self.flipped_interface)
00430       buff.write(_struct_I.pack(length))
00431       for val1 in self.flipped_interface:
00432         _x = val1.gateway
00433         length = len(_x)
00434         if python3 or type(_x) == unicode:
00435           _x = _x.encode('utf-8')
00436           length = len(_x)
00437         buff.write(struct.pack('<I%ss'%length, length, _x))
00438         _v5 = val1.rule
00439         _x = _v5.type
00440         length = len(_x)
00441         if python3 or type(_x) == unicode:
00442           _x = _x.encode('utf-8')
00443           length = len(_x)
00444         buff.write(struct.pack('<I%ss'%length, length, _x))
00445         _x = _v5.name
00446         length = len(_x)
00447         if python3 or type(_x) == unicode:
00448           _x = _x.encode('utf-8')
00449           length = len(_x)
00450         buff.write(struct.pack('<I%ss'%length, length, _x))
00451         _x = _v5.node
00452         length = len(_x)
00453         if python3 or type(_x) == unicode:
00454           _x = _x.encode('utf-8')
00455           length = len(_x)
00456         buff.write(struct.pack('<I%ss'%length, length, _x))
00457       length = len(self.pulled_interface)
00458       buff.write(_struct_I.pack(length))
00459       for val1 in self.pulled_interface:
00460         _x = val1.gateway
00461         length = len(_x)
00462         if python3 or type(_x) == unicode:
00463           _x = _x.encode('utf-8')
00464           length = len(_x)
00465         buff.write(struct.pack('<I%ss'%length, length, _x))
00466         _v6 = val1.rule
00467         _x = _v6.type
00468         length = len(_x)
00469         if python3 or type(_x) == unicode:
00470           _x = _x.encode('utf-8')
00471           length = len(_x)
00472         buff.write(struct.pack('<I%ss'%length, length, _x))
00473         _x = _v6.name
00474         length = len(_x)
00475         if python3 or type(_x) == unicode:
00476           _x = _x.encode('utf-8')
00477           length = len(_x)
00478         buff.write(struct.pack('<I%ss'%length, length, _x))
00479         _x = _v6.node
00480         length = len(_x)
00481         if python3 or type(_x) == unicode:
00482           _x = _x.encode('utf-8')
00483           length = len(_x)
00484         buff.write(struct.pack('<I%ss'%length, length, _x))
00485     except struct.error as se: self._check_types(se)
00486     except TypeError as te: self._check_types(te)
00487 
00488   def deserialize_numpy(self, str, numpy):
00489     """
00490     unpack serialized message in str into this message instance using numpy for array types
00491     :param str: byte array of serialized message, ``str``
00492     :param numpy: numpy python module
00493     """
00494     try:
00495       if self.public_interface is None:
00496         self.public_interface = None
00497       if self.flipped_interface is None:
00498         self.flipped_interface = None
00499       if self.pulled_interface is None:
00500         self.pulled_interface = None
00501       end = 0
00502       start = end
00503       end += 4
00504       (length,) = _struct_I.unpack(str[start:end])
00505       start = end
00506       end += length
00507       if python3:
00508         self.name = str[start:end].decode('utf-8')
00509       else:
00510         self.name = str[start:end]
00511       start = end
00512       end += 4
00513       (length,) = _struct_I.unpack(str[start:end])
00514       start = end
00515       end += length
00516       if python3:
00517         self.ip = str[start:end].decode('utf-8')
00518       else:
00519         self.ip = str[start:end]
00520       start = end
00521       end += 1
00522       (self.firewall,) = _struct_B.unpack(str[start:end])
00523       self.firewall = bool(self.firewall)
00524       start = end
00525       end += 4
00526       (length,) = _struct_I.unpack(str[start:end])
00527       self.public_interface = []
00528       for i in range(0, length):
00529         val1 = gateway_msgs.msg.Rule()
00530         start = end
00531         end += 4
00532         (length,) = _struct_I.unpack(str[start:end])
00533         start = end
00534         end += length
00535         if python3:
00536           val1.type = str[start:end].decode('utf-8')
00537         else:
00538           val1.type = str[start:end]
00539         start = end
00540         end += 4
00541         (length,) = _struct_I.unpack(str[start:end])
00542         start = end
00543         end += length
00544         if python3:
00545           val1.name = str[start:end].decode('utf-8')
00546         else:
00547           val1.name = str[start:end]
00548         start = end
00549         end += 4
00550         (length,) = _struct_I.unpack(str[start:end])
00551         start = end
00552         end += length
00553         if python3:
00554           val1.node = str[start:end].decode('utf-8')
00555         else:
00556           val1.node = str[start:end]
00557         self.public_interface.append(val1)
00558       start = end
00559       end += 4
00560       (length,) = _struct_I.unpack(str[start:end])
00561       self.flipped_interface = []
00562       for i in range(0, length):
00563         val1 = gateway_msgs.msg.RemoteRule()
00564         start = end
00565         end += 4
00566         (length,) = _struct_I.unpack(str[start:end])
00567         start = end
00568         end += length
00569         if python3:
00570           val1.gateway = str[start:end].decode('utf-8')
00571         else:
00572           val1.gateway = str[start:end]
00573         _v7 = val1.rule
00574         start = end
00575         end += 4
00576         (length,) = _struct_I.unpack(str[start:end])
00577         start = end
00578         end += length
00579         if python3:
00580           _v7.type = str[start:end].decode('utf-8')
00581         else:
00582           _v7.type = str[start:end]
00583         start = end
00584         end += 4
00585         (length,) = _struct_I.unpack(str[start:end])
00586         start = end
00587         end += length
00588         if python3:
00589           _v7.name = str[start:end].decode('utf-8')
00590         else:
00591           _v7.name = str[start:end]
00592         start = end
00593         end += 4
00594         (length,) = _struct_I.unpack(str[start:end])
00595         start = end
00596         end += length
00597         if python3:
00598           _v7.node = str[start:end].decode('utf-8')
00599         else:
00600           _v7.node = str[start:end]
00601         self.flipped_interface.append(val1)
00602       start = end
00603       end += 4
00604       (length,) = _struct_I.unpack(str[start:end])
00605       self.pulled_interface = []
00606       for i in range(0, length):
00607         val1 = gateway_msgs.msg.RemoteRule()
00608         start = end
00609         end += 4
00610         (length,) = _struct_I.unpack(str[start:end])
00611         start = end
00612         end += length
00613         if python3:
00614           val1.gateway = str[start:end].decode('utf-8')
00615         else:
00616           val1.gateway = str[start:end]
00617         _v8 = val1.rule
00618         start = end
00619         end += 4
00620         (length,) = _struct_I.unpack(str[start:end])
00621         start = end
00622         end += length
00623         if python3:
00624           _v8.type = str[start:end].decode('utf-8')
00625         else:
00626           _v8.type = str[start:end]
00627         start = end
00628         end += 4
00629         (length,) = _struct_I.unpack(str[start:end])
00630         start = end
00631         end += length
00632         if python3:
00633           _v8.name = str[start:end].decode('utf-8')
00634         else:
00635           _v8.name = str[start:end]
00636         start = end
00637         end += 4
00638         (length,) = _struct_I.unpack(str[start:end])
00639         start = end
00640         end += length
00641         if python3:
00642           _v8.node = str[start:end].decode('utf-8')
00643         else:
00644           _v8.node = str[start:end]
00645         self.pulled_interface.append(val1)
00646       return self
00647     except struct.error as e:
00648       raise genpy.DeserializationError(e) #most likely buffer underfill
00649 
00650 _struct_I = genpy.struct_I
00651 _struct_B = struct.Struct("<B")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


gateway_msgs
Author(s): Jihoon
autogenerated on Tue Jan 15 2013 17:43:49