Main Page   Modules   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

CmTimeout Class Reference

Timeout (timer) Class. More...

Inheritance diagram for CmTimeout:

CmMGUI

Public Methods

virtual ~CmTimeout (void)
 CmTimeout (CmCallback *owner, VOID_CB cb, CARD32 msec, int continuous=False)
 Timeout constructor.

void start (CARD32 msec)
 Resets the timer to a delay of 'msec' millisecs.

void start (void)
 Resets the timer to the delay specified at creation time.

void stop (void)
 Stops the timer disabling the callback call.


Friends

void _TimeoutCB_ (TIMEOUT_ID id, void *ud)

Detailed Description

Timeout (timer) Class.

MGUI provides this class to allow the program handle timers. Each timer is handled by a callback method that is specified, along with the object owner, in the construct. The object 'owner' is a c++ object belonging to a class derived from CmCallback. The callback 'cb' must be a public method of the class which 'owner' belongs to. When the timeout expires, the CmTimeout object invokes the 'cb' method for the object 'owner'.

For the callback to be called, the application must ensure the event loop is reached periodically by calling one of the standard loop functions: mainLoop , loopWhileFlag , loopWhileEvents


Constructor & Destructor Documentation

virtual CmTimeout::~CmTimeout void    [virtual]
 

CmTimeout::CmTimeout CmCallback   owner,
VOID_CB    cb,
CARD32    msec,
int    continuous = False
 

Timeout constructor.

Parameters:
owner Pointer to the object providing the callback method.
cb Pointer to the callback provided the owner object.
msec Timeout value in millisecs.
continuous Boolean value to specify whether the timer must be restarted automatically on expiration or not.


Member Function Documentation

void CmTimeout::start void   
 

Resets the timer to the delay specified at creation time.

If the timer was already started, the expiring time is recomputed so the callback will be called after the number of millisecs specified at creation time.

void CmTimeout::start CARD32    msec
 

Resets the timer to a delay of 'msec' millisecs.

If the timer was already started, the expiring time is recomputed so the callback will be called after 'msec' millisecs.

void CmTimeout::stop void   
 

Stops the timer disabling the callback call.


Friends And Related Function Documentation

void _TimeoutCB_ TIMEOUT_ID    id,
void *    ud
[friend]
 


Generated on Sun Jun 29 13:03:08 2003 for MGui API by doxygen1.3-rc2