libsigc++ 2.12.0
Classes | Functions
ptr_fun()

ptr_fun() is used to convert a pointer to a function to a functor. More...

Classes

class  sigc::pointer_functor0< T_return >
 pointer_functor0 wraps existing non-member functions with 0 argument(s). More...
 
class  sigc::pointer_functor1< T_arg1, T_return >
 pointer_functor1 wraps existing non-member functions with 1 argument(s). More...
 
class  sigc::pointer_functor2< T_arg1, T_arg2, T_return >
 pointer_functor2 wraps existing non-member functions with 2 argument(s). More...
 
class  sigc::pointer_functor3< T_arg1, T_arg2, T_arg3, T_return >
 pointer_functor3 wraps existing non-member functions with 3 argument(s). More...
 
class  sigc::pointer_functor4< T_arg1, T_arg2, T_arg3, T_arg4, T_return >
 pointer_functor4 wraps existing non-member functions with 4 argument(s). More...
 
class  sigc::pointer_functor5< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_return >
 pointer_functor5 wraps existing non-member functions with 5 argument(s). More...
 
class  sigc::pointer_functor6< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_return >
 pointer_functor6 wraps existing non-member functions with 6 argument(s). More...
 
class  sigc::pointer_functor7< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_return >
 pointer_functor7 wraps existing non-member functions with 7 argument(s). More...
 

Functions

template <class T_return >
pointer_functor0< T_returnsigc::ptr_fun (T_return(* _A_func)())
 Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_return >
pointer_functor1< T_arg1, T_returnsigc::ptr_fun (T_return(* _A_func)(T_arg1))
 Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_return >
pointer_functor2< T_arg1, T_arg2, T_returnsigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2))
 Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_return >
pointer_functor3< T_arg1, T_arg2, T_arg3, T_returnsigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3))
 Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_return >
pointer_functor4< T_arg1, T_arg2, T_arg3, T_arg4, T_returnsigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4))
 Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_return >
pointer_functor5< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_returnsigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5))
 Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_return >
pointer_functor6< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_returnsigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6))
 Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 , class T_return >
pointer_functor7< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_returnsigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7))
 Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function. More...
 
template <class T_return >
pointer_functor0< T_returnsigc::ptr_fun0 (T_return(* _A_func)())
 Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_return >
pointer_functor1< T_arg1, T_returnsigc::ptr_fun1 (T_return(* _A_func)(T_arg1))
 Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_return >
pointer_functor2< T_arg1, T_arg2, T_returnsigc::ptr_fun2 (T_return(* _A_func)(T_arg1, T_arg2))
 Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_return >
pointer_functor3< T_arg1, T_arg2, T_arg3, T_returnsigc::ptr_fun3 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3))
 Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_return >
pointer_functor4< T_arg1, T_arg2, T_arg3, T_arg4, T_returnsigc::ptr_fun4 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4))
 Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_return >
pointer_functor5< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_returnsigc::ptr_fun5 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5))
 Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_return >
pointer_functor6< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_returnsigc::ptr_fun6 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6))
 Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function. More...
 
template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 , class T_return >
pointer_functor7< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_returnsigc::ptr_fun7 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7))
 Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function. More...
 

Detailed Description

ptr_fun() is used to convert a pointer to a function to a functor.

If the function pointer is to an overloaded type, you must specify the types using template arguments starting with the first argument. It is not necessary to supply the return type.

Example:
void foo(int) {}
Convenience wrapper for the numbered sigc::slot# templates.
Definition: slot.h:1645
pointer_functor0< T_return > ptr_fun(T_return(*_A_func)())
Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function.
Definition: ptr_fun.h:460

Use ptr_fun#() if there is an ambiguity as to the number of arguments.

Example:
void foo(int) {} // choose this one
void foo(float) {}
void foo(int, int) {}
sigc::slot<void, long> sl = sigc::ptr_fun1<int>(&foo);

ptr_fun() can also be used to convert a pointer to a static member function to a functor, like so:

Example:
struct foo
{
static void bar(int) {}
};

Function Documentation

◆ ptr_fun() [1/8]

template <class T_return >
pointer_functor0< T_return > sigc::ptr_fun ( T_return(*)()  _A_func)
inline

Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun() [2/8]

template <class T_arg1 , class T_return >
pointer_functor1< T_arg1, T_return > sigc::ptr_fun ( T_return(*)(T_arg1)  _A_func)
inline

Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun() [3/8]

template <class T_arg1 , class T_arg2 , class T_return >
pointer_functor2< T_arg1, T_arg2, T_return > sigc::ptr_fun ( T_return(*)(T_arg1, T_arg2)  _A_func)
inline

Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun() [4/8]

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_return >
pointer_functor3< T_arg1, T_arg2, T_arg3, T_return > sigc::ptr_fun ( T_return(*)(T_arg1, T_arg2, T_arg3)  _A_func)
inline

Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun() [5/8]

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_return >
pointer_functor4< T_arg1, T_arg2, T_arg3, T_arg4, T_return > sigc::ptr_fun ( T_return(*)(T_arg1, T_arg2, T_arg3, T_arg4)  _A_func)
inline

Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun() [6/8]

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_return >
pointer_functor5< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_return > sigc::ptr_fun ( T_return(*)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5)  _A_func)
inline

Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun() [7/8]

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_return >
pointer_functor6< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_return > sigc::ptr_fun ( T_return(*)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6)  _A_func)
inline

Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun() [8/8]

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 , class T_return >
pointer_functor7< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_return > sigc::ptr_fun ( T_return(*)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)  _A_func)
inline

Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun0()

template <class T_return >
pointer_functor0< T_return > sigc::ptr_fun0 ( T_return(*)()  _A_func)
inline

Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun1()

template <class T_arg1 , class T_return >
pointer_functor1< T_arg1, T_return > sigc::ptr_fun1 ( T_return(*)(T_arg1)  _A_func)
inline

Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun2()

template <class T_arg1 , class T_arg2 , class T_return >
pointer_functor2< T_arg1, T_arg2, T_return > sigc::ptr_fun2 ( T_return(*)(T_arg1, T_arg2)  _A_func)
inline

Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun3()

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_return >
pointer_functor3< T_arg1, T_arg2, T_arg3, T_return > sigc::ptr_fun3 ( T_return(*)(T_arg1, T_arg2, T_arg3)  _A_func)
inline

Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun4()

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_return >
pointer_functor4< T_arg1, T_arg2, T_arg3, T_arg4, T_return > sigc::ptr_fun4 ( T_return(*)(T_arg1, T_arg2, T_arg3, T_arg4)  _A_func)
inline

Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun5()

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_return >
pointer_functor5< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_return > sigc::ptr_fun5 ( T_return(*)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5)  _A_func)
inline

Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun6()

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_return >
pointer_functor6< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_return > sigc::ptr_fun6 ( T_return(*)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6)  _A_func)
inline

Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.

◆ ptr_fun7()

template <class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 , class T_return >
pointer_functor7< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_return > sigc::ptr_fun7 ( T_return(*)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)  _A_func)
inline

Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function.

Parameters
_A_funcPointer to function that should be wrapped.
Returns
Functor that executes _A_func on invokation.