open62541pp 0.15.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
opcua::detail::ExceptionCatcher Class Reference

#include <exceptioncatcher.hpp>

Detailed Description

Catch & store exceptions from user-defined callbacks in an exception-unaware context (open62541).

The stored exception can be rethrown in a different context.

Definition at line 13 of file exceptioncatcher.hpp.

Public Member Functions

void setException (std::exception_ptr exception) noexcept
 
bool hasException () const noexcept
 
void rethrow ()
 
template<typename Callback , typename... Args>
void invoke (Callback &&callback, Args &&... args) noexcept
 
template<typename Callback >
auto wrapCallback (Callback &&callback) noexcept
 

Member Function Documentation

◆ setException()

void opcua::detail::ExceptionCatcher::setException ( std::exception_ptr exception)
inlinenoexcept

Definition at line 15 of file exceptioncatcher.hpp.

Referenced by invoke().

◆ hasException()

bool opcua::detail::ExceptionCatcher::hasException ( ) const
inlinenoexcept

Definition at line 19 of file exceptioncatcher.hpp.

Referenced by rethrow().

◆ rethrow()

void opcua::detail::ExceptionCatcher::rethrow ( )
inline

Definition at line 23 of file exceptioncatcher.hpp.

◆ invoke()

template<typename Callback , typename... Args>
void opcua::detail::ExceptionCatcher::invoke ( Callback && callback,
Args &&... args )
inlinenoexcept

◆ wrapCallback()

template<typename Callback >
auto opcua::detail::ExceptionCatcher::wrapCallback ( Callback && callback)
inlinenoexcept

Definition at line 53 of file exceptioncatcher.hpp.