Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AsyncUtility Class Reference

#include <asyncUtility.h>

Inheritance diagram for AsyncUtility:

Loader List of all members.

Public Member Functions

void set_frequency (float frequency)
 Fraction of a second.

float get_frequency (void) const
void create_thread (void)
 AsyncUtility (float frequency=0.2)
virtual ~AsyncUtility (void)

Protected Member Functions

void destroy_thread (void)
void callback (void)
 This is the main body of the sub-thread.

virtual bool process_request (void)=0
void nap (void) const

Static Protected Member Functions

void * st_callback (void *arg)
 This is a static wrapper around the callback() method, below.


Protected Attributes

int _next_token
bool _shutdown
bool _threaded
float _frequency
bool _threads_enabled

Constructor & Destructor Documentation

AsyncUtility::AsyncUtility float  frequency = 0.2  ) 
 

Definition at line 47 of file asyncUtility.cxx.

AsyncUtility::~AsyncUtility void   )  [virtual]
 

Definition at line 66 of file asyncUtility.cxx.

References _threaded, _threads_enabled, create, and st_callback().


Member Function Documentation

void AsyncUtility::callback void   )  [protected]
 

This is the main body of the sub-thread.

It waits forever for a request to show up, and then serves it.

Definition at line 160 of file asyncUtility.cxx.

void AsyncUtility::create_thread void   ) 
 

Definition at line 80 of file asyncUtility.cxx.

References _shutdown, and _threaded.

void AsyncUtility::destroy_thread void   )  [protected]
 

Definition at line 99 of file asyncUtility.cxx.

Referenced by Loader::Loader().

float AsyncUtility::get_frequency void   )  const [inline]
 

Definition at line 43 of file asyncUtility.I.

void AsyncUtility::nap void   )  const [protected]
 

Definition at line 179 of file asyncUtility.cxx.

virtual bool AsyncUtility::process_request void   )  [protected, pure virtual]
 

Implemented in Loader.

void AsyncUtility::set_frequency float  frequency  )  [inline]
 

Fraction of a second.

Definition at line 31 of file asyncUtility.I.

References _frequency, and INLINE.

void * AsyncUtility::st_callback void *  arg  )  [static, protected]
 

This is a static wrapper around the callback() method, below.

It's static just so we can pass it to the thread-creation function. In addition, the function has a void* return type even though we don't actually return anything. This is necessary because ipc assumes a function that does not return anything indicates that the associated thread should be created as unjoinable (detached).

Definition at line 141 of file asyncUtility.cxx.

Referenced by ~AsyncUtility().


Member Data Documentation

float AsyncUtility::_frequency [protected]
 

Definition at line 68 of file asyncUtility.h.

Referenced by set_frequency().

int AsyncUtility::_next_token [protected]
 

Definition at line 65 of file asyncUtility.h.

bool AsyncUtility::_shutdown [protected]
 

Definition at line 66 of file asyncUtility.h.

Referenced by create_thread().

bool AsyncUtility::_threaded [protected]
 

Definition at line 67 of file asyncUtility.h.

Referenced by create_thread(), and ~AsyncUtility().

bool AsyncUtility::_threads_enabled [protected]
 

Definition at line 69 of file asyncUtility.h.

Referenced by ~AsyncUtility().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:47:27 2003 for Panda by doxygen1.3