#include <ThreadFunctor.h>
Inheritance diagram for vpr::ThreadMemberFunctor:


Public Types | |
| typedef void(OBJ_TYPE::* | FunPtr )(void *) |
Public Methods | |
| ThreadMemberFunctor (OBJ_TYPE *theObject, FunPtr func, void *arg=NULL) | |
| virtual | ~ThreadMemberFunctor () |
| void | operator() (void *arg) |
| Overloaded operator() used for invoking the function encapsulated by this object. More... | |
| void | operator() (void) |
| Overloaded operator() used for invoking the function encapsulated by this object. More... | |
| void | setArg (void *arg) |
| Sets the argument passed to the encapsulated function. More... | |
| bool | isValid () |
| Function to see if we have a valid functor. More... | |
This class allows non-static class member functions to be used as functors.
Definition at line 102 of file ThreadFunctor.h.
|
|||||
|
Definition at line 105 of file ThreadFunctor.h. Referenced by vpr::ThreadMemberFunctor< ThreadPosix >::ThreadMemberFunctor. |
|
||||||||||||||||||||
|
Definition at line 107 of file ThreadFunctor.h.
00108 {
00109 mObject = theObject;
00110 mFunction = func;
00111 mArgument = arg;
00112 }
|
|
|||||||||
|
Definition at line 114 of file ThreadFunctor.h.
00115 {
00116 mObject = (OBJ_TYPE*)0xDEADBEEF;
00117 //mFunction = 0xDEADBEEF;
00118 mArgument = (void*)0xDEADBEEF;
00119 }
|
|
||||||||||
|
Overloaded operator() used for invoking the function encapsulated by this object. This version takes an argument that is passed on to the function.
Implements vpr::BaseThreadFunctor. Definition at line 121 of file ThreadFunctor.h.
00122 {
00123 (mObject->*mFunction)(arg);
00124 }
|
|
||||||||||
|
Overloaded operator() used for invoking the function encapsulated by this object. This version takes no argument and instead passes the argument given when this object was constructed. Implements vpr::BaseThreadFunctor. Definition at line 126 of file ThreadFunctor.h.
00127 {
00128 (mObject->*mFunction)(mArgument);
00129 }
|
|
||||||||||
|
Sets the argument passed to the encapsulated function. This will be used when the function is invoked through the overloaded operator(). Implements vpr::BaseThreadFunctor. Definition at line 131 of file ThreadFunctor.h.
00132 {
00133 mArgument = arg;
00134 }
|
|
|||||||||
|
Function to see if we have a valid functor.
Implements vpr::BaseThreadFunctor. Definition at line 136 of file ThreadFunctor.h.
00137 {
00138 if ( (NULL == mObject) || ((OBJ_TYPE*)0xDEADBEEF == mObject) )
00139 {
00140 vprASSERT( NULL != mObject);
00141 vprASSERT( (OBJ_TYPE*)0xDEADBEEF != mObject);
00142 return false;
00143 }
00144 /*
00145 else if (NULL == mFunction)
00146 {
00147 return false;
00148 }
00149 */
00150 else
00151 {
00152 return true;
00153 }
00154 }
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002