Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:03

0001 #ifndef FWCore_Framework_ExceptionActions_h
0002 #define FWCore_Framework_ExceptionActions_h
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 
0006 #include <string>
0007 #include <map>
0008 
0009 namespace edm {
0010   namespace exception_actions {
0011     enum ActionCodes { IgnoreCompletely = 0, Rethrow, TryToContinue, LastCode };
0012 
0013     const char* actionName(ActionCodes code);
0014   }  // namespace exception_actions
0015 
0016   class ExceptionToActionTable {
0017   public:
0018     typedef std::map<std::string, exception_actions::ActionCodes> ActionMap;
0019 
0020     ExceptionToActionTable();
0021     explicit ExceptionToActionTable(const ParameterSet&);
0022     ~ExceptionToActionTable();
0023 
0024     void add(const std::string& category, exception_actions::ActionCodes code);
0025     exception_actions::ActionCodes find(const std::string& category) const;
0026 
0027   private:
0028     void addDefaults();
0029     ActionMap map_;
0030   };
0031 }  // namespace edm
0032 #endif