30 #if __cplusplus > 199711L
37 #if __cplusplus > 199711L
38 std::atomic<TMVA::Types*> TMVA::Types::fgTypesPtr{0};
39 static std::mutex gTypesMutex;
63 #if __cplusplus > 199711L
67 if(!fgTypesPtr.compare_exchange_strong(expected,tmp)) {
74 return fgTypesPtr ? *fgTypesPtr : *(fgTypesPtr =
new Types());
82 #if __cplusplus > 199711L
83 if (fgTypesPtr != 0) {
delete fgTypesPtr.load(); fgTypesPtr = 0; }
85 if (fgTypesPtr != 0) {
delete fgTypesPtr; fgTypesPtr = 0; }
94 #if __cplusplus > 199711L
95 std::lock_guard<std::mutex> guard(gTypesMutex);
97 std::map<TString, EMVA>::const_iterator it = fStr2type.find( methodname );
98 if (it != fStr2type.end()) {
100 <<
"Cannot add method " << methodname
101 <<
" to the name->type map because it exists already" <<
Endl;
105 fStr2type[methodname] = method;
113 #if __cplusplus > 199711L
114 std::lock_guard<std::mutex> guard(gTypesMutex);
117 std::map<TString, EMVA>::const_iterator it = fStr2type.find( method );
118 if (it == fStr2type.end()) {
119 Log() <<
kFATAL <<
"Unknown method in map: " << method <<
Endl;
122 else return it->second;
129 #if __cplusplus > 199711L
130 std::lock_guard<std::mutex> guard(gTypesMutex);
132 std::map<TString, EMVA>::const_iterator it = fStr2type.begin();
133 for (; it!=fStr2type.end(); it++)
if (it->second == method)
return it->first;
134 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