DataFormats
Common
interface
RefKeyTrait.h
Go to the documentation of this file.
1
#ifndef DataFormats_Common_RefKeyTrait_h
2
#define DataFormats_Common_RefKeyTrait_h
3
#include "
FWCore/Utilities/interface/EDMException.h
"
4
5
namespace
edm
{
6
template
<
typename
C>
7
class
RefProd
;
8
namespace
reftobase {
9
10
struct
RefKey
{
11
template
<
typename
REF>
12
static
size_t
key
(
const
REF&
r
) {
13
return
r
.key();
14
}
15
};
16
17
struct
RefProdKey
{
18
template
<
typename
REF>
19
static
size_t
key
(
const
REF&
r
) {
20
Exception::throwThis
(
errors::InvalidReference
,
21
"attempting get key from a RefToBase containing a RefProd.\n"
22
"You can use key only with RefToBase containing a Ref."
);
23
return
0;
24
}
25
};
26
27
template
<
typename
REF>
28
struct
RefKeyTrait
{
29
typedef
RefKey
type
;
30
};
31
32
template
<
typename
C>
33
struct
RefKeyTrait
<
RefProd
<
C
> > {
34
typedef
RefProdKey
type
;
35
};
36
}
// namespace reftobase
37
}
// namespace edm
38
39
#endif
edm::RefProd
Definition:
EDProductfwd.h:25
edm::reftobase::RefKey::key
static size_t key(const REF &r)
Definition:
RefKeyTrait.h:12
edm::reftobase::RefKey
Definition:
RefKeyTrait.h:10
edm::errors::InvalidReference
Definition:
EDMException.h:39
edm
HLT enums.
Definition:
AlignableModifier.h:19
EDMException.h
edm::reftobase::RefKeyTrait< RefProd< C > >::type
RefProdKey type
Definition:
RefKeyTrait.h:34
edm::reftobase::RefKeyTrait
Definition:
RefKeyTrait.h:28
edm::reftobase::RefKeyTrait::type
RefKey type
Definition:
RefKeyTrait.h:29
edm::reftobase::RefProdKey
Definition:
RefKeyTrait.h:17
edm::reftobase::RefProdKey::key
static size_t key(const REF &r)
Definition:
RefKeyTrait.h:19
alignCSCRings.r
r
Definition:
alignCSCRings.py:93
gen::C
C
Definition:
PomwigHadronizer.cc:76
edm::Exception::throwThis
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition:
EDMException.cc:83
reco::JetExtendedAssociation::RefProd
edm::RefProd< Container > RefProd
Definition:
JetExtendedAssociation.h:33
Generated for CMSSW Reference Manual by
1.8.16