VkBackground(3x) VkBackground(3x)
VkBackground - Support for simple work procedure-based background tasks
VkCallbackObject
#include <Vk/VkBackground.h>
PUBLIC PROTOCOL SUMMARY
Constructor/Destructor
VkBackground(void);
void ~VkBackground(void);
Starting and Stopping
void start(void);
void stop(void);
PROTECTED PROTOCOL SUMMARY [Toc] [Back] virtual Boolean timeSlice(void);
VkBackground is an abstract class that provides a simple C++
interface to handling background tasks based on Xt work procedures
(functions that are called whenever there are no events pending in
the application's event queue). VkBackground handles the details of
registering a work procedure and provides a convenient way to
maintain state between calls to the work procedure.
The VkBackground class is intended to be subclassed. Derived classes
must override the timeSlice() member function which behaves just
like an Xt work procedure. This member function is called whenever
no events are pending in the application's event queue. It is
expected to perform a small amount of work and return quickly. The
function must return TRUE if the class has completed its task is
done, or FALSE if the member function should be called again.
The primary for using this class instead of using a work procedure
directly is the ability to store state in class data members between
calls to the timeSlice() function.
Page 1
VkBackground(3x) VkBackground(3x)
FUNCTION DESCRIPTIONS
timeSlice()
virtual Boolean timeSlice(void);
Called whenever no events are pending in the application's event
queue. This function must return quickly and return a value of TRUE
if the class has completed its task and the member function should
not be called again, or FALSE if it should be called again at the
next possible time.
VkBackground() [Toc] [Back]
VkBackground(void);
Initialize a VkBackground object. The constructor does not start the
work procedure.
~VkBackground()
void ~VkBackground(void);
Free all storage associated with a VkBackground object. If this
object's work procedure is currently active, the destructor removes
it.
start()
void start(void);
Start the background task by installing a work procedure.
stop()
void stop(void);
Stop the background task by removing any currently installed work
procedure.
INHERITED MEMBER FUNCTIONS [Toc] [Back]SEE ALSO
ViewKit Programmer's Guide
The X Window System, DEC Press, Bob Sheifler and Jim Gettys
The X Window System Toolkit, DEC Press, Paul Asente and Ralph Swick
The OSF/Motif Programmers Reference, Prentice Hall, OSF
PPPPaaaaggggeeee 2222 [ Back ]
|