FrameTimer Class Reference
[User interfaceSingle inited classes]

Handles timers, their intervals and activity. More...

#include <frametimer.h>

Collaboration diagram for FrameTimer:

Collaboration graph
[legend]
List of all members.

Public Types

typedef BasicObject::Callback Callback

Public Member Functions

DECLSPEC FrameTimer ()
DECLSPEC bool setInterval (CbInfo *id, Uint32 iv)
DECLSPEC CbInfoaddCallback (Callback c, BasicObject *d, Uint32 iv)
DECLSPEC void removeCallback (CbInfo *pCb)

Static Public Member Functions

static DECLSPEC FrameTimergetThe ()

Static Public Attributes

static FrameTimerthe

Friends

class UiManager

Classes

struct  CbInfo

Detailed Description

Handles timers, their intervals and activity.

This class can only be used in one variable at a time. It is recommended not to initialize it directly, because it will automatically be constructed with UiManager.

This class supports timer events that occur at most once per frame. After this class was initialized once, you can use it by accessing the static member function getThe().


Member Typedef Documentation

typedef BasicObject::Callback FrameTimer::Callback

This type is used for functions, that are called by the timer


Constructor & Destructor Documentation

FrameTimer::FrameTimer (  ) 

Constructor
You never need it, if you use UiManager


Member Function Documentation

bool FrameTimer::setInterval ( CbInfo id,
Uint32  iv 
)

Changes the interval of an initialized timer

Parameters:
id a pointer to the initialized structure that should be modified
iv the time in msecs to wait between two timer-events, the next event will be called iv msecs from now on.
Returns:
false if id is NULL, otherwise true

FrameTimer::CbInfo * FrameTimer::addCallback ( Callback  c,
BasicObject d,
Uint32  iv 
)

Initializes a new timer

Parameters:
c the function to call, when the time elapsed
d the value of the second param in the callback
iv the interval in msecs between two timer events, the next event occurs iv msecs from now on.
Returns:
a pointer to the structure with the initialized data; it is required to clean it again with removeCallback(). Do not change its properties directly, but by using setInterval().

void FrameTimer::removeCallback ( CbInfo pCb  ) 

Cleans an initialized timer.

Parameters:
pCb pointer to the timer's data, must be the result of addCallback()

FrameTimer * FrameTimer::getThe (  )  [static]

Returns:
a pointer to the FrameTimer-variable, or NULL if not initialized. (There is only one FrameTimer-variable allowed in an application)
Every netrinjo-class that can only exist once at a time, has this static function.


Member Data Documentation

FrameTimer * FrameTimer::the [static]

only accessible in Linux, and equals the result of getThe()

See also:
getThe()


The documentation for this class was generated from the following files:
Generated on Wed May 9 17:36:12 2007 for netrinjo by  doxygen 1.5.1