Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooTObjWrap.h
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*****************************************************************************
4 * Project: RooFit *
5 * Package: RooFitCore *
6 * File: $Id: RooTObjWrap.h,v 1.7 2007/05/11 09:11:30 verkerke Exp $
7 * Authors: *
8 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
9 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
10 * *
11 * Copyright (c) 2000-2005, Regents of the University of California *
12 * and Stanford University. All rights reserved. *
13 * *
14 * Redistribution and use in source and binary forms, *
15 * with or without modification, are permitted according to the terms *
16 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
17 *****************************************************************************/
18
19#ifndef ROO_TOBJ_WRAP
20#define ROO_TOBJ_WRAP
21
22#include "Rtypes.h"
23#include "TNamed.h"
24#include "RooLinkedList.h"
25
26class RooTObjWrap : public TNamed {
27public:
28
29 RooTObjWrap(bool isArray=false) : _isArray(isArray), _owning(false) {} ;
30 RooTObjWrap(TObject* inObj, bool isArray=false) : TNamed(), _isArray(isArray), _owning(false) { if (inObj) _list.Add(inObj) ; }
31 RooTObjWrap(const RooTObjWrap& other) : TNamed(other), _isArray(other._isArray), _owning(false), _list(other._list) {}
32 ~RooTObjWrap() override { if (_owning) _list.Delete() ; } ;
33
34 void setOwning(bool flag) { _owning = flag ; }
35 TObject* obj() const { return _list.At(0) ; }
36 const RooLinkedList& objList() const { return _list ; }
37
38 void setObj(TObject* inObj) {
39 if (!_isArray) {
40 _list.Clear() ;
41 }
42 if (inObj) _list.Add(inObj) ;
43 }
44
45protected:
46
47 bool _isArray ;
48 bool _owning ;
49 RooLinkedList _list ;
50 ClassDefOverride(RooTObjWrap,2) // Container class for Int_t
51};
52
53#endif
54
55/// \endcond
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
void Clear(Option_t *o=nullptr) override
Remove all elements from collection.
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Delete(Option_t *option="")
Delete this object.
Definition TObject.cxx:248