Public Member Functions | Public Attributes | Private Member Functions | List of all members
rocon_gateway.flipped_interface.FlippedInterface Class Reference

Flipped Interface. More...

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

Public Member Functions

def __init__ (self, firewall, default_rule_blacklist, default_rules, all_targets)
 
def get_flipped_connections (self)
 Accessors for Gateway Info. More...
 
def remove_flip (self, flip)
 
def update (self, connections, remote_gateway_hub_index, unique_name, master)
 Monitoring. More...
 
def update_flip_status (self, flip, status)
 
- Public Member Functions inherited from rocon_gateway.interactive_interface.InteractiveInterface
def __init__ (self, default_rule_blacklist, default_rules, all_targets)
 
def add_all (self, gateway, blacklist)
 
def add_rule (self, remote_rule)
 Rules. More...
 
def find_registration_match (self, remote_gateway, remote_name, remote_node, connection_type)
 Utilities. More...
 
def getLocalRegistrations (self)
 
def getWatchlist (self)
 
def is_matched (self, rule, rule_name, name, node)
 Accessors for Gateway Info. More...
 
def remove_all (self, gateway)
 
def remove_rule (self, remote_rule)
 

Public Attributes

 filtered_flips
 
 firewall
 
 flip_all
 
 flip_status
 
 flipped
 
 unflip_all
 
- Public Attributes inherited from rocon_gateway.interactive_interface.InteractiveInterface
 active
 
 registrations
 
 watchlist
 

Private Member Functions

def _filter_flipped_in_interfaces (self, new_flips, flipped_in_registrations)
 
def _generate_flips (self, connection_type, name, node, remote_gateways, unique_name, master)
 Utility Methods. More...
 
def _get_matched_gateways (self, flip_rule, remote_gateways)
 
def _is_registration_in_remote_rule (self, rule, new_flip_remote_rules)
 
def _prepare_flip_status (self, flipped)
 
def _prepare_flips (self, connections, remote_gateways, unique_name, master)
 
def _prune_unavailable_gateway_flips (self, flipped, remote_gateways)
 
def _update_flipped (self, flipped, filtered_flips)
 

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 27 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 35 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 130 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 190 of file flipped_interface.py.

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

Definition at line 298 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 148 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface._prepare_flip_status (   self,
  flipped 
)
private

Definition at line 276 of file flipped_interface.py.

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

Definition at line 261 of file flipped_interface.py.

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

Definition at line 254 of file flipped_interface.py.

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

Definition at line 124 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface.get_flipped_connections (   self)

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 313 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface.remove_flip (   self,
  flip 
)
  Removes a flip, so that it can be resent as necessary

Definition at line 175 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 sets.

  @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 64 of file flipped_interface.py.

def rocon_gateway.flipped_interface.FlippedInterface.update_flip_status (   self,
  flip,
  status 
)
  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 155 of file flipped_interface.py.

Member Data Documentation

rocon_gateway.flipped_interface.FlippedInterface.filtered_flips

Definition at line 55 of file flipped_interface.py.

rocon_gateway.flipped_interface.FlippedInterface.firewall

Definition at line 51 of file flipped_interface.py.

rocon_gateway.flipped_interface.FlippedInterface.flip_all

Definition at line 57 of file flipped_interface.py.

rocon_gateway.flipped_interface.FlippedInterface.flip_status

Definition at line 56 of file flipped_interface.py.

rocon_gateway.flipped_interface.FlippedInterface.flipped

Definition at line 54 of file flipped_interface.py.

rocon_gateway.flipped_interface.FlippedInterface.unflip_all

Definition at line 58 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 Mon Jun 10 2019 14:40:10