sigc::compose() combines two or three arbitrary functors.
More...
|
template<typename T_setter, typename T_getter> |
compose1_functor< T_setter, T_getter > | sigc::compose (const T_setter & setter, const T_getter & getter) |
| Creates an adaptor of type sigc::compose1_functor which combines two functors.
|
|
template<typename T_setter, typename T_getter1, typename T_getter2> |
compose2_functor< T_setter, T_getter1, T_getter2 > | sigc::compose (const T_setter & setter, const T_getter1 & getter1, const T_getter2 & getter2) |
| Creates an adaptor of type sigc::compose2_functor which combines three functors.
|
|
sigc::compose() combines two or three arbitrary functors.
On invocation, parameters are passed on to one or two getter functor(s). The return value(s) are then passed on to the setter function.
- Examples:
float square_root(float a) { return sqrtf(a); }
float sum(
float a,
float b) {
return a+b; }
square_root(9))
compose1_functor< T_setter, T_getter > compose(const T_setter &setter, const T_getter &getter)
Creates an adaptor of type sigc::compose1_functor which combines two functors.
Definition compose.h:169
The functor that sigc::compose() returns can be passed directly into sigc::signal::connect() or sigc::signal::connect_first().
- Example:
sigc::signal(float(float, float)> some_signal;
◆ compose() [1/2]
template <typename T_setter, typename T_getter>
compose1_functor< T_setter, T_getter > sigc::compose |
( |
const T_setter & | setter, |
|
|
const T_getter & | getter ) |
|
inline |
Creates an adaptor of type sigc::compose1_functor which combines two functors.
- Parameters
-
setter | Functor that receives the return value of the invocation of getter. |
getter | Functor to invoke from operator()(). |
- Returns
- Adaptor that executes setter with the value returned from invocation of getter.
◆ compose() [2/2]
template <typename T_setter, typename T_getter1, typename T_getter2>
compose2_functor< T_setter, T_getter1, T_getter2 > sigc::compose |
( |
const T_setter & | setter, |
|
|
const T_getter1 & | getter1, |
|
|
const T_getter2 & | getter2 ) |
|
inline |
Creates an adaptor of type sigc::compose2_functor which combines three functors.
- Parameters
-
setter | Functor that receives the return values of the invocation of getter1 and getter2. |
getter1 | Functor to invoke from operator()(). |
getter2 | Functor to invoke from operator()(). |
- Returns
- Adaptor that executes setter with the values return from invocation of getter1 and getter2.