LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Transient.h
Go to the documentation of this file.
1
#ifndef canvas_Persistency_Provenance_Transient_h
2
#define canvas_Persistency_Provenance_Transient_h
3
// vim: set sw=2 expandtab :
4
5
// ===================================================================
6
// We give all instantiations of this template a 'transient="true"'
7
// attribute for the value_ data member to tell ROOT to never write
8
// it to disk. We also set all instantiations (by hand!) to have a
9
// custom streamer (TransientStreamer) that makes sure if the ROOT
10
// I/O buffer is reused for reading that the data member _value is
11
// reinitialized with a default-constructed T.
12
// ===================================================================
13
14
namespace
art
{
15
template
<
typename
T>
16
class
Transient
{
17
public
:
18
using
value_type
= T;
19
Transient
(T
value
= {}) :
value_
(
value
) {}
20
operator
T()
const
{
return
value_
; }
21
Transient
&
22
operator=
(T rh)
23
{
24
value_
= rh;
25
return
*
this
;
26
}
27
T
const
&
28
get
()
const
noexcept
29
{
30
return
value_
;
31
}
32
T&
33
get
() noexcept
34
{
35
return
value_
;
36
}
37
38
private
:
39
T
value_
;
40
};
41
}
42
#endif
/* canvas_Persistency_Provenance_Transient_h */
43
44
// Local Variables:
45
// mode: c++
46
// End:
art::Transient::Transient
Transient(T value={})
Definition:
Transient.h:19
art::ProductProvenance::Transients
Definition:
ProductProvenance.h:22
art::Transient::operator=
Transient & operator=(T rh)
Definition:
Transient.h:22
value
double value
Definition:
spectrum.C:18
art::Transient
Definition:
Transient.h:16
art
Definition:
MVAAlg.h:12
art::Transient::value_
T value_
Definition:
Transient.h:39
canvas
Persistency
Provenance
Transient.h
Generated on Thu May 2 2024 20:59:31 for LArSoft by
1.8.11