Transient.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Provenance_Transient_h
2 #define canvas_Persistency_Provenance_Transient_h
3 
4 /**\class Transient Transient.h DataFormats/Provenance/interface/Transient.h
5 
6  Description: ROOT safe bool
7 
8  Usage:
9  We define a template for transients in order to guarantee that value_
10  is always reset when ever a new instance of this class is read from a file.
11 */
12 
13 // forward declarations
14 namespace art {
15 
16  template <typename T>
17  class Transient {
18  public:
19  typedef T value_type;
21  operator T() const { return value_; }
22  Transient&
24  {
25  value_ = rh;
26  return *this;
27  }
28  T const&
29  get() const noexcept
30  {
31  return value_;
32  }
33  T&
34  get() noexcept
35  {
36  return value_;
37  }
38 
39  private:
41  };
42 }
43 #endif /* canvas_Persistency_Provenance_Transient_h */
44 
45 // Local Variables:
46 // mode: c++
47 // End:
TH2 * rh
Definition: drawXsec.C:5
Transient(T value=T())
Definition: Transient.h:20
Transient & operator=(T rh)
Definition: Transient.h:23
const XML_Char int const XML_Char * value
Definition: expat.h:331
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8
double T
Definition: Xdiff_gwt.C:5