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:
25
26/// Converts RooLinkedList to RooSTLRefCountList<RooAbsArg>.
27/// This converter only yields lists with T=RooAbsArg. This is ok because this
28/// the old RefCountList was only holding these.
29template <>
30RooSTLRefCountList<RooAbsArg> RooSTLRefCountList<RooAbsArg>::convert(const RooLinkedList& old) {
31 RooSTLRefCountList<RooAbsArg> newList;
32 newList.reserve(old.GetSize());
33
34 // The reference counts were never written to files, so they are all one.
35 for(TObject * elm : old) {
36 newList.Add(static_cast<RooAbsArg*>(elm), 1);
37 }
38
39 return newList;
40}
41
42/// \endcond
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
Collection class for internal use, storing a collection of TObject pointers in a vector.
Int_t GetSize() const
Mother of all ROOT objects.
Definition TObject.h:42