BoolCache.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Common_BoolCache_h
2 #define canvas_Persistency_Common_BoolCache_h
3 // -*- C++ -*-
4 //
5 // Package: Common
6 // Class : BoolCache
7 //
8 /**\class BoolCache BoolCache.h DataFormats/Common/interface/BoolCache.h
9 
10  Description: ROOT safe cache flag
11 
12  Usage:
13  We define an external TStreamer for this class in order to guarantee that
14  isCached_ is always reset to false when ever a new instance of this class is
15  read from a file
16 
17 */
18 //
19 // Original Author: Chris Jones
20 // Created: Sat Aug 18 17:30:08 EDT 2007
21 //
22 //
23 
24 // system include files
25 
26 // user include files
27 
28 // forward declarations
29 namespace art {
30  class BoolCache {
31  public:
32  BoolCache() : isCached_(false) {}
33  BoolCache(bool iValue) : isCached_(iValue) {}
34  operator bool() { return isCached_; }
35  // Cannot ref-qualify assignment operator because of GCC_XML.
36  BoolCache&
37  operator=(bool b)
38  {
39  isCached_ = b;
40  return *this;
41  }
42 
43  private:
44  bool isCached_;
45  };
46 }
47 #endif /* canvas_Persistency_Common_BoolCache_h */
48 
49 // Local Variables:
50 // mode: c++
51 // End:
BoolCache(bool iValue)
Definition: BoolCache.h:33
BoolCache & operator=(bool b)
Definition: BoolCache.h:37
bool isCached_
Definition: BoolCache.h:44
static bool * b
Definition: config.cpp:1043
int bool
Definition: qglobal.h:345