Global Functions and Macros
rwtMakeIOUCallback() rwtMakeIOUCallbackG() |
rwtMakeIOUCallbackGA1() rwtMakeIOUCallbackGA2() |
rwtMakeIOUCallbackM() rwtMakeIOUCallbackMA1() |
rwtMakeIOUCallbackMA2() |
#include <rw/itc/rwtMakeIOUCallback.h> void cbFunc(RWTIOUResult<int> r); RWTIOUResult<int> res = ...; res.addCallback(rwtMakeIOUCallback(cbFunc));
The rwtMakeIOUCallback() helper functions and macros create functors that may be passed to the addCallback() method of an RWTIOUResult<R>. The functor may be created from functions that accept a first argument that is compatible with an RWTIOUResult<R>.
rwtMakeIOUCallback 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 because we cannot overload macros, each must have a unique name.
void function(RWTIOUResult<int> result); RWTIOUResult<int> iouResult = ...; iouResult.addCallback(rwtMakeIOUCallback(function));
void function(RWTIOUResult<int> result); RWTIOUResult<int> iouResult = ...; iouResult.addCallback(rwtMakeIOUCallbackG(void,function));
template <class Redeemable> inline RWTFunctor1< RWEscrowHandle<Redeemable> > rwtMakeIOUCallback(void (*function)(RWTIOUResult<Redeemable>))
Template function to create an IOU callback functor from a global function, function(), which takes an RWTIOUResult<Redeemable> as its only argument.
template <class Redeemable, class Callee> inline RWTFunctor1< RWEscrowHandle<Redeemable> > rwtMakeIOUCallback(Callee& callee, void (Callee::*function)(RWTIOUResult<Redeemable>))
Template function to create an IOU callback functor from a member function, callee.function(), which takes an RWTIOUResult<Redeemable> as its only argument.
template<class Redeemable, class A1> inline RWTFunctor1< RWEscrowHandle<Redeemable> > rwtMakeIOUCallback(void (*function)(RWTIOUResult<Redeemable>, A1), A1 a1)
Template function to create an IOU callback functor from a global function, function(a1), which takes an RWTIOUResult<Redeemable> and one additional argument.
template <class Redeemable, class Callee, class A1> inline RWTFunctor1< RWEscrowHandle<Redeemable> > rwtMakeIOUCallback(Callee& callee, void (Callee::*function)(RWTIOUResult<Redeemable>, A1), A1 a1)
Template function to create an IOU callback functor from a member function, callee.function(a1), which takes an RWTIOUResult<Redeemable> and one additional argument.
template<class Redeemable, class A1, class A2> inline RWTFunctor1< RWEscrowHandle<Redeemable> > rwtMakeIOUCallback(void (*function)(RWTIOUResult<Redeemable>,A1,A2), A1 a1, A2 a2)
Template function to create an IOU callback functor from a global function, function(a1,a2), which takes an RWTIOUResult<Redeemable> and two additional arguments.
template <class Redeemable, class Callee, class A1, class A2> inline RWTFunctor1< RWEscrowHandle<Redeemable> > rwtMakeIOUCallback(Callee& callee,
void (Callee::*function)(RWTIOUResult<Redeemable>,A1,A2), A1 a1, A2 a2)
Template function to create an IOU callback functor from a member function, callee.function(a1,a2), which takes an RWTIOUResult<Redeemable> and two additional arguments.
The macros in this section use the following naming conventions for the macro arguments:
function | Global function pointer. |
Redeemable | The redeemable type of the RWTIOUResult<R>. |
A1 | Type name of the first additional argument. |
a1 | Expression that can be converted to an instance of A1. |
A2 | Type name of the second additional argument. |
a2 | Expression that can be converted to an instance of A2. |
rwtMakeIOUCallbackG(function, Redeemable)
Creates an IOU callback functor from a global function, function(). function must have signature void(*)(RWTIOUResult<Redeemable>)
rwtMakeIOUCallbackGA1(function, Redeemable, A1, a1);
Creates an IOU callback functor from a global function, function(Redeemable,a1). function must have signature void (*)(RWTIOUResult<Redeemable>,A1).
rwtMakeIOUCallbackGA2(function, Redeemable, A1, a1, A2, a2)
Creates an IOU callback functor from a global function, function(a1,a2). function must have signature void (*)(RWTIOUResult<Redeemable>,A1,A2).
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. |
function | Pointer to member function of class Callee |
Redeemable | The redeemable type of the RWTIOUResult<Redeemable>. |
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. |
rwtMakeIOUCallbackM(Callee,callee,function,Redeemable);
Creates an IOU callback functor from a member function,
callee.function(). function must have signature void (Caller::*)(RWTIOUResult<Redeemable>).
rwtMakeIOUCallbackMA1(Callee,callee,function,Redeemable, A1,a1);
Creates an IOU callback functor from a member function,
callee.function(a1). function must have signature
void (Caller::*)(RWTIOUResult<Redeemable>,A1).
rwtMakeIOUCallbackMA2(Callee,callee,function,Redeemable, A1,a1,A2,a2);
Creates an IOU callback functor from a member function,
callee.function(a1,a2). function must have signature
void (Caller::*)(RWTIOUResult<Redeemable>,A1,A2).
RWTIOUResult<Redeemable>, RWTFunctor1
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.