CMS 3D CMS Logo

Public Member Functions | Private Attributes

edm::ExceptionCollector Class Reference

#include <ExceptionCollector.h>

List of all members.

Public Member Functions

void call (boost::function< void(void)>)
 ExceptionCollector ()
bool hasThrown () const
void rethrow () const
 ~ExceptionCollector ()

Private Attributes

cms::Exception exception_
bool hasThrown_

Detailed Description

Definition at line 29 of file ExceptionCollector.h.


Constructor & Destructor Documentation

edm::ExceptionCollector::ExceptionCollector ( ) [inline]

Definition at line 31 of file ExceptionCollector.h.

: exception_(std::string()), hasThrown_(false) {}
edm::ExceptionCollector::~ExceptionCollector ( ) [inline]

Definition at line 32 of file ExceptionCollector.h.

{}

Member Function Documentation

void edm::ExceptionCollector::call ( boost::function< void(void)>  f)

Definition at line 10 of file ExceptionCollector.cc.

References exception, exception_, f, hasThrown_, and cms::Exception::what().

Referenced by edm::EventProcessor::endJob().

                                                      {
    try {
      f();
    }
    catch (cms::Exception const& e) {
      hasThrown_ = true;
      exception_ << e;
    }
    catch (std::exception const& e) {
      hasThrown_ = true;
      exception_ << e.what();
    }
    catch (...) {
      hasThrown_ = true;
      exception_ << "Unknown exception";
    }
  }
bool edm::ExceptionCollector::hasThrown ( ) const [inline]

Definition at line 33 of file ExceptionCollector.h.

References hasThrown_.

Referenced by edm::EventProcessor::endJob().

{return hasThrown_;}
void edm::ExceptionCollector::rethrow ( void  ) const

Definition at line 5 of file ExceptionCollector.cc.

References exception_.

Referenced by edm::EventProcessor::endJob().

                                    {
    throw exception_;
  }

Member Data Documentation

Definition at line 38 of file ExceptionCollector.h.

Referenced by call(), and rethrow().

Definition at line 39 of file ExceptionCollector.h.

Referenced by call(), and hasThrown().