commonlib
ThreadExceptionAdapter Class Reference

Wraps exception_ptr to deliver exception propagation from thread to the main thread. More...

#include <threadexceptionadapter.h>

Inheritance diagram for ThreadExceptionAdapter:

Public Member Functions

void reset ()
 Resets exception pointer.
 
void set (std::exception_ptr exception)
 Sets exception pointer. More...
 
void operator= (std::exception_ptr exception)
 Sets exception pointer. More...
 
const std::exception_ptr & get () const
 Returns exception pointer. More...
 
const std::exception_ptr & operator* () const
 Returns exception pointer. More...
 
bool operator! () const
 Is exception pointer unset. More...
 
bool exceptionOccurred () const
 Did we catch an exception? Has exception occurred? (expressional) More...
 

Protected Member Functions

bool isSet () const
 Is exception pointer set? More...
 

Detailed Description

Wraps exception_ptr to deliver exception propagation from thread to the main thread.

Usage: set on your except method inside thread, read the exception information in main thread, reset after use.

Member Function Documentation

◆ exceptionOccurred()

bool ThreadExceptionAdapter::exceptionOccurred ( ) const
inline

Did we catch an exception? Has exception occurred? (expressional)

Returns
True if exception occurred

◆ get()

const std::exception_ptr& ThreadExceptionAdapter::get ( ) const
inline

Returns exception pointer.

Returns
standard exception pointer value

◆ isSet()

bool ThreadExceptionAdapter::isSet ( ) const
inlineprotected

Is exception pointer set?

Returns
True if exception pointer is set else false.

◆ operator!()

bool ThreadExceptionAdapter::operator! ( ) const
inline

Is exception pointer unset.

Returns
False if exception pointer is set else true

◆ operator*()

const std::exception_ptr& ThreadExceptionAdapter::operator* ( ) const
inline

Returns exception pointer.

Returns
standard exception pointer value

◆ operator=()

void ThreadExceptionAdapter::operator= ( std::exception_ptr  exception)
inline

Sets exception pointer.

Parameters
exceptionstandard exception pointer value

◆ set()

void ThreadExceptionAdapter::set ( std::exception_ptr  exception)
inline

Sets exception pointer.

Parameters
exceptionstandard exception pointer value

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