LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::detail::ExceptionCollector Class Reference

#include "ExceptionCollector.h"

Public Member Functions

bool empty () const noexcept
 
void rethrow ()
 
template<typename F >
void call (F f)
 

Private Attributes

std::vector< std::exception_ptr > exceptions_ {}
 

Detailed Description

Definition at line 22 of file ExceptionCollector.h.

Member Function Documentation

template<typename F >
void art::detail::ExceptionCollector::call ( f)
inline

Definition at line 33 of file ExceptionCollector.h.

References exceptions_, and f.

34  {
35  f();
36  }
37  catch (...) {
38  exceptions_.push_back(std::current_exception());
39  }
TFile f
Definition: plotHisto.C:6
std::vector< std::exception_ptr > exceptions_
bool art::detail::ExceptionCollector::empty ( ) const
inlinenoexcept

Definition at line 25 of file ExceptionCollector.h.

References exceptions_, and rethrow().

26  {
27  return exceptions_.empty();
28  }
std::vector< std::exception_ptr > exceptions_
void art::detail::ExceptionCollector::rethrow ( )

Definition at line 19 of file ExceptionCollector.cc.

References util::empty(), and message().

Referenced by empty().

20 {
21  assert(!empty());
22  std::string message;
23  for (auto const& e : exceptions_) {
24  message += exception_msg_from_ptr(e);
25  }
26  exceptions_.clear();
27  throw collected_exception{std::move(message)};
28 }
void message(RunManager *runmanager)
Definition: ts_scorers.cc:74
std::vector< std::exception_ptr > exceptions_
Float_t e
Definition: plot.C:35

Member Data Documentation

std::vector<std::exception_ptr> art::detail::ExceptionCollector::exceptions_ {}
private

Definition at line 42 of file ExceptionCollector.h.

Referenced by call(), and empty().


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