LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
CPCSentry.h
Go to the documentation of this file.
1
#ifndef art_Framework_Core_CPCSentry_h
2
#define art_Framework_Core_CPCSentry_h
3
4
#include "cetlib/exempt_ptr.h"
5
6
// ======================================================================
7
//
8
// class CPCSentry uses RAII to make sure that the
9
// CurrentProcessingContext pointer it is guarding is set to the right
10
// value, and cleared at the right time.
11
//
12
// ======================================================================
13
14
namespace
art
{
15
16
class
CurrentProcessingContext;
17
18
namespace
detail {
19
20
class
CPCSentry
{
21
public
:
22
CPCSentry
(cet::exempt_ptr<CurrentProcessingContext const>& c,
23
cet::exempt_ptr<CurrentProcessingContext const>
value
)
24
:
referenced_
{&c}
25
{
26
c =
value
;
27
}
28
29
~CPCSentry
() noexcept { *
referenced_
=
nullptr
; }
30
31
private
:
32
cet::exempt_ptr<CurrentProcessingContext const>*
referenced_
;
33
};
// CPCSentry
34
35
}
// detail
36
}
// art
37
38
// ======================================================================
39
40
#endif
/* art_Framework_Core_CPCSentry_h */
41
42
// Local Variables:
43
// mode: c++
44
// End:
art::detail::CPCSentry::CPCSentry
CPCSentry(cet::exempt_ptr< CurrentProcessingContext const > &c, cet::exempt_ptr< CurrentProcessingContext const > value)
Definition:
CPCSentry.h:22
art::detail::CPCSentry
Definition:
CPCSentry.h:20
fhicl::detail::atom::value
std::string value(boost::any const &)
Definition:
printing_helpers.cc:97
art::detail::CPCSentry::referenced_
cet::exempt_ptr< CurrentProcessingContext const > * referenced_
Definition:
CPCSentry.h:32
art::detail::CPCSentry::~CPCSentry
~CPCSentry() noexcept
Definition:
CPCSentry.h:29
art
HLT enums.
Definition:
ServiceProviderWrappers.h:36
art
Framework
Core
CPCSentry.h
Generated on Wed Dec 12 2018 14:42:31 for LArSoft by
1.8.11