41#if __cplusplus > 199711L && !defined _MSC_VER
45#if __cplusplus > 199711L && !defined _MSC_VER
47static std::mutex gTypesMutex;
71#if __cplusplus > 199711L && !defined _MSC_VER
75 if(!fgTypesPtr.compare_exchange_strong(expected,tmp)) {
82 return fgTypesPtr ? *fgTypesPtr : *(fgTypesPtr =
new Types());
91#if __cplusplus > 199711L && !defined _MSC_VER
92 if (fgTypesPtr != 0) {
delete fgTypesPtr.load(); fgTypesPtr = 0; }
94 if (fgTypesPtr != 0) {
delete fgTypesPtr; fgTypesPtr = 0; }
102#if __cplusplus > 199711L && !defined _MSC_VER
103 std::lock_guard<std::mutex> guard(gTypesMutex);
105 std::map<TString, EMVA>::const_iterator it = fStr2type.find( methodname );
106 if (it != fStr2type.end()) {
108 <<
"Cannot add method " << methodname
109 <<
" to the name->type map because it exists already" <<
Endl;
113 fStr2type[methodname] = method;
122#if __cplusplus > 199711L && !defined _MSC_VER
123 std::lock_guard<std::mutex> guard(gTypesMutex);
125 std::map<TString, EMVA>::const_iterator it = fStr2type.find( method );
126 if (it == fStr2type.end()) {
127 Log() << kFATAL <<
"Unknown method in map: " << method <<
Endl;
130 else return it->second;
137#if __cplusplus > 199711L && !defined _MSC_VER
138 std::lock_guard<std::mutex> guard(gTypesMutex);
140 std::map<TString, EMVA>::const_iterator it = fStr2type.begin();
141 for (; it!=fStr2type.end(); ++it)
if (it->second == method)
return it->first;
142 Log() << kFATAL <<
"Unknown method index in map: " << method <<
Endl;
ostringstream derivative to redirect and format output
Singleton class for Global types used by TMVA.
static void DestroyInstance()
"destructor" of the single instance
TString GetMethodName(Types::EMVA method) const
static Types & Instance()
the the single instance of "Types" if existing already, or create it (Singleton)
Bool_t AddTypeMapping(Types::EMVA method, const TString &methodname)
Types::EMVA GetMethodType(const TString &method) const
returns the method type (enum) for a given method (string)
static Types * fgTypesPtr
MsgLogger & Endl(MsgLogger &ml)