DataFormats
Common
interface
AssociationMapHelpers.h
Go to the documentation of this file.
1
#ifndef DataFormats_Common_AssociationMapKeyVal_h
2
#define DataFormats_Common_AssociationMapKeyVal_h
3
/*
4
*
5
* helper classes for AssociationMap
6
*
7
* \author Luca Lista, INFN
8
*
9
*
10
*/
11
#include "
DataFormats/Provenance/interface/ProductID.h
"
12
#include "
FWCore/Utilities/interface/EDMException.h
"
13
14
#include <utility>
15
16
namespace
edm
{
17
18
class
EDProductGetter
;
19
20
namespace
helpers
{
21
template
<
typename
K,
typename
V>
22
struct
KeyVal
{
23
typedef
K
key_type
;
24
typedef
V
value_type
;
25
KeyVal
() :
key
(),
val
() {}
26
KeyVal
(
const
K&
k
,
const
V
&
v
) :
key
(
k
),
val
(
v
) {}
27
template
<
typename
K_,
typename
V_>
28
KeyVal
(K_&&
k
, V_&&
v
) :
key
(
std
::forward<K_>(
k
)),
val
(
std
::forward<V_>(
v
)) {}
29
30
KeyVal
(
EDProductGetter
const
* getter) :
key
(
ProductID
(), getter),
val
(
ProductID
(), getter) {}
31
32
K
key
;
33
V
val
;
34
};
35
36
template
<
typename
K>
37
struct
Key
{
38
typedef
K
key_type
;
39
Key
() {}
40
Key
(
const
K&
k
) :
key
(
k
) {}
41
template
<
typename
K_>
42
Key
(K_&&
k
) :
key
(
std
::forward<K_>(
k
)) {}
43
44
Key
(
EDProductGetter
const
* getter) :
key
(
ProductID
(), getter) {}
45
46
K
key
;
47
};
48
50
template
<
typename
RP,
typename
R>
51
void
checkRef
(
const
RP& rp,
const
R
&
r
) {
52
if
(rp.id() !=
r
.id()) {
53
Exception::throwThis
(
edm::errors::InvalidReference
,
"invalid reference"
);
54
}
55
}
56
}
// namespace helpers
57
}
// namespace edm
58
59
#endif
edm::helpers::Key
Definition:
AssociationMapHelpers.h:37
edm::helpers::Key::key
K key
Definition:
AssociationMapHelpers.h:46
edm::EDProductGetter
Definition:
EDProductGetter.h:41
edm::helpers::Key::key_type
K key_type
Definition:
AssociationMapHelpers.h:38
edm::helpers::Key::Key
Key(const K &k)
Definition:
AssociationMapHelpers.h:40
std
Definition:
JetResolutionObject.h:76
findQualityFiles.v
v
Definition:
findQualityFiles.py:179
edm::helpers::KeyVal::val
V val
Definition:
AssociationMapHelpers.h:33
edm::helpers::Key::Key
Key(K_ &&k)
Definition:
AssociationMapHelpers.h:42
ProductID.h
edm::helpers::Key::Key
Key()
Definition:
AssociationMapHelpers.h:39
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:84
cms::cuda::V
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
Definition:
HistoContainer.h:51
EDMException.h
edm::ProductID
Definition:
ProductID.h:27
dttmaxenums::R
Definition:
DTTMax.h:28
edm::helpers::KeyVal::key
K key
Definition:
AssociationMapHelpers.h:32
edm::helpers::KeyVal::KeyVal
KeyVal(const K &k, const V &v)
Definition:
AssociationMapHelpers.h:26
edm::helpers::KeyVal
Definition:
AssociationMapHelpers.h:22
edm::errors::InvalidReference
Definition:
EDMException.h:39
EDProductGetter
alignCSCRings.r
r
Definition:
alignCSCRings.py:93
edm::helpers::KeyVal::KeyVal
KeyVal()
Definition:
AssociationMapHelpers.h:25
edm::helpers::KeyVal::value_type
V value_type
Definition:
AssociationMapHelpers.h:24
edm::helpers::KeyVal::KeyVal
KeyVal(K_ &&k, V_ &&v)
Definition:
AssociationMapHelpers.h:28
edm::helpers::Key::Key
Key(EDProductGetter const *getter)
Definition:
AssociationMapHelpers.h:44
helpers
Definition:
makeCompositeCandidate.h:8
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::helpers::KeyVal::key_type
K key_type
Definition:
AssociationMapHelpers.h:23
edm::helpers::checkRef
void checkRef(const RP &rp, const R &r)
throw if r hasn't the same id as rp
Definition:
AssociationMapHelpers.h:51
dqmdumpme.k
k
Definition:
dqmdumpme.py:60
edm::helpers::KeyVal::KeyVal
KeyVal(EDProductGetter const *getter)
Definition:
AssociationMapHelpers.h:30
Generated for CMSSW Reference Manual by
1.8.14