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:
88  static std::string noProxyMessage();
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
edm::eventsetup::NoDataExceptionBase::dataKey_
DataKey dataKey_
Definition: NoDataException.h:101
edm::eventsetup::NoDataException::NoDataException
NoDataException(const EventSetupRecordKey &iRecordKey, const DataKey &iDataKey, const char *category_name="NoDataException")
Definition: NoDataException.h:107
edm::eventsetup::NoDataExceptionBase::dataKey
const DataKey & dataKey() const
Definition: NoDataException.cc:13
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::eventsetup::NoDataExceptionBase::record_
EventSetupRecordKey record_
Definition: NoDataException.h:100
edm::eventsetup::DataKey
Definition: DataKey.h:29
edm::eventsetup::NoDataExceptionBase::constructMessage
void constructMessage(const char *iClassName, const std::string &iExtraInfo)
Definition: NoDataException.cc:37
edm::eventsetup::NoDataExceptionBase::endDataTypeMessage
void endDataTypeMessage(std::string &) const
Definition: NoDataException.cc:29
edm::eventsetup::NoDataException::NoDataException
NoDataException(const EventSetupRecordKey &iRecordKey, const DataKey &iDataKey, const char *category_name, const std::string &iExtraInfo)
Definition: NoDataException.h:114
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
edm::eventsetup::NoDataExceptionBase::noProxyMessage
static std::string noProxyMessage()
Definition: NoDataException.cc:21
edm::eventsetup::NoDataExceptionBase::~NoDataExceptionBase
~NoDataExceptionBase() noexcept override
Definition: NoDataException.cc:11
edm::eventsetup::NoDataException
Definition: NoDataException.h:105
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::eventsetup::NoDataExceptionBase
Definition: NoDataException.h:78
DataKey.h
Exception.h
edm::eventsetup::NoDataExceptionBase::providerButNoDataMessage
static std::string providerButNoDataMessage(const EventSetupRecordKey &iKey)
Definition: NoDataException.cc:15
edm::eventsetup::NoDataExceptionBase::NoDataExceptionBase
NoDataExceptionBase(const EventSetupRecordKey &iRecordKey, const DataKey &iDataKey, const char *category_name="NoDataException")
Definition: NoDataException.cc:6
cms::Exception
Definition: Exception.h:70
EventSetupRecordKey.h
edm::eventsetup::NoDataExceptionBase::beginDataTypeMessage
void beginDataTypeMessage(std::string &) const
Definition: NoDataException.cc:25
HCTypeTag.h