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/// \cond ROOFIT_INTERNAL
17
18#include "RooSTLRefCountList.h"
19
20#include "RooLinkedList.h"
21#include "RooLinkedListIter.h"
22#include "RooAbsArg.h"
23
24// Template specialisation used in RooAbsArg:
26
27/// Converts RooLinkedList to RooSTLRefCountList<RooAbsArg>.
28/// This converter only yields lists with T=RooAbsArg. This is ok because this
29/// the old RefCountList was only holding these.
30template <>
33 newList.reserve(old.GetSize());
34
35 for(TObject * elm : old) {
36 newList.Add(static_cast<RooAbsArg*>(elm), old.findLink(elm)->refCount());
37 }
38
39 return newList;
40}
41
42/// \endcond
#define ClassImp(name)
Definition Rtypes.h:382
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:79
Int_t refCount() const
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
Int_t GetSize() const
RooLinkedListElem * findLink(const TObject *arg) const
Find the element link containing the given object.
Mother of all ROOT objects.
Definition TObject.h:41