mx::mxTimerObject< Class > Class Template Reference

Inheritance diagram for mx::mxTimerObject< Class >:

mx::mxTimer_Exec

List of all members.

Public Member Functions

 mxTimerObject (Class *ptr, unsigned int(Class::*timer)(unsigned int mil))
void setTimer (unsigned int interval)
void stopTimer ()
virtual unsigned int timerExecution (unsigned int x)

Protected Attributes

Class * cls
unsigned int(Class::* timer_func )(unsigned int mili)
SDL_TimerID tid


Detailed Description

template<typename Class>
class mx::mxTimerObject< Class >

Definition at line 59 of file mxtimer.h.


Constructor & Destructor Documentation

template<typename Class >
mx::mxTimerObject< Class >::mxTimerObject ( Class *  ptr,
unsigned int(Class::*)(unsigned int mil)  timer 
) [inline]

constructor

Parameters:
ptr of type Class
member function from Class

Definition at line 66 of file mxtimer.h.

00067                 {
00068                         ptr = cls;
00069                         timer_func = timer;
00070                         tid = 0;
00071                 }


Member Function Documentation

template<typename Class >
void mx::mxTimerObject< Class >::setTimer ( unsigned int  interval  )  [inline]

setTimer sets the timer

Parameters:
interval interval in milliseconds

Definition at line 90 of file mxtimer.h.

00091         {
00092                 tid = SDL_AddTimer(interval, timer_execution, (void*)this);
00093         }

template<typename Class >
void mx::mxTimerObject< Class >::stopTimer (  )  [inline]

stopTimer stops the timer

Definition at line 97 of file mxtimer.h.

00098         {
00099 
00100                 SDL_RemoveTimer(tid);
00101                 tid = 0;
00102 
00103         }

template<typename Class >
unsigned int mx::mxTimerObject< Class >::timerExecution ( unsigned int  x  )  [inline, virtual]

timerExecution overrided virtual function

Parameters:
x interval

Implements mx::mxTimer_Exec.

Definition at line 106 of file mxtimer.h.

00107         {
00108                 return (*cls.*timer_func)(x);
00109         }


The documentation for this class was generated from the following file:

Generated on Wed Jun 10 14:52:02 2009 for libmx by  doxygen 1.5.8