Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
rocon_python_comms.service_pair_client.ServicePairClient Class Reference

List of all members.

Public Member Functions

def __call__
 Execute Blocking/NonBlocking.
def __init__
 Initialisation.
def wait_for_service

Public Attributes

 ServicePairRequest
 ServicePairResponse
 ServicePairSpec

Private Member Functions

def _internal_callback
def _make_blocking_call
 Private Support Methods.
def _make_non_blocking_call
def _timer_callback

Private Attributes

 _lock
 _publisher
 _request_handlers
 _subscriber

Static Private Attributes

list __slots__

Detailed Description

  The client side of a pubsub service pair.

Definition at line 63 of file service_pair_client.py.


Constructor & Destructor Documentation

def rocon_python_comms.service_pair_client.ServicePairClient.__init__ (   self,
  name,
  ServicePairSpec 
)

Initialisation.

  @param name : resource name of service pair (e.g. testies for pair topics testies/request, testies/response)
  @type str
  @param ServicePairSpec : the pair type (e.g. rocon_service_pair_msgs.msg.TestiesPair)
  @type str

Definition at line 81 of file service_pair_client.py.


Member Function Documentation

def rocon_python_comms.service_pair_client.ServicePairClient.__call__ (   self,
  msg,
  timeout = None,
  callback = None,
  error_callback = None 
)

Execute Blocking/NonBlocking.

  Initiates and executes the client request to the server. The type of arguments
  supplied determines whether to apply blocking or non-blocking behaviour.

  @param msg : the request message
  @type <name>Request

  @param timeout : time to wait for data
  @type rospy.Duration

  @param callback : user callback invoked for responses of non-blocking calls
  @type method with arguments (uuid_msgs.UniqueID, <name>Response)

  @return msg/id : for blocking calls it is the response message, for non-blocking it is the unique id
  @rtype <name>Response/uuid_msgs.UniqueID

Definition at line 124 of file service_pair_client.py.

  @param msg : message returned from the server (with pair id etc)
  @type self.ServicePairResponse

Definition at line 215 of file service_pair_client.py.

def rocon_python_comms.service_pair_client.ServicePairClient._make_blocking_call (   self,
  request_handler,
  msg,
  timeout 
) [private]

Private Support Methods.

  @param request_handler : information and event handler for the request
  @type RequestHandler

  @param msg : the request pair message structure
  @type self.ServicePairRequest

Definition at line 158 of file service_pair_client.py.

def rocon_python_comms.service_pair_client.ServicePairClient._make_non_blocking_call (   self,
  request_handler,
  msg,
  timeout 
) [private]
  @param request_handler : a copy of information and event handler for the request (used for the timer)
  @type RequestHandler

  @param msg : the request pair message structure
  @type self.ServicePairRequest

Definition at line 178 of file service_pair_client.py.

def rocon_python_comms.service_pair_client.ServicePairClient._timer_callback (   self,
  unused_event,
  request_handler 
) [private]
  Handle a timeout for non-blocking requests. This will call the user's defined error callback function
  (with args: (uuid_msgs.UniqueID, str)).

  @param event : regular rospy timer event object (not used)

  @param request_handler : a copy of the handler that gets bound when this callback is passed into the timer
  @type NonBlockingRequestHandler

  @todo respond on the error callback.

Definition at line 192 of file service_pair_client.py.

  Waits for the service pair server to appear.

  @param timeout : time to wait for data
  @type rospy.Duration

  @raise ROSException: if specified timeout is exceeded
  @raise ROSInterruptException: if shutdown interrupts wait

Definition at line 100 of file service_pair_client.py.


Member Data Documentation

Initial value:
[
            '_publisher',
            '_subscriber',
            '_request_handlers',  # initiate, track and execute requests with these { hex string ids : dic of RequestHandler objects (Blocking/NonBlocking) }
            'ServicePairSpec',
            'ServicePairRequest',
            'ServicePairResponse',
            '_lock'               # prevent race conditions in handling of non-blocking callbacks and timeouts.
        ]

Definition at line 67 of file service_pair_client.py.

Definition at line 86 of file service_pair_client.py.

Definition at line 86 of file service_pair_client.py.

Definition at line 86 of file service_pair_client.py.

Definition at line 86 of file service_pair_client.py.

Definition at line 86 of file service_pair_client.py.

Definition at line 86 of file service_pair_client.py.

Definition at line 86 of file service_pair_client.py.


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


rocon_python_comms
Author(s): Daniel Stonier
autogenerated on Fri May 2 2014 10:35:42