DataFormats
Common
interface
HolderToVectorTrait.h
Go to the documentation of this file.
1
#ifndef DataFormats_Common_HolderToVectorTrait_h
2
#define DataFormats_Common_HolderToVectorTrait_h
3
#include "
FWCore/Utilities/interface/EDMException.h
"
4
#include <memory>
5
6
namespace
edm
{
7
namespace
reftobase {
8
class
RefVectorHolderBase;
9
template
<
typename
T>
10
class
BaseVectorHolder;
11
12
template
<
typename
T,
typename
REF>
13
struct
InvalidHolderToVector
{
14
static
std::unique_ptr<BaseVectorHolder<T> >
makeVectorHolder
() {
15
Exception::throwThis
(
errors::InvalidReference
,
16
"InvalidHolderToVector: trying to use RefToBase built with "
17
"an internal type. RefToBase should be built passing an "
18
"object of type edm::Ref<C>. This exception should never "
19
"be thrown if a RefToBase was built from a RefProd<C>."
);
20
return
std::unique_ptr<BaseVectorHolder<T> >();
21
}
22
};
23
24
template
<
typename
T,
typename
REF>
25
struct
HolderToVectorTrait
{
26
// static_assert(sizeof(REF) == 0);
27
typedef
InvalidHolderToVector<T, REF>
type
;
28
};
29
30
template
<
typename
REF>
31
struct
InvalidRefHolderToRefVector
{
32
static
std::unique_ptr<RefVectorHolderBase>
makeVectorHolder
() {
33
Exception::throwThis
(
errors::InvalidReference
,
34
"InvalidRefHolderToRefVector: trying to use RefToBaseVector built with "
35
"an internal type. RefToBase should be built passing an "
36
"object of type edm::RefVector<C>"
);
37
return
std::unique_ptr<RefVectorHolderBase>();
38
}
39
};
40
41
template
<
typename
REF>
42
struct
RefHolderToRefVectorTrait
{
43
// static_assert(sizeof(REF) == 0);
44
typedef
InvalidRefHolderToRefVector<REF>
type
;
45
};
46
47
}
// namespace reftobase
48
}
// namespace edm
49
50
//Handle specialization here
51
#include "
DataFormats/Common/interface/HolderToVectorTrait_Ref_specialization.h
"
52
#include "
DataFormats/Common/interface/HolderToVectorTrait_Ptr_specialization.h
"
53
#include "
DataFormats/Common/interface/HolderToVectorTrait_RefProd_specialization.h
"
54
55
#endif
edm::reftobase::InvalidRefHolderToRefVector
Definition:
HolderToVectorTrait.h:31
edm::errors::InvalidReference
Definition:
EDMException.h:39
edm
HLT enums.
Definition:
AlignableModifier.h:19
EDMException.h
edm::reftobase::RefHolderToRefVectorTrait::type
InvalidRefHolderToRefVector< REF > type
Definition:
HolderToVectorTrait.h:44
edm::reftobase::InvalidHolderToVector::makeVectorHolder
static std::unique_ptr< BaseVectorHolder< T > > makeVectorHolder()
Definition:
HolderToVectorTrait.h:14
edm::reftobase::InvalidRefHolderToRefVector::makeVectorHolder
static std::unique_ptr< RefVectorHolderBase > makeVectorHolder()
Definition:
HolderToVectorTrait.h:32
HolderToVectorTrait_Ref_specialization.h
edm::reftobase::HolderToVectorTrait
Definition:
HolderToVectorTrait.h:25
edm::reftobase::InvalidHolderToVector
Definition:
HolderToVectorTrait.h:13
HolderToVectorTrait_RefProd_specialization.h
edm::reftobase::RefHolderToRefVectorTrait
Definition:
HolderToVectorTrait.h:42
edm::reftobase::HolderToVectorTrait::type
InvalidHolderToVector< T, REF > type
Definition:
HolderToVectorTrait.h:27
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
HolderToVectorTrait_Ptr_specialization.h
Generated for CMSSW Reference Manual by
1.8.16