Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

DataDistributorPoll Class Reference

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

List of all members.

Public Member Functions

 __init__ (name, length=641024)
 start ()
 stop ()
 receive ()


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 25 of file DataDistributorPoll.py.


Member Function Documentation

__init__ name  ,
length  = 641024
 

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.

receive  ) 
 

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.

start  ) 
 

Start the polling thread.

stop  ) 
 

Stop the polling thread.


The documentation for this class was generated from the following file:
Generated on Fri Jul 21 13:26:41 2006 for LATTE R04-12-00 by doxygen 1.4.3