
Public Member Functions | |
| mxThreadObject (Class *ptr, int(Class::*f)(Parameter p)) | |
| void | threadRun (Parameter p) |
| void | threadStop () |
| void | threadWait () |
| virtual int | threadExec () |
| const bool | isRunning () const |
Protected Attributes | |
| bool | running |
| int(Class::* | func )(Parameter p) |
| Class * | cls |
| SDL_Thread * | thread_identifier |
| Parameter | code_param |
Definition at line 88 of file mxthread.h.
| mx::mxThreadObject< Class, Parameter >::mxThreadObject | ( | Class * | ptr, | |
| int(Class::*)(Parameter p) | f | |||
| ) | [inline] |
| const bool mx::mxThreadObject< Class, Parameter >::isRunning | ( | ) | const [inline] |
| int mx::mxThreadObject< Class, Parameter >::threadExec | ( | ) | [inline, virtual] |
threadExec
Implements mx::mxExec.
Definition at line 143 of file mxthread.h.
00144 { 00145 00146 if(cls == 0) return 0; // if for some reason you must delete the class that this 00147 // function object points to make sure to set it to zero 00148 // otherwise a segmentation fault will occour 00149 int rt = (*cls.*func)(code_param); 00150 running = false; 00151 return rt; 00152 }
| void mx::mxThreadObject< Class, Parameter >::threadRun | ( | Parameter | p | ) | [inline] |
threadRun with Parameter
| p | paramter to pass to thread |
Definition at line 134 of file mxthread.h.
00135 { 00136 00137 code_param = p; 00138 running = true; 00139 thread_identifier = SDL_CreateThread(thread_execute, (void*)this); 00140 00141 }
| void mx::mxThreadObject< Class, Parameter >::threadStop | ( | ) | [inline] |
threadStop stop thread
Definition at line 160 of file mxthread.h.
00161 { 00162 if(thread_identifier != 0) 00163 SDL_KillThread(thread_identifier); 00164 00165 thread_identifier = 0; 00166 }
| void mx::mxThreadObject< Class, Parameter >::threadWait | ( | ) | [inline] |
1.5.8