c++-gtk-utils
Public Types | Public Member Functions | List of all members
Cgu::Callback::CallbackArg0_static< FreeArg > Class Template Reference

#include <callback.h>

Inheritance diagram for Cgu::Callback::CallbackArg0_static< FreeArg >:
Cgu::Callback::CallbackArg< FreeArg >

Public Types

typedef void(* Func) (FreeArg)
 

Public Member Functions

void dispatch (typename Cgu::Param< FreeArg >::ParamType free_arg) const
 
 CallbackArg0_static (Func func_)
 
- Public Member Functions inherited from Cgu::Callback::CallbackArg< FreeArg >
 CallbackArg ()
 
virtual ~CallbackArg ()
 

Member Typedef Documentation

◆ Func

template<class FreeArg >
typedef void(* Cgu::Callback::CallbackArg0_static< FreeArg >::Func) (FreeArg)

Constructor & Destructor Documentation

◆ CallbackArg0_static()

template<class FreeArg >
Cgu::Callback::CallbackArg0_static< FreeArg >::CallbackArg0_static ( Func  func_)
inline

Member Function Documentation

◆ dispatch()

template<class FreeArg >
void Cgu::Callback::CallbackArg0_static< FreeArg >::dispatch ( typename Cgu::Param< FreeArg >::ParamType  arg) const
inlinevirtual

This will execute the referenced function or class method encapsulated by this class. It will only throw if the dispatched function or class method throws, or if the copy constructor of a free or bound argument throws and it is not a reference argument. It is thread safe if the referenced function or class method is thread safe.

Parameters
argThe argument to be passed to the referenced function or class method, if any.
Note
1. We use dispatch() to execute the callback, because the callback would normally be invoked through a base class pointer. To invoke it through operator()(), use the FunctorArg wrapper class.
2. This function is specialised for Callback::Callback (ie Callback::CallbackArg<void>) to take no argument, and for Callback::CallbackArg<TypeTuple<T1, T2> > and Callback::CallbackArg<TypeTuple<T1, T2, T3> > to take two and three arguments respectively.

Implements Cgu::Callback::CallbackArg< FreeArg >.


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