*****************************************************************************/
#include "RooFit.h"
#include "RooRefCountList.h"
#include "RooRefCountList.h"
#include "Riostream.h"
#include <stdlib.h>
ClassImp(RooRefCountList)
;
RooRefCountList::RooRefCountList()
: RooLinkedList(17)
{
}
void RooRefCountList::Add(TObject* obj, Int_t count)
{
TObject* listObj = FindObject(obj) ;
if (!listObj) {
RooLinkedList::Add(obj, count) ;
} else {
RooLinkedListElem* link = findLink(obj) ;
while(count--) link->incRefCount() ;
}
}
Bool_t RooRefCountList::Remove(TObject* obj)
{
RooLinkedListElem* link = findLink(obj) ;
if (!link) {
return 0 ;
} else {
if (link->decRefCount()==0) {
return RooLinkedList::Remove(obj) ;
}
}
return 0 ;
}
Bool_t RooRefCountList::RemoveAll(TObject* obj)
{
return RooLinkedList::Remove(obj) ;
}
Int_t RooRefCountList::refCount(TObject* obj)
{
RooLinkedListElem* link = findLink(obj) ;
if (!link) {
return 0 ;
} else {
return link->refCount() ;
}
}
ROOT page - Class index - Class Hierarchy - Top of the page
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.