AsyncCallback< Answer > Class Template Reference

a smart AsyncCall pointer for delivery of future results More...

#include <AsyncCallbacks.h>

Inheritance diagram for AsyncCallback< Answer >:
Collaboration diagram for AsyncCallback< Answer >:

Public Member Functions

 AsyncCallback ()=default
 
template<class Call >
 AsyncCallback (const RefCount< Call > &call)
 
Answer & answer ()
 
AsyncCall::Pointer release ()
 
 operator bool () const
 whether the callback has been set but not released More...
 
 operator const AsyncCall::Pointer & () const
 
const AsyncCalloperator* () const
 
const AsyncCalloperator-> () const
 

Private Attributes

AsyncCall::Pointer call_
 callback carrying the answer More...
 
Answer * answer_ = nullptr
 

Detailed Description

template<typename Answer>
class AsyncCallback< Answer >

Definition at line 31 of file AsyncCallbacks.h.

Constructor & Destructor Documentation

◆ AsyncCallback() [1/2]

template<typename Answer >
AsyncCallback< Answer >::AsyncCallback ( )
default

◆ AsyncCallback() [2/2]

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

Definition at line 38 of file AsyncCallbacks.h.

Member Function Documentation

◆ answer()

template<typename Answer >
Answer & AsyncCallback< Answer >::answer ( )
inline

Definition at line 44 of file AsyncCallbacks.h.

References AsyncCallback< Answer >::answer_, and assert.

Referenced by Ipc::StartListening().

◆ operator bool()

template<typename Answer >
AsyncCallback< Answer >::operator bool ( ) const
inlineexplicit

Definition at line 61 of file AsyncCallbacks.h.

References AsyncCallback< Answer >::answer_.

◆ operator const AsyncCall::Pointer &()

template<typename Answer >
AsyncCallback< Answer >::operator const AsyncCall::Pointer & ( ) const
inline

Definition at line 64 of file AsyncCallbacks.h.

References AsyncCallback< Answer >::call_.

◆ operator*()

template<typename Answer >
const AsyncCall & AsyncCallback< Answer >::operator* ( ) const
inline

Definition at line 65 of file AsyncCallbacks.h.

References AsyncCallback< Answer >::call_.

◆ operator->()

template<typename Answer >
const AsyncCall * AsyncCallback< Answer >::operator-> ( ) const
inline

Definition at line 66 of file AsyncCallbacks.h.

References AsyncCallback< Answer >::call_.

◆ release()

template<typename Answer >
AsyncCall::Pointer AsyncCallback< Answer >::release ( )
inline

make this smart pointer nil

Returns
the AsyncCall pointer we used to manage before this call

Definition at line 52 of file AsyncCallbacks.h.

References AsyncCallback< Answer >::answer_, and AsyncCallback< Answer >::call_.

Referenced by Ipc::StartListening().

Member Data Documentation

◆ answer_

template<typename Answer >
Answer* AsyncCallback< Answer >::answer_ = nullptr
private

(future) answer inside this->call, obtained when it was still possible to reach it without dynamic casts and virtual methods

Definition at line 74 of file AsyncCallbacks.h.

Referenced by AsyncCallback< Answer >::answer(), AsyncCallback< Answer >::operator bool(), and AsyncCallback< Answer >::release().

◆ call_


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors