SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
rwtMakeRunnableFunction Macros and Functions

Macros

#define rwtMakeRunnableFunctionG(R, function)
 
#define rwtMakeRunnableFunctionGA1(R, function, A1, a1)
 
#define rwtMakeRunnableFunctionGA2(R, function, A1, a1, A2, a2)
 
#define rwtMakeRunnableFunctionGA3(R, function, A1, a1, A2, a2, A3, a3)
 
#define rwtMakeRunnableFunctionM(Callee, callee, R, function)
 
#define rwtMakeRunnableFunctionMA1(Callee, callee, R, function, A1, a1)
 
#define rwtMakeRunnableFunctionMA2(Callee, callee, R, function, A1, a1, A2, a2)
 
#define rwtMakeRunnableFunctionMA3(Callee, callee, R, function, A1, a1, A2, a2, A3, a3)
 

Functions

template<class Callee , class R , class A1 , class AA1 >
RWRunnableFunction rwtMakeRunnableFunction (Callee &callee, R(Callee::*function)(A1), AA1 a1)
 
template<class Callee , class R , class A1 , class A2 , class AA1 , class AA2 >
RWRunnableFunction rwtMakeRunnableFunction (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 >
RWRunnableFunction rwtMakeRunnableFunction (Callee &callee, R(Callee::*function)(A1, A2, A3), AA1 a1, AA2 a2, AA3 a3)
 
template<class Callee , class R >
RWRunnableFunction rwtMakeRunnableFunction (Callee &callee, R(Callee::*function)(void))
 
template<class R , class A1 , class AA1 >
RWRunnableFunction rwtMakeRunnableFunction (R(*function)(A1), AA1 a1)
 
template<class R , class A1 , class A2 , class AA1 , class AA2 >
RWRunnableFunction rwtMakeRunnableFunction (R(*function)(A1, A2), AA1 a1, AA2 a2)
 
template<class R , class A1 , class A2 , class A3 , class AA1 , class AA2 , class AA3 >
RWRunnableFunction rwtMakeRunnableFunction (R(*function)(A1, A2, A3), AA1 a1, AA2 a2, AA3 a3)
 
template<class R >
RWRunnableFunction rwtMakeRunnableFunction (R(*function)(void))
 

Detailed Description

Header File
#include <rw/thread/rwtMakeRunnableFunction.h>

rwtMakeRunnableFunction() creates an instance of RWRunnableFunction directly from a global or member function pointer. The easiest way to create a runnable object with the Threads Module is to begin with rwtMakeRunnableFunction(). By supplying a global or member function pointer you control what your runnable will do after starting. If you wish your runnable to start by calling a function that takes arguments, rwtMakeRunnableFunction() allows you to specify the values that should be passed to that function. Note that runnables created with rwtMakeRunnableFunction() will ignore any return values from the associated function. To create runnables from which you can extract a return value, see rwtMakeRunnableIOUFunction().

rwtMakeRunnableFunction() 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 rwtMakeRunnableFunction, 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 rwtMakeRunnableFunctionG() to create a runnable that calls a global function that takes no arguments. The macro rwtMakeRunnableFunctionMA2() will create a runnable that calls a member function that takes two arguments.

Example

Example Using Templates

class A {
public:
int bar(char); // Member function with 1 argument
};
A a; // an instance of class A
int foo(double, long); // Global function with 2 arguments
// Create an RWRunnableFunction set to call foo(3.14,11):
// Create an RWRunnableFunction set to call a.bar(`x'):
Handle class for functor-based, runnable objects.
Definition RWRunnableFunction.h:86
RWRunnableFunction rwtMakeRunnableFunction(R(*function)(void))
Definition rwtMakeRunnableFunction.h:56

Example Using Macros

class A {
public:
int bar(char); // Member function with 1 argument
};
A a; // an instance of class A
int foo(double, long); // Global function with 2 arguments
// Create an RWRunnableFunction set to call foo(3.14,11):
rwtMakeRunnableFunctionGA2(int, foo, double, 3.14, long, 11);
// Create an RWRunnableFunction set to call a.bar(`x'):
= rwtMakeRunnableFunctionMA1(A, a, int, &A::bar, char, `x');
#define rwtMakeRunnableFunctionGA2(R, function, A1, a1, A2, a2)
Definition rwtMakeRunnableFunction.h:113
#define rwtMakeRunnableFunctionMA1(Callee, callee, R, function, A1, a1)
Definition rwtMakeRunnableFunction.h:236

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
RWRunnableFunction

Macro Definition Documentation

◆ rwtMakeRunnableFunctionG

#define rwtMakeRunnableFunctionG ( R,
function )
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(function) instead.

Creates an RWRunnableFunction set to call function(). function must have signature R (*)(void)

◆ rwtMakeRunnableFunctionGA1

#define rwtMakeRunnableFunctionGA1 ( R,
function,
A1,
a1 )
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, a1)) instead.

Creates an RWRunnableFunction set to call function(a1). function must have signature R (*)(A1)

◆ rwtMakeRunnableFunctionGA2

#define rwtMakeRunnableFunctionGA2 ( R,
function,
A1,
a1,
A2,
a2 )
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, a1, a2)) instead.

Creates an RWRunnableFunction set to call function(a1,a2). function must have signature R (*)(A1,A2)

◆ rwtMakeRunnableFunctionGA3

#define rwtMakeRunnableFunctionGA3 ( R,
function,
A1,
a1,
A2,
a2,
A3,
a3 )
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, a1, a2, a3)) instead.

Creates an RWRunnableFunction set to call function(a1,a2,a3). function must have signature R (*)(A1,A2,A3)

◆ rwtMakeRunnableFunctionM

#define rwtMakeRunnableFunctionM ( Callee,
callee,
R,
function )
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, callee)) instead.

Creates an RWRunnableFunction set to call callee.function(). function must have signature R (Caller::*)(void).

◆ rwtMakeRunnableFunctionMA1

#define rwtMakeRunnableFunctionMA1 ( Callee,
callee,
R,
function,
A1,
a1 )
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, callee, a1)) instead.

Creates an RWRunnableFunction set to call callee.function(a1). function must have signature R (Caller::*)(A1).

◆ rwtMakeRunnableFunctionMA2

#define rwtMakeRunnableFunctionMA2 ( Callee,
callee,
R,
function,
A1,
a1,
A2,
a2 )
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, callee, a1, a2)) instead.

Creates an RWRunnableFunction set to call callee.function(a1,a2). function must have signature R (Caller::*)(A1,A2).

◆ rwtMakeRunnableFunctionMA3

#define rwtMakeRunnableFunctionMA3 ( Callee,
callee,
R,
function,
A1,
a1,
A2,
a2,
A3,
a3 )
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, callee, a1, a2, a3)) instead.

Creates an RWRunnableFunction set to call callee.function(a1,a2,a3). function must have signature R (Caller::*)(A1,A2,A3).

Function Documentation

◆ rwtMakeRunnableFunction() [1/8]

template<class Callee , class R , class A1 , class AA1 >
RWRunnableFunction rwtMakeRunnableFunction ( Callee & callee,
R(Callee::* function )(A1),
AA1 a1 )
inline
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, callee, a1)) instead.

Creates an RWRunnableFunction set to call callee.function(a1). Parameter a1 must be convertible to an instance of A1.

◆ rwtMakeRunnableFunction() [2/8]

template<class Callee , class R , class A1 , class A2 , class AA1 , class AA2 >
RWRunnableFunction rwtMakeRunnableFunction ( Callee & callee,
R(Callee::* function )(A1, A2),
AA1 a1,
AA2 a2 )
inline
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, callee, a1, a2)) instead.

Creates an RWRunnableFunction set to call callee.function(a1,a2). Parameters a1 and a2 must be convertible to instances of types A1 and A2 respectively.

◆ rwtMakeRunnableFunction() [3/8]

template<class Callee , class R , class A1 , class A2 , class A3 , class AA1 , class AA2 , class AA3 >
RWRunnableFunction rwtMakeRunnableFunction ( Callee & callee,
R(Callee::* function )(A1, A2, A3),
AA1 a1,
AA2 a2,
AA3 a3 )
inline
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, callee, a1, a2, a3)) instead.

Creates an RWRunnableFunction set to call callee.function(a1,a2,a3). Parameters a1, a2, and a3 must be convertible to instances of types A1, A2, and A3 respectively.

◆ rwtMakeRunnableFunction() [4/8]

template<class Callee , class R >
RWRunnableFunction rwtMakeRunnableFunction ( Callee & callee,
R(Callee::* function )(void) )
inline
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, callee)) instead.

Creates an RWRunnableFunction set to call callee.function().

◆ rwtMakeRunnableFunction() [5/8]

template<class R , class A1 , class AA1 >
RWRunnableFunction rwtMakeRunnableFunction ( R(* function )(A1),
AA1 a1 )
inline
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, a1)) instead.

Creates an RWRunnableFunction set to call function(a1). Parameter a1 must be convertible to an instance of type A1.

◆ rwtMakeRunnableFunction() [6/8]

template<class R , class A1 , class A2 , class AA1 , class AA2 >
RWRunnableFunction rwtMakeRunnableFunction ( R(* function )(A1, A2),
AA1 a1,
AA2 a2 )
inline
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, a1, a2)) instead.

Creates an RWRunnableFunction set to call function(a1,a2). Parameters a1 and a2 must be convertible to instances of types A1 and A2 respectively.

◆ rwtMakeRunnableFunction() [7/8]

template<class R , class A1 , class A2 , class A3 , class AA1 , class AA2 , class AA3 >
RWRunnableFunction rwtMakeRunnableFunction ( R(* function )(A1, A2, A3),
AA1 a1,
AA2 a2,
AA3 a3 )
inline
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(rwBind(function, a1, a2, a3)) instead.

Creates an RWRunnableFunction set to call function(a1,a2,a3). Parameters a1, a2, and a3 must be convertible to instances of types A1, A2, and A3 respectively.

◆ rwtMakeRunnableFunction() [8/8]

template<class R >
RWRunnableFunction rwtMakeRunnableFunction ( R(* function )(void))
Deprecated
As of SourcePro 12.5, use RWRunnableFunction::make(function) instead.

Creates an RWRunnableFunction set to call function().

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.