38 TNamed(
"RooNameReg",
"RooFit Name Registry")
75 if (inStr==0)
return 0 ;
78 auto elm =
_map.find(inStr) ;
79 if (elm !=
_map.end())
return elm->second.get();
82 auto t = make_unique<TNamed>(inStr,inStr);
84 _map.emplace(std::string(inStr), std::move(t));
96 if (namePtr)
return namePtr->
GetName() ;
106 if (stringPtr==0)
return 0 ;
116 if (
ptr==0)
return 0 ;
127 if (inStr==0)
return 0 ;
129 const auto elm = reg.
_map.find(inStr);
130 return elm != reg.
_map.end() ? elm->second.get() :
nullptr;
RooNameReg is a registry for const char* names.
std::unordered_map< std::string, std::unique_ptr< TNamed > > _map
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
virtual ~RooNameReg()
Destructor.
const TNamed * constPtr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
static RooNameReg & instance()
Return reference to singleton instance.
static const TNamed * known(const char *stringPtr)
If the name is already known, return its TNamed pointer. Otherwise return 0 (don't register the name)...
const char * constStr(const TNamed *namePtr)
Return C++ string corresponding to given TNamed pointer.
static void cleanup()
Cleanup function called by atexit() handler installed by RooSentinel to delete global objects on heap...
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetName() const
Returns name of object.