36 #if __cplusplus > 199711L
40 #if __cplusplus > 199711L
41 std::atomic<TMVA::Types*> TMVA::Types::fgTypesPtr{0};
42 static std::mutex gTypesMutex;
66 #if __cplusplus > 199711L
70 if(!fgTypesPtr.compare_exchange_strong(expected,tmp)) {
77 return fgTypesPtr ? *fgTypesPtr : *(fgTypesPtr =
new Types());
85 #if __cplusplus > 199711L
86 if (fgTypesPtr != 0) {
delete fgTypesPtr.load(); fgTypesPtr = 0; }
88 if (fgTypesPtr != 0) {
delete fgTypesPtr; fgTypesPtr = 0; }
97 #if __cplusplus > 199711L
98 std::lock_guard<std::mutex> guard(gTypesMutex);
100 std::map<TString, EMVA>::const_iterator it = fStr2type.find( methodname );
101 if (it != fStr2type.end()) {
103 <<
"Cannot add method " << methodname
104 <<
" to the name->type map because it exists already" <<
Endl;
108 fStr2type[methodname] = method;
116 #if __cplusplus > 199711L
117 std::lock_guard<std::mutex> guard(gTypesMutex);
120 std::map<TString, EMVA>::const_iterator it = fStr2type.find( method );
121 if (it == fStr2type.end()) {
122 Log() <<
kFATAL <<
"Unknown method in map: " << method <<
Endl;
125 else return it->second;
132 #if __cplusplus > 199711L
133 std::lock_guard<std::mutex> guard(gTypesMutex);
135 std::map<TString, EMVA>::const_iterator it = fStr2type.begin();
136 for (; it!=fStr2type.end(); it++)
if (it->second == method)
return it->first;
137 Log() <<
kFATAL <<
"Unknown method index in map: " << method <<
Endl;
MsgLogger & Endl(MsgLogger &ml)
static Types & Instance()
the the single instance of "Types" if existin already, or create it (Signleton)
Bool_t AddTypeMapping(Types::EMVA method, const TString &methodname)
TString GetMethodName(Types::EMVA method) const
Types::EMVA GetMethodType(const TString &method) const
static void DestroyInstance()
"destructor" of the single instance