Macros | |
#define | SENF_FNP(ret, fn, args) |
Get function pointer. More... | |
#define | SENF_MEMFNP(ret, cls, fn, args) |
Get function pointer. More... | |
#define | SENF_MEMBINDFNP(ret, cls, fn, args) |
Get function pointer. More... | |
Functions | |
template<typename R , typename T , typename Args > | |
boost::function< R(Args)> | senf::membind (R(T::*fn)(Args), T *ob) |
Build bound member function object. More... | |
The membind() family of function templates simplifies the creation of simple bound member function pointers:
senf::membind() takes either a pointer or an object as second argument. When passing an object, <em>that object will be copied into the bound member function returned.</em>
#define SENF_FNP | ( | ret, | |
fn, | |||
args | |||
) |
Get function pointer.
This macro will get a function pointer of a possibly overloaded function:
The macro arguments are the return type, function name and function arguments just as specified in the declaration. This macro only works for functions at namespace scope or for class static functions. For member functions use \ref SENF_MEMFNP() or \ref SENF_MEMBINDFNP().
Definition at line 71 of file membind.hh.
#define SENF_MEMBINDFNP | ( | ret, | |
cls, | |||
fn, | |||
args | |||
) |
Get function pointer.
This macro will get a member function pointer of a possibly overloaded member function and bind it to this
returning a boost::function object resembling an ordinary non-member function (see senf::membind()).
The macro arguments are the return type, class name, function name and function arguments just as specified in the declaration. This macro only works for member functions. For namespace scope functions or class static functions use SENF_FNP. This macro returns a bound member function (a \c boost::function object instance). To get an ordinary member function pointer use \ref SENF_MEMFNP(), for non-member function or class static functions use \ref MEM_FNP().
Definition at line 137 of file membind.hh.
#define SENF_MEMFNP | ( | ret, | |
cls, | |||
fn, | |||
args | |||
) |
Get function pointer.
This macro will get a member function pointer of a possibly overloaded member function:
The macro arguments are the return type, class name, function name and function arguments just as specified in the declaration. This macro only works for member functions. For namespace scope functions or class static functions use SENF_FNP. This macro returns a member function pointer. To automatically bind this pointer to \c this, use \ref SENF_MEMBINDFNP() or use senf::membind() to bind to some other instance besides \c this.
Definition at line 100 of file membind.hh.
boost::function<R (Args)> senf::membind | ( | R(T::*)(Args) | fn, |
T * | ob | ||
) |
Build bound member function object.
membind() supports up to 9 function parameters (represented as Args here). The ob argument can be either a pointer or a reference to T
[in] | fn | member function pointer |
[in] | ob | object instance to bind this pointer to |