CMS 3D CMS Logo

NoDataException.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_NoDataException_h
2 #define FWCore_Framework_NoDataException_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Module: NoDataException
7 //
60 //
61 // Author: Chris D Jones
62 // Created: Tue Dec 7 09:10:34 EST 1999
63 //
64 
65 // system include files
66 #include <string>
67 
68 // user include files
73 
74 // forward declarations
75 namespace edm {
76  namespace eventsetup {
77 
79  public:
80  NoDataExceptionBase(const EventSetupRecordKey& iRecordKey,
81  const DataKey& iDataKey,
82  const char* category_name = "NoDataException");
83  ~NoDataExceptionBase() noexcept override;
84  const DataKey& dataKey() const;
85 
86  protected:
89  void constructMessage(const char* iClassName, const std::string& iExtraInfo);
90 
91  private:
92  void beginDataTypeMessage(std::string&) const;
93  void endDataTypeMessage(std::string&) const;
94 
95  // ---------- Constructors and destructor ----------------
96  //NoDataExceptionBase(const NoDataExceptionBase&) ; //allow default
97  //const NoDataExceptionBase& operator=(const NoDataExceptionBase&); // allow default
98 
99  // ---------- data members -------------------------------
102  };
103 
104  template <class T>
106  public:
108  const DataKey& iDataKey,
109  const char* category_name = "NoDataException")
110  : NoDataExceptionBase(iRecordKey, iDataKey, category_name) {
111  constructMessage(heterocontainer::className<T>(), providerButNoDataMessage(iRecordKey));
112  }
113 
115  const DataKey& iDataKey,
116  const char* category_name,
117  const std::string& iExtraInfo)
118  : NoDataExceptionBase(iRecordKey, iDataKey, category_name) {
119  constructMessage(heterocontainer::className<T>(), iExtraInfo);
120  }
121  };
122 
123  } // namespace eventsetup
124 } // namespace edm
125 #endif
static std::string providerButNoDataMessage(const EventSetupRecordKey &iKey)
void beginDataTypeMessage(std::string &) const
NoDataException(const EventSetupRecordKey &iRecordKey, const DataKey &iDataKey, const char *category_name="NoDataException")
NoDataExceptionBase(const EventSetupRecordKey &iRecordKey, const DataKey &iDataKey, const char *category_name="NoDataException")
void endDataTypeMessage(std::string &) const
NoDataException(const EventSetupRecordKey &iRecordKey, const DataKey &iDataKey, const char *category_name, const std::string &iExtraInfo)
HLT enums.
void constructMessage(const char *iClassName, const std::string &iExtraInfo)