seams-core v2.14.3
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
seams::RegionErrors Class Reference

#include <src/include/internal/region_errors.hpp>

Public Member Functions

template<class F>
void run (F &&body) noexcept
bool failed () const noexcept
void rethrow () const

Detailed Description

Definition at line 15 of file region_errors.hpp.

Member Function Documentation

◆ failed()

bool seams::RegionErrors::failed ( ) const
inlinenoexcept

Definition at line 30 of file region_errors.hpp.

30{ return failed_.load(std::memory_order_relaxed); }

◆ rethrow()

void seams::RegionErrors::rethrow ( ) const
inline

Definition at line 33 of file region_errors.hpp.

33 {
34 if (first_) {
35 std::rethrow_exception(first_);
36 }
37 }

◆ run()

template<class F>
void seams::RegionErrors::run ( F && body)
inlinenoexcept

Definition at line 17 of file region_errors.hpp.

17 {
18 if (failed_.load(std::memory_order_relaxed)) {
19 return;
20 }
21 try {
22 body();
23 } catch (...) {
24 if (!failed_.exchange(true, std::memory_order_acq_rel)) {
25 first_ = std::current_exception();
26 }
27 }
28 }

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