AsyncCallbacks.h File Reference
#include "base/AsyncCall.h"
#include "base/AsyncJobCalls.h"
#include "base/TypeTraits.h"
Include dependency graph for AsyncCallbacks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  WithAnswer< AnswerT >
 access to a callback result carried by an asynchronous CallDialer More...
 
class  AsyncCallback< Answer >
 a smart AsyncCall pointer for delivery of future results More...
 
class  UnaryFunCallbackDialer< Argument1 >
 CallDialer for single-parameter callback functions. More...
 
class  UnaryCbcCallbackDialer< Destination, Argument1 >
 
class  UnaryJobCallbackDialer< Job, Argument1 >
 

Macros

#define asyncCallback(dbgSection, dbgLevel, method, object)
 
#define asyncCallbackFun(dbgSection, dbgLevel, function)
 AsyncCall for calling back a function. More...
 

Typedefs

template<typename T >
using IsAsyncJob = typename std::conditional< std::is_base_of< AsyncJob, T >::value, std::true_type, std::false_type >::type
 

Functions

template<class Destination , typename Argument1 , std::enable_if_t<!IsAsyncJob< Destination >::value, int > = 0>
UnaryCbcCallbackDialer< Destination, Argument1callbackDialer (void(Destination::*method)(Argument1 &), Destination *const destination)
 helper function to simplify UnaryCbcCallbackDialer creation More...
 
template<class Destination , typename Argument1 , std::enable_if_t< IsAsyncJob< Destination >::value, int > = 0>
UnaryJobCallbackDialer< Destination, Argument1callbackDialer (void(Destination::*method)(Argument1 &), Destination *const destination)
 helper function to simplify UnaryJobCallbackDialer creation More...
 
template<typename Argument1 >
UnaryFunCallbackDialer< Argument1callbackDialer (void(*destination)(Argument1 &))
 helper function to simplify UnaryFunCallbackDialer creation More...
 
template<class Call >
AsyncCallback< typename Call::Dialer::Answer > AsyncCallback_ (const RefCount< Call > &call)
 

Macro Definition Documentation

◆ asyncCallback

#define asyncCallback (   dbgSection,
  dbgLevel,
  method,
  object 
)
Value:
AsyncCallback_(asyncCall((dbgSection), (dbgLevel), #method, \
callbackDialer(&method, (object))))
RefCount< AsyncCallT< Dialer > > asyncCall(int aDebugSection, int aDebugLevel, const char *aName, const Dialer &aDialer)
Definition: AsyncCall.h:156
UnaryCbcCallbackDialer< Destination, Argument1 > callbackDialer(void(Destination::*method)(Argument1 &), Destination *const destination)
helper function to simplify UnaryCbcCallbackDialer creation
AsyncCallback< typename Call::Dialer::Answer > AsyncCallback_(const RefCount< Call > &call)

AsyncCall for calling back a class method compatible with callbackDialer(). TODO: Unify with JobCallback() which requires dialers that feed the job pointer to the non-default CommCommonCbParams constructor.

Definition at line 195 of file AsyncCallbacks.h.

◆ asyncCallbackFun

#define asyncCallbackFun (   dbgSection,
  dbgLevel,
  function 
)
Value:
AsyncCallback_(asyncCall((dbgSection), (dbgLevel), #function, \
callbackDialer(&function)))

Definition at line 201 of file AsyncCallbacks.h.

Typedef Documentation

◆ IsAsyncJob

template<typename T >
using IsAsyncJob = typename std::conditional< std::is_base_of<AsyncJob, T>::value, std::true_type, std::false_type >::type

whether the given type is an AsyncJob reduces code duplication in declarations further below

Definition at line 151 of file AsyncCallbacks.h.

Function Documentation

◆ AsyncCallback_()

template<class Call >
AsyncCallback< typename Call::Dialer::Answer > AsyncCallback_ ( const RefCount< Call > &  call)

helper function to create an AsyncCallback object that matches an AsyncCall based on a WithAnswer answer dialer.

Definition at line 187 of file AsyncCallbacks.h.

◆ callbackDialer() [1/3]

template<typename Argument1 >
UnaryFunCallbackDialer< Argument1 > callbackDialer ( void(*)(Argument1 &)  destination)

Definition at line 178 of file AsyncCallbacks.h.

◆ callbackDialer() [2/3]

template<class Destination , typename Argument1 , std::enable_if_t<!IsAsyncJob< Destination >::value, int > = 0>
UnaryCbcCallbackDialer< Destination, Argument1 > callbackDialer ( void(Destination::*)(Argument1 &)  method,
Destination *const  destination 
)

Definition at line 160 of file AsyncCallbacks.h.

◆ callbackDialer() [3/3]

template<class Destination , typename Argument1 , std::enable_if_t< IsAsyncJob< Destination >::value, int > = 0>
UnaryJobCallbackDialer< Destination, Argument1 > callbackDialer ( void(Destination::*)(Argument1 &)  method,
Destination *const  destination 
)

Definition at line 169 of file AsyncCallbacks.h.

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors