12 #include "threading.h" 16 BEGIN_NAMESPACE_THREADING
31 set(std::exception_ptr());
38 void set(std::exception_ptr exception)
40 std::lock_guard guard(lock);
41 this->exceptionPtr = exception;
57 const std::exception_ptr&
get()
const 59 std::lock_guard guard(lock);
97 std::lock_guard guard(lock);
98 return (this->exceptionPtr !=
nullptr);
102 std::exception_ptr exceptionPtr{
nullptr};
105 END_NAMESPACE_THREADING
void operator=(std::exception_ptr exception)
Sets exception pointer.
Definition: threadexceptionadapter.h:48
Interface for easy use of basic locking objects.
Wraps exception_ptr to deliver exception propagation from thread to the main thread.
Definition: threadexceptionadapter.h:23
const std::exception_ptr & operator*() const
Returns exception pointer.
Definition: threadexceptionadapter.h:67
bool operator!() const
Is exception pointer unset.
Definition: threadexceptionadapter.h:76
void reset()
Resets exception pointer.
Definition: threadexceptionadapter.h:29
bool isSet() const
Is exception pointer set?
Definition: threadexceptionadapter.h:95
bool exceptionOccurred() const
Did we catch an exception? Has exception occurred? (expressional)
Definition: threadexceptionadapter.h:85