Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
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
#endif
32
33
K
key
;
34
V
val
;
35
};
36
37
template
<
typename
K>
38
struct
Key
{
39
typedef
K
key_type
;
40
Key
() { }
41
Key
(
const
K &
k
) :
key
(k) { }
42
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
43
template
<
typename
K_>
44
Key
(K_&&
k
) :
key
(std::forward<K_>(
k
)) { }
45
46
Key
(
EDProductGetter
const
* getter) :
key
(
ProductID
(), getter) { }
47
#endif
48
49
K
key
;
50
};
51
53
template
<
typename
RP,
typename
R>
54
void
checkRef
(
const
RP & rp,
const
R
&
r
) {
55
if
(rp.id() != r.id()) {
56
Exception::throwThis
(
edm::errors::InvalidReference
,
"invalid reference"
);
57
}
58
}
59
}
60
}
61
62
#endif
edm::helpers::Key
Definition:
AssociationMapHelpers.h:38
edm::helpers::Key::key
K key
Definition:
AssociationMapHelpers.h:49
edm::EDProductGetter
Definition:
EDProductGetter.h:34
edm::helpers::Key::key_type
K key_type
Definition:
AssociationMapHelpers.h:39
edm::helpers::Key::Key
Key(const K &k)
Definition:
AssociationMapHelpers.h:41
findQualityFiles.v
v
Definition:
findQualityFiles.py:177
edm::helpers::KeyVal::val
V val
Definition:
AssociationMapHelpers.h:34
edm::helpers::Key::Key
Key(K_ &&k)
Definition:
AssociationMapHelpers.h:44
edm::helpers::Key::Key
Key()
Definition:
AssociationMapHelpers.h:40
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:33
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
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:28
edm::helpers::Key::Key
Key(EDProductGetter const *getter)
Definition:
AssociationMapHelpers.h:46
alignCSCRings.r
list r
Definition:
alignCSCRings.py:92
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:54
relval_steps.k
list k
Definition:
relval_steps.py:1552
edm::helpers::KeyVal::KeyVal
KeyVal(EDProductGetter const *getter)
Definition:
AssociationMapHelpers.h:30
Generated for CMSSW Reference Manual by
1.8.5