DataDistributorPoll Class Reference

Data distributor client that polls for samples of data. More...

List of all members.

Public Member Functions

def __init__
 DataDistributorPoll constructor.
def start
 Start the polling thread.
def stop
 Stop the polling thread.
def __poll
 Internal routine to drain the data distributor client socket.
def receive
 Receive a sampled value of the data and sender information.

Private Attributes

 __dataCopy


Detailed Description

Data distributor client that polls for samples of data.

Use of this class involves the starting of a thread that constantly receives the data arriving in the base class's socket. Keeping the socket drained of data allows the user of this class to get the most recent data received, thus avoiding getting data with a bursty time structure. Whenever the application calls the receive() method, it gets the most recent data sample. Because of the reference counting method used by Python objects, no copy of the data needs to be made to avoid the data changing from underneath the application. The application can hold onto the data reference as long as it likes. Whenever new data appears a new reference is created, and is possibly deleted before the application gets access to it, leaving any existing reference alone. When the application tries to get access to the latest data, it gets a copy of the most recent reference, and the previous reference is deleted, if it has gone out of scope.

Definition at line 28 of file DataDistributorPoll.py.


Member Function Documentation

def __init__   self,
  name,
  length = 64*1024
 

DataDistributorPoll constructor.

Parameters:
name The name of the type of data that the client wants to receive. See the DataDistributorAddress class.
length The size in bytes of the buffer to allocate for receiving the data. Defaults to 64 KB.

Definition at line 30 of file DataDistributorPoll.py.

def __poll   self  ) 
 

Internal routine to drain the data distributor client socket.

Definition at line 61 of file DataDistributorPoll.py.

def receive   self  ) 
 

Receive a sampled value of the data and sender information.

Returns:
A list of the sampled data and sender's identification string. If the data buffer has not been refreshed since the last call, return None, None.

Definition at line 69 of file DataDistributorPoll.py.

def start   self  ) 
 

Start the polling thread.

Definition at line 45 of file DataDistributorPoll.py.

def stop   self  ) 
 

Stop the polling thread.

Definition at line 53 of file DataDistributorPoll.py.


Member Data Documentation

__dataCopy [private]
 

Definition at line 80 of file DataDistributorPoll.py.


The documentation for this class was generated from the following file:
Generated on Thu Apr 27 20:53:02 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO