|
#define | rwtMakeThreadIOUFunctionG(R, function) |
|
#define | rwtMakeThreadIOUFunctionGA1(R, function, A1, a1) |
|
#define | rwtMakeThreadIOUFunctionGA2(R, function, A1, a1, A2, a2) |
|
#define | rwtMakeThreadIOUFunctionGA3(R, function, A1, a1, A2, a2, A3, a3) |
|
#define | rwtMakeThreadIOUFunctionM(Callee, callee, R, function) |
|
#define | rwtMakeThreadIOUFunctionMA1(Callee, callee, R, function, A1, a1) |
|
#define | rwtMakeThreadIOUFunctionMA2(Callee, callee, R, function, A1, a1, A2, a2) |
|
#define | rwtMakeThreadIOUFunctionMA3(Callee, callee, R, function, A1, a1, A2, a2, A3, a3) |
|
|
template<class Callee , class R , class A1 , class AA1 > |
RWTThreadIOUFunction< R > | rwtMakeThreadIOUFunction (Callee &callee, R(Callee::*function)(A1), AA1 a1) |
|
template<class Callee , class R , class A1 , class A2 , class AA1 , class AA2 > |
RWTThreadIOUFunction< R > | rwtMakeThreadIOUFunction (Callee &callee, R(Callee::*function)(A1, A2), AA1 a1, AA2 a2) |
|
template<class Callee , class R , class A1 , class A2 , class A3 , class AA1 , class AA2 , class AA3 > |
RWTThreadIOUFunction< R > | rwtMakeThreadIOUFunction (Callee &callee, R(Callee::*function)(A1, A2, A3), AA1 a1, AA2 a2, AA3 a3) |
|
template<class Callee , class R > |
RWTThreadIOUFunction< R > | rwtMakeThreadIOUFunction (Callee &callee, R(Callee::*function)(void)) |
|
template<class R , class A1 , class AA1 > |
RWTThreadIOUFunction< R > | rwtMakeThreadIOUFunction (R(*function)(A1), AA1 a1) |
|
template<class R , class A1 , class A2 , class AA1 , class AA2 > |
RWTThreadIOUFunction< R > | rwtMakeThreadIOUFunction (R(*function)(A1, A2), AA1 a1, AA2 a2) |
|
template<class R , class A1 , class A2 , class A3 , class AA1 , class AA2 , class AA3 > |
RWTThreadIOUFunction< R > | rwtMakeThreadIOUFunction (R(*function)(A1, A2, A3), AA1 a1, AA2 a2, AA3 a3) |
|
template<class R > |
RWTThreadIOUFunction< R > | rwtMakeThreadIOUFunction (R(*function)(void)) |
|
- Header File
#include <rw/thread/rwtMakeThreadIOUFunction.h>
The easiest way to create a thread with the Threads Module is to begin with rwtMakeThreadIOUFunction(). By supplying a global or member function pointer, you control what your thread will do after starting. If you wish your thread to start by calling a function that takes arguments, rwtMakeThreadIOUFunction() allows you to specify the values that should be passed to that function. Note that threads created with rwtMakeThreadIOUFunction() allow you to extract the return value from the associated function. This distinguishes them from those created by rwtMakeThreadFunction(), which do not.
rwtMakeThreadIOUFunction() comes in two flavors. First, there is a set of overloaded global function templates. Since not all compilers are able to handle templates to the degree required by these functions, we also provide a corresponding set of macros. The template functions are slightly easier to use and you only have to remember one name. The macros are more portable but they do require more arguments; and as we cannot overload macros, each must have a unique name.
In naming the macros we have employed a convention to make the names easier to remember. Each name begins with rwtMakeThreadIOUFunction
, which will be followed by either a G
if the macro is expecting a global function, or an M
if it is expecting a member function. At that point the name is complete if the associated global or member function takes no arguments. Otherwise we add one of A1
, A2
, or A3
for functions with 1, 2, or 3 arguments respectively. For example, you will use macro rwtMakeThreadIOUFunctionG() to create a thread that calls a global function that takes no arguments. The macro rwtMakeThreadIOUFunctionMA2() will create a thread that calls a member function that takes two arguments.
- Example
Example Using Templates
class A {
public:
int bar(char);
};
A a;
int foo(double, long);
Handle class for functor-based threaded runnable objects.
Definition RWTThreadIOUFunction.h:125
RWTThreadIOUFunction< R > rwtMakeThreadIOUFunction(R(*function)(void))
Definition rwtMakeThreadIOUFunction.h:56
Example Using Macros
class A {
public:
int bar(char);
};
A a;
int foo(double, long);
#define rwtMakeThreadIOUFunctionMA1(Callee, callee, R, function, A1, a1)
Definition rwtMakeThreadIOUFunction.h:238
#define rwtMakeThreadIOUFunctionGA2(R, function, A1, a1, A2, a2)
Definition rwtMakeThreadIOUFunction.h:115
Macros (for Use With Global Functions)
The macros in this section use the following naming conventions for the macro arguments:
R | Type name of the function return value. |
function | Global function pointer. |
A1 | Type name of the first argument. |
a1 | Expression that can be converted to an instance of A1 . |
A2 | Type name of the second argument. |
a2 | Expression that can be converted to an instance of A2 . |
A3 | Type name of the third argument. |
a3 | Expression that can be converted to an instance of A3 . |
Macros (for Use With Member Functions)
The macros in this section use the following naming conventions for the macro arguments:
Callee | Type name of the function's class. |
callee | Expression that results in a reference to a Callee instance. |
R | Type name of the function return value. |
function | Pointer to member function of class Callee. |
A1 | Type name of the first argument. |
a1 | Expression that can be converted to an instance of A1 . |
A2 | Type name of the second argument. |
a2 | Expression that can be converted to an instance of A2 . |
A3 | Type name of the second argument. |
a3 | Expression that can be converted to an instance of A3 . |
- See also
- RWTThreadIOUFunction
◆ rwtMakeThreadIOUFunctionG
#define rwtMakeThreadIOUFunctionG |
( |
| R, |
|
|
| function ) |
◆ rwtMakeThreadIOUFunctionGA1
#define rwtMakeThreadIOUFunctionGA1 |
( |
| R, |
|
|
| function, |
|
|
| A1, |
|
|
| a1 ) |
◆ rwtMakeThreadIOUFunctionGA2
#define rwtMakeThreadIOUFunctionGA2 |
( |
| R, |
|
|
| function, |
|
|
| A1, |
|
|
| a1, |
|
|
| A2, |
|
|
| a2 ) |
◆ rwtMakeThreadIOUFunctionGA3
#define rwtMakeThreadIOUFunctionGA3 |
( |
| R, |
|
|
| function, |
|
|
| A1, |
|
|
| a1, |
|
|
| A2, |
|
|
| a2, |
|
|
| A3, |
|
|
| a3 ) |
◆ rwtMakeThreadIOUFunctionM
#define rwtMakeThreadIOUFunctionM |
( |
| Callee, |
|
|
| callee, |
|
|
| R, |
|
|
| function ) |
◆ rwtMakeThreadIOUFunctionMA1
#define rwtMakeThreadIOUFunctionMA1 |
( |
| Callee, |
|
|
| callee, |
|
|
| R, |
|
|
| function, |
|
|
| A1, |
|
|
| a1 ) |
◆ rwtMakeThreadIOUFunctionMA2
#define rwtMakeThreadIOUFunctionMA2 |
( |
| Callee, |
|
|
| callee, |
|
|
| R, |
|
|
| function, |
|
|
| A1, |
|
|
| a1, |
|
|
| A2, |
|
|
| a2 ) |
◆ rwtMakeThreadIOUFunctionMA3
#define rwtMakeThreadIOUFunctionMA3 |
( |
| Callee, |
|
|
| callee, |
|
|
| R, |
|
|
| function, |
|
|
| A1, |
|
|
| a1, |
|
|
| A2, |
|
|
| a2, |
|
|
| A3, |
|
|
| a3 ) |
◆ rwtMakeThreadIOUFunction() [1/8]
template<class Callee , class R , class A1 , class AA1 >
RWTThreadIOUFunction< R > rwtMakeThreadIOUFunction |
( |
Callee & | callee, |
|
|
R(Callee::* | function )(A1), |
|
|
AA1 | a1 ) |
|
inline |
◆ rwtMakeThreadIOUFunction() [2/8]
template<class Callee , class R , class A1 , class A2 , class AA1 , class AA2 >
RWTThreadIOUFunction< R > rwtMakeThreadIOUFunction |
( |
Callee & | callee, |
|
|
R(Callee::* | function )(A1, A2), |
|
|
AA1 | a1, |
|
|
AA2 | a2 ) |
|
inline |
◆ rwtMakeThreadIOUFunction() [3/8]
template<class Callee , class R , class A1 , class A2 , class A3 , class AA1 , class AA2 , class AA3 >
RWTThreadIOUFunction< R > rwtMakeThreadIOUFunction |
( |
Callee & | callee, |
|
|
R(Callee::* | function )(A1, A2, A3), |
|
|
AA1 | a1, |
|
|
AA2 | a2, |
|
|
AA3 | a3 ) |
|
inline |
- Deprecated
- As of SourcePro 12.5, use RWTThreadIOUFunction::make(rwBind(function, callee, a1, a2, a3)) instead.
Creates an RWTThreadIOUFunction set to call callee.function(a1,a2,a3)
. a1, a2, and a3 must be convertible to instances of types A1
, A2
, and A3
respectively.
◆ rwtMakeThreadIOUFunction() [4/8]
template<class Callee , class R >
RWTThreadIOUFunction< R > rwtMakeThreadIOUFunction |
( |
Callee & | callee, |
|
|
R(Callee::* | function )(void) ) |
|
inline |
◆ rwtMakeThreadIOUFunction() [5/8]
template<class R , class A1 , class AA1 >
◆ rwtMakeThreadIOUFunction() [6/8]
template<class R , class A1 , class A2 , class AA1 , class AA2 >
◆ rwtMakeThreadIOUFunction() [7/8]
template<class R , class A1 , class A2 , class A3 , class AA1 , class AA2 , class AA3 >
RWTThreadIOUFunction< R > rwtMakeThreadIOUFunction |
( |
R(* | function )(A1, A2, A3), |
|
|
AA1 | a1, |
|
|
AA2 | a2, |
|
|
AA3 | a3 ) |
|
inline |
- Deprecated
- As of SourcePro 12.5, use RWTThreadIOUFunction::make(rwBind(function, a1, a2, a3)) instead.
Creates an RWTThreadIOUFunction set to call function(a1,a2,a3)
. a1, a2, and a3 must be convertible to instances of types A1
, A2
, and A3
respectively.
◆ rwtMakeThreadIOUFunction() [8/8]