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


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