Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooSTLRefCountList.cxx
Go to the documentation of this file.
1// Author: Stephan Hageboeck, CERN, 12/2018
2/*****************************************************************************
3 * Project: RooFit *
4 * Authors: *
5 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
6 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
7 * *
8 * Copyright (c) 2000-2005, Regents of the University of California *
9 * and Stanford University. All rights reserved. *
10 * *
11 * Redistribution and use in source and binary forms, *
12 * with or without modification, are permitted according to the terms *
13 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
14 *****************************************************************************/
15
16#include "RooSTLRefCountList.h"
17
18#include "RooRefCountList.h"
19#include "RooLinkedListIter.h"
20#include "RooAbsArg.h"
21#include <string>
22
23// Template specialisation used in RooAbsArg:
25
26namespace RooFit {
27namespace STLRefCountListHelpers {
28/// Converts RooRefCountList to RooSTLRefCountList<RooAbsArg>.
29/// This converter only yields lists with T=RooAbsArg. This is ok because this
30/// the old RefCountList was only holding these.
33 newList.reserve(old.GetSize());
34
35 for(TObject * elm : old) {
36 newList.Add(static_cast<RooAbsArg*>(elm), old.refCount(elm));
37 }
38
39 return newList;
40}
41}
42}
43
#define ClassImp(name)
Definition Rtypes.h:377
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition RooAbsArg.h:74
Int_t GetSize() const
A RooRefCountList is a RooLinkedList that keeps a reference counter with each added node.
Int_t refCount(TObject *obj) const
Return reference count associated with 'obj'.
The RooSTLRefCountList is a simple collection of pointers to the template objects with reference coun...
void Add(T *obj, std::size_t initialCount=1)
Add an object or increase refCount if it is already present.
void reserve(std::size_t amount)
Mother of all ROOT objects.
Definition TObject.h:41
RooSTLRefCountList< RooAbsArg > convert(const RooRefCountList &old)
Converter from the old RooRefCountList to RooSTLRefCountList.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition Common.h:18