CMS 3D CMS Logo

SetClassParsing.h
Go to the documentation of this file.
1 #ifndef FWCore_Reflection_interface_SetClassParsing_h
2 #define FWCore_Reflection_interface_SetClassParsing_h
3 
4 #include "TInterpreter.h"
5 
6 #include <atomic>
7 #include <cassert>
8 
9 namespace edm {
18  public:
20  bool expected = false;
21  const bool used_concurrently_but_shouldnt = active_.compare_exchange_strong(expected, true);
22  assert(used_concurrently_but_shouldnt);
23  previous_ = gInterpreter->SetClassAutoparsing(enable);
24  }
26  gInterpreter->SetClassAutoparsing(previous_);
27  active_ = false;
28  }
29 
30  private:
31  int previous_;
32  static std::atomic<bool> active_; // to detect if the class is used in concurrent context
33  };
34 } // namespace edm
35 
36 #endif
static std::atomic< bool > active_
assert(be >=bs)
enable
Messages.
Definition: DiMuonV_cfg.py:92
SetClassParsing(bool enable)
HLT enums.