Public Member Functions | Public Attributes | Private Member Functions
rocon_gateway.flipped_interface.FlippedInterface Class Reference

Flipped Interface. More...

Inheritance diagram for rocon_gateway.flipped_interface.FlippedInterface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def get_flipped_connections
 Accessors for Gateway Info.
def remove_flip
def update
 Monitoring.
def update_flip_status

Public Attributes

 filtered_flips
 firewall
 flip_all
 flip_status
 flipped
 unflip_all

Private Member Functions

def _filter_flipped_in_interfaces
def _generate_flips
 Utility Methods.
def _get_matched_gateways
def _is_registration_in_remote_rule
def _prepare_flip_status
def _prepare_flips
def _prune_unavailable_gateway_flips
def _update_flipped

Detailed Description

Flipped Interface.

  The flipped interface is the set of rules
  (pubs/subs/services/actions) and rules controlling flips
  to other gateways.

Definition at line 26 of file flipped_interface.py.


Constructor & Destructor Documentation

def rocon_gateway.flipped_interface.FlippedInterface.__init__ (   self,
  firewall,
  default_rule_blacklist,
  default_rules,
  all_targets 
)
  Initialises the flipped interface.

  @param firewall : flag to prevent this gateway from accepting flips
  @type Bool
  @param default_rule_blacklist : used when in flip all mode
  @type dictionary of gateway
  @param default_rules : static rules to flip on startup
  @type gateway_msgs.msg.RemoteRule[]
  @param all_targets : static flip all targets to flip to on startup
  @type string[]

Definition at line 34 of file flipped_interface.py.


Member Function Documentation

def rocon_gateway.flipped_interface.FlippedInterface._filter_flipped_in_interfaces (   self,
  new_flips,
  flipped_in_registrations 
) [private]
  Gateway should not flip out the flipped-in interface.

Definition at line 125 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface._generate_flips (   self,
  connection_type,
  name,
  node,
  remote_gateways,
  unique_name,
  master 
) [private]

Utility Methods.

  Checks if a local rule (obtained from master.get_system_state)
  is a suitable association with any of the rules or patterns. This can
  return multiple matches, since the same local rule
  properties can be multiply flipped to different remote gateways.

  Used in the update() call above that is run in the watcher thread.
  Note, don't need to lock here as the update() function takes care of it.

  @param connection_type : rule type
  @type str : string constant from gateway_msgs.msg.Rule

  @param name : fully qualified topic, service or action name
  @type str

  @param node : ros node name (coming from master.get_system_state)
  @type str

  @param gateways : gateways that are available (registered on the hub)
  @type string

  @param master : local master
  @type rocon_gateway.LocalMaster

  @return all the flip rules that match this local rule
  @return list of RemoteRule objects updated with node names from self.watchlist

Definition at line 184 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface._get_matched_gateways (   self,
  flip_rule,
  remote_gateways 
) [private]

Definition at line 287 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface._is_registration_in_remote_rule (   self,
  rule,
  new_flip_remote_rules 
) [private]

Definition at line 143 of file flipped_interface.py.

Definition at line 268 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface._prepare_flips (   self,
  connections,
  remote_gateways,
  unique_name,
  master 
) [private]

Definition at line 253 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface._prune_unavailable_gateway_flips (   self,
  flipped,
  remote_gateways 
) [private]

Definition at line 246 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface._update_flipped (   self,
  flipped,
  filtered_flips 
) [private]

Definition at line 119 of file flipped_interface.py.

Accessors for Gateway Info.

  Gets the flipped connections list for GatewayInfo consumption.

  @return the list of flip rules that are activated and have been flipped.
  @rtype RemoteRule[]

Definition at line 302 of file flipped_interface.py.

  Removes a flip, so that it can be resent as necessary

Definition at line 169 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface.update (   self,
  connections,
  remote_gateway_hub_index,
  unique_name,
  master 
)

Monitoring.

  Computes a new flipped interface and returns two dictionaries -
  removed and newly added flips so the watcher thread can take
  appropriate action (inform the remote gateways).

  This is run in the watcher thread (warning: take care - other
  additions come from ros service calls in different threads!)

  @param connections : list of all the system state connections from the local master
  @type connection type keyed dictionary of utils.Connection lists.

  @param remote_gateway_hub_index : full gateway-hub database index to parse
  @type gateway hash names keyed into a dic with a list of their hubs

  @param unique_name : this gateway's unique hash name
  @type string

  @param master : local master
  @type rocon_gateway.LocalMaster

  @return new_flips, removed_flips (i.e. those that are no longer on the local master)
  @rtype pair of connection type keyed dictionary of gateway_msgs.msg.Rule lists.

Definition at line 63 of file flipped_interface.py.

  Update the status of a flip from the hub. This should be called right
  after update once self.flipped is established

  @return True if status was indeed changed, False otherwise
  @rtype Boolean

Definition at line 150 of file flipped_interface.py.


Member Data Documentation

Definition at line 46 of file flipped_interface.py.

Definition at line 46 of file flipped_interface.py.

Definition at line 46 of file flipped_interface.py.

Definition at line 46 of file flipped_interface.py.

Definition at line 46 of file flipped_interface.py.

Definition at line 46 of file flipped_interface.py.


The documentation for this class was generated from the following file:


rocon_gateway
Author(s): Daniel Stonier , Jihoon Lee , Piyush Khandelwal
autogenerated on Sat Jun 8 2019 18:48:44