Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DataFormats
Common
src
EDProductGetter.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: EDProduct
4
// Class : EDProductGetter
5
//
6
// Implementation:
7
// <Notes on implementation>
8
//
9
// Original Author: Chris Jones
10
// Created: Tue Nov 1 15:06:41 EST 2005
11
//
12
13
// system include files
14
15
// user include files
16
#include "
DataFormats/Common/interface/EDProductGetter.h
"
17
#include "
DataFormats/Provenance/interface/ProductID.h
"
18
#include "
FWCore/Utilities/interface/EDMException.h
"
19
20
namespace
edm {
21
//
22
// constants, enums and typedefs
23
//
24
25
//
26
// static data member definitions
27
//
28
29
//
30
// constructors and destructor
31
//
32
EDProductGetter::EDProductGetter
()
33
{
34
}
35
36
// EDProductGetter::EDProductGetter(EDProductGetter const& rhs)
37
// {
38
// // do actual copying here;
39
// }
40
41
EDProductGetter::~EDProductGetter
()
42
{
43
}
44
45
//
46
// assignment operators
47
//
48
// EDProductGetter const& EDProductGetter::operator=(EDProductGetter const& rhs)
49
// {
50
// //An exception safe implementation is
51
// EDProductGetter temp(rhs);
52
// swap(rhs);
53
//
54
// return *this;
55
// }
56
57
//
58
// member functions
59
//
60
61
//
62
// const member functions
63
//
64
65
//
66
// static member functions
67
//
68
69
EDProductGetter
const
*
70
mustBeNonZero
(
EDProductGetter
const
* prodGetter,
std::string
refType,
ProductID
const
& productID) {
71
if
(prodGetter !=
nullptr
)
return
prodGetter;
72
throw
Exception
(
errors::InvalidReference
, refType)
73
<<
"Attempt to construct a "
<< refType <<
" with ProductID "
<< productID <<
"\n"
74
<<
"but with a null pointer to a product getter.\n"
75
<<
"The product getter pointer passed to the constructor must refer\n"
76
<<
"to a real getter, such as an EventPrincipal.\n"
;
77
}
78
79
thread_local
EDProductGetter
const
*
s_productGetter
=
nullptr
;
80
EDProductGetter
const
*
81
EDProductGetter::switchProductGetter
(
EDProductGetter
const
* iNew)
82
{
83
//std::cout <<"switch from "<<s_productGetter<<" to "<<iNew<<std::endl;
84
EDProductGetter
const
* old =
s_productGetter
;
85
s_productGetter
= iNew;
86
return
old;
87
}
88
void
89
EDProductGetter::assignEDProductGetter
(
EDProductGetter
const
* & iGetter)
90
{
91
//std::cout <<"assign "<<s_productGetter<<std::endl;
92
93
iGetter =
s_productGetter
;
94
}
95
96
97
}
edm::mustBeNonZero
EDProductGetter const * mustBeNonZero(EDProductGetter const *prodGetter, std::string refType, ProductID const &productID)
Definition:
EDProductGetter.cc:70
edm::EDProductGetter
Definition:
EDProductGetter.h:34
edm::s_productGetter
thread_local EDProductGetter const * s_productGetter
Definition:
EDProductGetter.cc:79
ProductID.h
edm::EDProductGetter::~EDProductGetter
virtual ~EDProductGetter()
Definition:
EDProductGetter.cc:41
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
edm::EDProductGetter::EDProductGetter
EDProductGetter()
Definition:
EDProductGetter.cc:32
EDMException.h
edm::ProductID
Definition:
ProductID.h:27
edm::errors::InvalidReference
Definition:
EDMException.h:40
edm::hlt::Exception
error
Definition:
HLTenums.h:21
edm::EDProductGetter::assignEDProductGetter
static void assignEDProductGetter(EDProductGetter const *&)
Definition:
EDProductGetter.cc:89
EDProductGetter.h
edm::EDProductGetter::switchProductGetter
static EDProductGetter const * switchProductGetter(EDProductGetter const *)
These can only be used internally by the framework.
Definition:
EDProductGetter.cc:81
Generated for CMSSW Reference Manual by
1.8.5