src
FWCore
Framework
interface
CacheHandle.h
Go to the documentation of this file.
1
#ifndef FWCore_Framework_CacheHandle_h
2
#define FWCore_Framework_CacheHandle_h
3
10
#include "
FWCore/Utilities/interface/Exception.h
"
11
12
namespace
edm
{
13
14
template
<
typename
T>
15
class
CacheHandle
{
16
public
:
17
CacheHandle
() :
data_
(nullptr) {}
18
CacheHandle
(
T
const
*
data
) :
data_
(
data
) {}
19
20
T
const
*
get
()
const
{
21
if
(!
isValid
()) {
22
throw
cms::Exception
(
"InvalidCache"
) <<
"CacheHandle is invalid"
;
23
}
24
return
data_
;
25
}
26
T
const
*
operator->
()
const
{
return
get
(); }
27
T
const
&
operator*
()
const
{
return
*
get
(); }
28
29
bool
isValid
()
const
{
return
data_
!=
nullptr
; }
30
31
private
:
32
T
const
*
data_
;
33
};
34
}
// namespace edm
35
#endif
edm::CacheHandle::operator*
T const & operator*() const
Definition:
CacheHandle.h:27
edm::CacheHandle
Definition:
CacheHandle.h:15
Exception
Definition:
hltDiff.cc:245
edm::CacheHandle::isValid
bool isValid() const
Definition:
CacheHandle.h:29
Exception.h
edm::CacheHandle::operator->
T const * operator->() const
Definition:
CacheHandle.h:26
edm::CacheHandle::CacheHandle
CacheHandle()
Definition:
CacheHandle.h:17
edm
HLT enums.
Definition:
AlignableModifier.h:19
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
T
long double T
Definition:
Basic3DVectorLD.h:48
edm::CacheHandle::CacheHandle
CacheHandle(T const *data)
Definition:
CacheHandle.h:18
edm::CacheHandle::data_
T const * data_
Definition:
CacheHandle.h:32
Generated for CMSSW Reference Manual by
1.8.14