src
FWCore
Reflection
interface
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
{
17
class
SetClassParsing
{
18
public
:
19
SetClassParsing
(
bool
enable
) {
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
}
25
~SetClassParsing
() {
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
remoteMonitoring_LED_IterMethod_cfg.enable
enable
Definition:
remoteMonitoring_LED_IterMethod_cfg.py:422
edm::SetClassParsing::active_
static std::atomic< bool > active_
Definition:
SetClassParsing.h:32
edm::SetClassParsing
Definition:
SetClassParsing.h:17
cms::cuda::assert
assert(be >=bs)
edm::SetClassParsing::SetClassParsing
SetClassParsing(bool enable)
Definition:
SetClassParsing.h:19
edm::SetClassParsing::previous_
int previous_
Definition:
SetClassParsing.h:31
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::SetClassParsing::~SetClassParsing
~SetClassParsing()
Definition:
SetClassParsing.h:25
Generated for CMSSW Reference Manual by
1.8.14