Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:50

0001 #ifndef DataFormats_Common_BoolCache_h
0002 #define DataFormats_Common_BoolCache_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Common
0006 // Class  :     BoolCache
0007 //
0008 /**\class BoolCache BoolCache.h DataFormats/Common/interface/BoolCache.h
0009 
0010  Description: ROOT safe cache flag
0011 
0012  Usage:
0013     We define schema evolution rules for this class in order to guarantee that isCached_
0014     is always reset to false when ever a new instance of this class is read from a file
0015 
0016 */
0017 //
0018 // Original Author:  Chris Jones
0019 //         Created:  Sat Aug 18 17:30:08 EDT 2007
0020 //
0021 
0022 // system include files
0023 
0024 // user include files
0025 
0026 // forward declarations
0027 namespace edm {
0028   class BoolCache {
0029   public:
0030     BoolCache() : isCached_(false) {}
0031     BoolCache(bool iValue) : isCached_(iValue) {}
0032     operator bool() { return isCached_; }
0033     BoolCache& operator=(bool b) {
0034       isCached_ = b;
0035       return *this;
0036     }
0037 
0038   private:
0039     bool isCached_;
0040   };
0041 
0042 }  // namespace edm
0043 #endif