38 ClassImp(RooSharedPropertiesList);
46 RooSharedPropertiesList::RooSharedPropertiesList()
48 _propList.setHashTableSize(1000);
56 RooSharedPropertiesList::~RooSharedPropertiesList()
59 RooFIter iter = _propList.fwdIterator() ;
60 RooSharedProperties* prop ;
61 while((prop=(RooSharedProperties*)iter.next())) {
78 RooSharedProperties* RooSharedPropertiesList::registerProperties(RooSharedProperties* prop, Bool_t canDeleteIncoming)
81 oocoutE((TObject*)0,InputArguments) <<
"RooSharedPropertiesList::ERROR null pointer!:" << endl ;
88 if (prop->inSharedList()) {
89 prop->increaseRefCount() ;
94 RooSharedProperties* tmp ;
96 std::map<std::string, RooSharedProperties *>::iterator it;
98 it = _newPropList.find(prop->asString().Data());
99 if (it != _newPropList.end() ) {
103 if (canDeleteIncoming)
delete prop;
105 tmp->increaseRefCount();
108 prop->setInSharedList() ;
109 prop->increaseRefCount() ;
110 _newPropList[prop->asString().Data()] = prop;
121 void RooSharedPropertiesList::unregisterProperties(RooSharedProperties* prop)
123 prop->decreaseRefCount() ;
125 if (prop->refCount()==0) {
126 _propList.Remove(prop) ;
128 std::map<std::string, RooSharedProperties *>::iterator it;
129 it = _newPropList.find(prop->asString().Data());
130 if (it != _newPropList.end() ) _newPropList.erase(it);