ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Communication::MpiCallbacks::CallbackHandle< Args > Class Template Reference

RAII handle for a callback. More...

#include <MpiCallbacks.hpp>

Public Member Functions

template<typename F >
requires std::is_same_v<typename detail::functor_types_from_lambda< F>::argument_types, std::tuple<Args...>>
 CallbackHandle (std::shared_ptr< MpiCallbacks > cb, F &&f)
 
 CallbackHandle (CallbackHandle const &)=delete
 
 CallbackHandle (CallbackHandle &&rhs) noexcept=default
 
CallbackHandleoperator= (CallbackHandle const &)=delete
 
CallbackHandleoperator= (CallbackHandle &&rhs) noexcept=default
 
template<class... ArgRef>
requires std::is_invocable_r_v<void, void (*)(Args...), ArgRef &&...>
auto operator() (ArgRef &&...args) const
 Call the callback managed by this handle.
 
 ~CallbackHandle ()
 
int id () const
 

Detailed Description

template<class... Args>
class Communication::MpiCallbacks::CallbackHandle< Args >

RAII handle for a callback.

This is what the client gets for registering a dynamic (= not function pointer) callback. It manages the lifetime of the callback handle needed to call it. The handle has a type derived from the signature of the callback, which makes it possible to do static type checking on the arguments.

Definition at line 193 of file MpiCallbacks.hpp.

Constructor & Destructor Documentation

◆ CallbackHandle() [1/3]

template<class... Args>
template<typename F >
requires std::is_same_v<typename detail::functor_types_from_lambda< F>::argument_types, std::tuple<Args...>>
Communication::MpiCallbacks::CallbackHandle< Args >::CallbackHandle ( std::shared_ptr< MpiCallbacks cb,
F &&  f 
)
inline

Definition at line 199 of file MpiCallbacks.hpp.

◆ CallbackHandle() [2/3]

template<class... Args>
Communication::MpiCallbacks::CallbackHandle< Args >::CallbackHandle ( CallbackHandle< Args > const )
delete

◆ CallbackHandle() [3/3]

template<class... Args>
Communication::MpiCallbacks::CallbackHandle< Args >::CallbackHandle ( CallbackHandle< Args > &&  rhs)
defaultnoexcept

◆ ~CallbackHandle()

template<class... Args>
Communication::MpiCallbacks::CallbackHandle< Args >::~CallbackHandle ( )
inline

Definition at line 229 of file MpiCallbacks.hpp.

Member Function Documentation

◆ id()

template<class... Args>
int Communication::MpiCallbacks::CallbackHandle< Args >::id ( ) const
inline

Definition at line 234 of file MpiCallbacks.hpp.

◆ operator()()

template<class... Args>
template<class... ArgRef>
requires std::is_invocable_r_v<void, void (*)(Args...), ArgRef &&...>
auto Communication::MpiCallbacks::CallbackHandle< Args >::operator() ( ArgRef &&...  args) const
inline

Call the callback managed by this handle.

The arguments are passed to the remote callees, it must be possible to call the function with the provided arguments, otherwise this will not compile.

Definition at line 220 of file MpiCallbacks.hpp.

References stream.

◆ operator=() [1/2]

template<class... Args>
CallbackHandle & Communication::MpiCallbacks::CallbackHandle< Args >::operator= ( CallbackHandle< Args > &&  rhs)
defaultnoexcept

◆ operator=() [2/2]


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