LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 26 of file ExceptionCollector.h.

Member Function Documentation

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

Definition at line 37 of file ExceptionCollector.h.

References exceptions_, and f.

Referenced by art::EventProcessor::endJob(), art::EventProcessor::process(), and art::EventProcessor::runToCompletion().

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

Definition at line 29 of file ExceptionCollector.h.

References exceptions_, and rethrow().

Referenced by art::EventProcessor::process(), and art::EventProcessor::runToCompletion().

30  {
31  return exceptions_.empty();
32  }
std::vector< std::exception_ptr > exceptions_
void art::detail::ExceptionCollector::rethrow ( )

Definition at line 20 of file ExceptionCollector.cc.

References evd::details::begin(), e, and evd::details::end().

Referenced by empty(), and art::EventProcessor::runToCompletion().

21 {
22  assert(!empty());
23 
24  auto top_e =
25  std::make_unique<Exception>(make_exception_from_ptr(exceptions_.front()));
26  for (auto i = std::begin(exceptions_) + 1, e = std::end(exceptions_); i != e;
27  ++i) {
28  auto eptr = make_exception_from_ptr(*i);
29  top_e->append(eptr);
30  }
31  exceptions_.clear();
32 
33  throw *top_e;
34 }
std::vector< std::exception_ptr > exceptions_
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
Float_t e
Definition: plot.C:34

Member Data Documentation

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

Definition at line 45 of file ExceptionCollector.h.

Referenced by call(), and empty().


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