DataFormats
Common
src
ConvertHandle.cc
Go to the documentation of this file.
1
#include "
DataFormats/Common/interface/ConvertHandle.h
"
2
#include "
FWCore/Utilities/interface/EDMException.h
"
3
#include "
DataFormats/Common/interface/FunctorHandleExceptionFactory.h
"
4
5
namespace
edm
{
6
namespace
handleimpl {
7
static
std::shared_ptr<HandleExceptionFactory const>
const
s_invalidRefFactory
=
8
makeHandleExceptionFactory
([]() -> std::shared_ptr<cms::Exception> {
9
std::shared_ptr<cms::Exception> whyFailed =
10
std::make_shared<edm::Exception>(
errors::InvalidReference
,
"NullPointer"
);
11
*whyFailed <<
"Handle has null pointer to data product"
;
12
return
whyFailed;
13
});
14
15
std::shared_ptr<HandleExceptionFactory const>
makeInvalidReferenceException
() {
return
s_invalidRefFactory
; }
16
17
void
throwConvertTypeError
(std::type_info
const
& expected, std::type_info
const
& actual) {
18
throw
Exception
(
errors::LogicError
,
"TypeMismatch"
)
19
<<
"edm::BasicHandle contains a product of type "
<< actual.name() <<
".\n"
20
<<
"A type of "
<< expected.name() <<
"was expected."
;
21
}
22
}
// namespace handleimpl
23
}
// namespace edm
FunctorHandleExceptionFactory.h
edm::errors::InvalidReference
Definition:
EDMException.h:39
edm::errors::LogicError
Definition:
EDMException.h:37
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::makeHandleExceptionFactory
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
Definition:
FunctorHandleExceptionFactory.h:45
EDMException.h
edm::handleimpl::throwConvertTypeError
void throwConvertTypeError(std::type_info const &expected, std::type_info const &actual)
Definition:
ConvertHandle.cc:17
edm::handleimpl::s_invalidRefFactory
static const std::shared_ptr< HandleExceptionFactory const > s_invalidRefFactory
Definition:
ConvertHandle.cc:7
ConvertHandle.h
edm::handleimpl::makeInvalidReferenceException
std::shared_ptr< edm::HandleExceptionFactory const > makeInvalidReferenceException()
Definition:
ConvertHandle.cc:15
Exception
Definition:
hltDiff.cc:246
Generated for CMSSW Reference Manual by
1.8.16