Main Page
Namespaces
Classes
Package Documentation
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 "
FWCore/Utilities/interface/EDMException.h
"
12
13
#include <utility>
14
15
namespace
edm
{
16
17
class
EDProductGetter
;
18
19
namespace
helpers
{
20
template
<
typename
K,
typename
V>
21
struct
KeyVal
{
22
typedef
K
key_type
;
23
typedef
V
value_type
;
24
KeyVal
() :
key
(),
val
() { }
25
KeyVal
(
const
K &
k
,
const
V &
v
) :
key
(k),
val
(v) { }
26
template
<
typename
K_,
typename
V_>
27
KeyVal
(K_&&
k
, V_&&
v
) :
key
(
std
::forward<K_>(
k
)),
val
(
std
::forward<V_>(
v
)){}
28
29
KeyVal
(
EDProductGetter
const
* getter) :
key
(
ProductID
(), getter),
val
(
ProductID
(), getter) { }
30
31
K
key
;
32
V
val
;
33
};
34
35
template
<
typename
K>
36
struct
Key
{
37
typedef
K
key_type
;
38
Key
() { }
39
Key
(
const
K &
k
) :
key
(k) { }
40
template
<
typename
K_>
41
Key
(K_&&
k
) :
key
(
std
::forward<K_>(
k
)) { }
42
43
Key
(
EDProductGetter
const
* getter) :
key
(
ProductID
(), getter) { }
44
45
K
key
;
46
};
47
49
template
<
typename
RP,
typename
R>
50
void
checkRef
(
const
RP & rp,
const
R
&
r
) {
51
if
(rp.id() != r.id()) {
52
Exception::throwThis
(
edm::errors::InvalidReference
,
"invalid reference"
);
53
}
54
}
55
}
56
}
57
58
#endif
edm::helpers::Key
Definition:
AssociationMapHelpers.h:36
edm::helpers::Key::key
K key
Definition:
AssociationMapHelpers.h:45
edm::EDProductGetter
Definition:
EDProductGetter.h:32
edm::helpers::Key::key_type
K key_type
Definition:
AssociationMapHelpers.h:37
edm::helpers::Key::Key
Key(const K &k)
Definition:
AssociationMapHelpers.h:39
std
Definition:
JetResolutionObject.h:76
findQualityFiles.v
v
Definition:
findQualityFiles.py:177
edm::helpers::KeyVal::val
V val
Definition:
AssociationMapHelpers.h:32
edm::helpers::Key::Key
Key(K_ &&k)
Definition:
AssociationMapHelpers.h:41
edm::helpers::Key::Key
Key()
Definition:
AssociationMapHelpers.h:38
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:101
EDMException.h
edm::ProductID
Definition:
ProductID.h:27
dttmaxenums::R
Definition:
DTTMax.h:28
edm::helpers::KeyVal::key
K key
Definition:
AssociationMapHelpers.h:31
edm::helpers::KeyVal::KeyVal
KeyVal(const K &k, const V &v)
Definition:
AssociationMapHelpers.h:25
edm::helpers::KeyVal
Definition:
AssociationMapHelpers.h:21
edm::errors::InvalidReference
Definition:
EDMException.h:40
EDProductGetter
gen::k
int k[5][pyjets_maxn]
Definition:
Cascade2Hadronizer.cc:79
alignCSCRings.r
r
Definition:
alignCSCRings.py:92
edm::helpers::KeyVal::KeyVal
KeyVal()
Definition:
AssociationMapHelpers.h:24
edm::helpers::KeyVal::value_type
V value_type
Definition:
AssociationMapHelpers.h:23
edm::helpers::KeyVal::KeyVal
KeyVal(K_ &&k, V_ &&v)
Definition:
AssociationMapHelpers.h:27
edm::helpers::Key::Key
Key(EDProductGetter const *getter)
Definition:
AssociationMapHelpers.h:43
helpers
Definition:
makeCompositeCandidate.h:8
edm
HLT enums.
Definition:
AlignableModifier.h:17
edm::helpers::KeyVal::key_type
K key_type
Definition:
AssociationMapHelpers.h:22
edm::helpers::checkRef
void checkRef(const RP &rp, const R &r)
throw if r hasn't the same id as rp
Definition:
AssociationMapHelpers.h:50
edm::helpers::KeyVal::KeyVal
KeyVal(EDProductGetter const *getter)
Definition:
AssociationMapHelpers.h:29
Generated for CMSSW Reference Manual by
1.8.11