#include "RooFit.h"
#include "RooSentinel.h"
#include "RooNameReg.h"
#include "RooNameReg.h"
ClassImp(RooNameReg)
;
RooNameReg* RooNameReg::_instance = 0 ;
RooNameReg::~RooNameReg()
{
_list.Delete() ;
}
RooNameReg::RooNameReg(const RooNameReg& other) : TNamed(other)
{
}
RooNameReg& RooNameReg::instance()
{
if (_instance==0) {
_instance = new RooNameReg ;
RooSentinel::activate() ;
}
return *_instance ;
}
void RooNameReg::cleanup()
{
if(_instance) {
delete _instance ;
_instance = 0 ;
}
}
const TNamed* RooNameReg::constPtr(const char* str) {
if (str==0) return 0 ;
TNamed* t = (TNamed*) _htable.find(str) ;
if (t) return t ;
t = new TNamed(str,str) ;
_htable.add(t) ;
_list.Add(t) ;
return t ;
}
const char* RooNameReg::constStr(const TNamed* namePtr)
{
if (namePtr) return namePtr->GetName() ;
return 0 ;
}
const TNamed* RooNameReg::ptr(const char* stringPtr)
{
return instance().constPtr(stringPtr) ;
}
const char* RooNameReg::str(const TNamed* ptr)
{
return instance().constStr(ptr) ;
}
Last update: Thu Jan 17 08:45:19 2008
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.