senf::ppi::detail::Callback< Arg > Struct Template Reference

Provide callbacks with a single optional argument. More...

#include <senf/PPI/detail/Callback.hh>

Public Types

typedef boost::function< void(Arg)> type
 

Static Public Member Functions

template<class Owner , class FnClass >
static type make (void(FnClass::*memfn)(), Owner &owner)
 
template<class Owner , class FnClass , class FnArg >
static type make (void(FnClass::*memfn)(FnArg arg), Owner &owner)
 
template<class Owner >
static type make (type callable, Owner &)
 
template<class Owner >
static type make (boost::function< void()> callable, Owner &)
 

Detailed Description

template<class Arg = void>
struct senf::ppi::detail::Callback< Arg >

Provide callbacks with a single optional argument.

This helper implements callbacks with an optional single argument. In addition to boost::function, this helper provides the following functionality:

  • It allows the callback to ignore the argument: A callable with no argument may be used as callback.
  • It allows to use member function pointers as callbacks. These will be automatically bound to the owner argument of make().

The callbacks follow the same restrictions as Boost.Function: They must be either function, member function pointers or callable objects defining the appropriate typedef members.

Definition at line 45 of file Callback.hh.

Member Typedef Documentation

◆ type

template<class Arg = void>
typedef boost::function<void (Arg)> senf::ppi::detail::Callback< Arg >::type

Definition at line 47 of file Callback.hh.

Member Function Documentation

◆ make() [1/4]

template<class Arg = void>
template<class Owner , class FnClass >
static type senf::ppi::detail::Callback< Arg >::make ( void(FnClass::*)()  memfn,
Owner &  owner 
)
static

◆ make() [2/4]

template<class Arg = void>
template<class Owner , class FnClass , class FnArg >
static type senf::ppi::detail::Callback< Arg >::make ( void(FnClass::*)(FnArg arg)  memfn,
Owner &  owner 
)
static

◆ make() [3/4]

template<class Arg = void>
template<class Owner >
static type senf::ppi::detail::Callback< Arg >::make ( type  callable,
Owner &   
)
static

◆ make() [4/4]

template<class Arg = void>
template<class Owner >
static type senf::ppi::detail::Callback< Arg >::make ( boost::function< void()>  callable,
Owner &   
)
static

The documentation for this struct was generated from the following file: